History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17103
Type: Bug Bug
Status: Open Open
Assignee: Dmitry Jemerov
Reporter: Alexei Krainiouk
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Bogus assertion when method return type is annotated @NotNull

Created: 09 Feb 08 00:14   Updated: 24 Apr 08 13:47
Component/s: Compiling Project

File Attachments: 1. File Test.class (1 kb)
2. Java Source File Test.java (0.4 kb)

Environment:
OS: Fedora 8 x64,
JRE: Sun JSDK 1.6.0_04
$ uname -a
Linux canoe 2.6.23.14-115.fc8 #1 SMP Mon Jan 21 14:22:56 EST 2008 x86_64 x86_64 x86_64 GNU/Linux)
$ java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
Issue Links:
Duplicate
 
This issue is duplicated by:
IDEA-17116 Exception "@NotNull methodt must not ... Resolved
IDEADEV-26198 [#9120] ISE: StringUtil.convertLineSe... Major Resolved
IDEADEV-26190 [#9115] ISE: DaemonCodeAnalyzerImpl.<... Major Resolved
RUBY-1428 java.lang.IllegalStateException: @Not... Normal Resolved
RUBY-1442 java.lang.IllegalStateException: @Not... Normal Closed

Build: 7,590
Severity: High


 Description  « Hide
After upgrading to Sun JDK-1.6.0_04 I stated getting bogus IllegalStateError exceptions on a method that was annotated not to return null even though actual values were not null.

I have rectified this case as far as I could and attached both java source and class file generated by IDEA with "Add @NotNull assertions" option turned on.

This code works fine with JDK-1.6.0_03 and earlier. It fails however when attempted to run under JDK-1.6.0_04:

java -cp . Test
Exception in thread "main" java.lang.IllegalStateException: @NotNull method Test.test must not return null
        at Test.test(Test.java)
        at Test.main(Test.java:8)

I was able to reproduce this error with both 64 and 32 bit JVMs but it appears to be specific to Linux platform only.



 All   Comments   Work Log   Change History      Sort Order:
Sascha Weinreuter - 09 Feb 08 01:26
Interesting, maybe this also explains IDEADEV-20470, which I've seen on a Windows system with 1.6.0_04 as well...

Alexei Krainiouk - 05 Mar 08 19:23
Also reproducible with recent JDK update from Sun:
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)