Bug 366331 - [compiler] AIOOBE in Statement.analyseArguments if using javax.annotations.Nonnull
Summary: [compiler] AIOOBE in Statement.analyseArguments if using javax.annotations.No...
Status: VERIFIED DUPLICATE of bug 365983
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-11 07:01 EST by Andrey Loskutov CLA
Modified: 2012-01-23 03:11 EST (History)
3 users (show)

See Also:


Attachments
FindBugs JDT core project settings (30.44 KB, application/octet-stream)
2011-12-11 07:01 EST, Andrey Loskutov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2011-12-11 07:01:27 EST
Created attachment 208225 [details]
FindBugs JDT core project settings

I was trying to apply new NPE annotation checks in JDT to the FindBugs project, which has already javax.annotation.Nonnull annotation (see attached core prefs).

After configuring JDT to use javax.annotation.Nullable and javax.annotation.Nonnull (both are on the project classpath) the automatically started project build thrown the exception below.

java.lang.ArrayIndexOutOfBoundsException: 1
	at org.eclipse.jdt.internal.compiler.ast.Statement.analyseArguments(Statement.java:68)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:103)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:108)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:703)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:255)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:111)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:776)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
	at java.lang.Thread.run(Thread.java:722)
Comment 1 Stephan Herrmann CLA 2011-12-11 14:54:22 EST
Thanks for reporting. I think you might be bitten by bug 365983, which
was detected during M4 testing, but the fix didn't make it in time
for the milestone, sorry!

To verify that this is the same issue: can you confirm that there's
a varargs method involved in your project that triggers the bug?
Either that method has an explicit null annotation or it is subject
to a default, right?


BTW:

(In reply to comment #0)
> I was trying to apply new NPE annotation checks in JDT to the FindBugs project,
> which has already javax.annotation.Nonnull annotation (see attached core
> prefs).
> 
> After configuring JDT to use javax.annotation.Nullable and
> javax.annotation.Nonnull (both are on the project classpath) the automatically
> started project build thrown the exception below.

When mapping to FindBugs annotations, wouldn't you want to map
nullable to javax.annotation.CheckForNull?
Comment 2 Andrey Loskutov CLA 2011-12-11 17:26:34 EST
Hi Stephan,
I think I have to report another one bug - only first build with enabled annotations on a given project seems to report "nullness contract violation". All other consequent builds seems NOT to report anything, and so I'm currently unable to reproduce the error.

I've found the originally reported error during analysis of findbugs project from SVN trunk. But once I've restarted Eclipse, all consequent attempts to reproduce it failed. I will report another one bug related to "lazy/sloppy" compilation.
Comment 3 Srikanth Sankaran CLA 2011-12-11 21:39:05 EST
(In reply to comment #1)
> Thanks for reporting. I think you might be bitten by bug 365983, which
> was detected during M4 testing, but the fix didn't make it in time
> for the milestone, sorry!

Ayush, can you review the patch for bug 365983 for inclusion in this
week's integration build - Thanks.

(In reply to comment #2)

> I've found the originally reported error during analysis of findbugs project
> from SVN trunk. But once I've restarted Eclipse, all consequent attempts to
> reproduce it failed. I will report another one bug related to "lazy/sloppy"
> compilation.

I think this is bug 365983 which is a duplicate of bug 365992. If a patch
becomes available in time, we can include this also for I build this week.
Please take Ayush's help for review.
Comment 4 Srikanth Sankaran CLA 2011-12-11 21:40:51 EST
(In reply to comment #3)

> I think this is bug 365983 which is a duplicate of bug 365992. If a patch

I meant to say bug 366341 which is a duplicate of 365992, sorry for the
confusion.
Comment 5 Ayushman Jain CLA 2011-12-12 01:17:30 EST
Hi Andrey,
> To verify that this is the same issue: can you confirm that there's
> a varargs method involved in your project that triggers the bug?
Can you please confirm this? We can then mark this bug as a dup of bug 365983
Comment 6 Ayushman Jain CLA 2011-12-19 11:18:24 EST
(In reply to comment #5)
> Hi Andrey,
> Can you please confirm this? We can then mark this bug as a dup of bug 365983

Andrey, bug 365983 has been fixed. Can you please confirm if this is the same issue? And if possible, try out the latest build to verify? Thanks!
Comment 7 Andrey Loskutov CLA 2011-12-19 12:02:38 EST
(In reply to comment #6)
> Andrey, bug 365983 has been fixed. Can you please confirm if this is the same
> issue? And if possible, try out the latest build to verify? Thanks!

Thanks for fixing Ayushman. I would try, but during Christmas time is hard to predict if and when one would have free time :-)
Comment 8 Srikanth Sankaran CLA 2012-01-11 03:36:28 EST
I think it is the same bug, in the remote chance it is not and is
still open, please reopen. Thanks.

*** This bug has been marked as a duplicate of bug 365983 ***
Comment 9 Srikanth Sankaran CLA 2012-01-23 03:11:25 EST
Verified for 3.8 M5 using build id: I20120122-2000