Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 470162

Summary: Cannot use annotation-based null analysis
Product: [Eclipse Project] JDT Reporter: Jan Hoppe <jan.hoppe>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: aclement, jarthana, stephan.herrmann
Version: 4.2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Compiler-Errors/Warning
none
Preferences Compiler none

Description Jan Hoppe CLA 2015-06-15 07:19:53 EDT
What steps will reproduce the problem?
1. Enable annotaion-based null analysis for project
2. Disable annotaion-based null analysis for workspace
3. Compiling fails


-- Error Details --
Date: Mon Jun 15 13:12:25 CEST 2015
Message: Errors running builder 'Java Builder' on project 'UserInterface_Job'.
Severity: Error
Product: Eclipse 4.4.2.20150219-0708 (org.eclipse.epp.package.java.product)
Plugin: org.eclipse.jdt.core
Session Data:
eclipse.buildId=4.4.2.M20150204-1700
java.version=1.8.0
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE

Exception Stack Trace:
java.lang.IllegalStateException
	at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.clone(UnresolvedReferenceBinding.java:43)
	at org.eclipse.jdt.internal.compiler.lookup.AnnotatableTypeSystem.getAnnotatedType(AnnotatableTypeSystem.java:339)
	at org.eclipse.jdt.internal.compiler.lookup.AnnotatableTypeSystem.getAnnotatedType(AnnotatableTypeSystem.java:268)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createAnnotatedType(LookupEnvironment.java:998)
	at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.combineTypeAnnotations(TypeVariableBinding.java:907)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.substitute(ParameterizedTypeBinding.java:1202)
	at org.eclipse.jdt.internal.compiler.lookup.Scope$Substitutor.substitute(Scope.java:490)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.substitute(Scope.java:435)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.<init>(ParameterizedMethodBinding.java:123)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.createParameterizedMethod(ParameterizedTypeBinding.java:369)
	at org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding.createParameterizedMethod(RawTypeBinding.java:101)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.methods(ParameterizedTypeBinding.java:958)
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.unResolvedMethods(ReferenceBinding.java:1809)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.computeInheritedMethods(MethodVerifier.java:602)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.computeInheritedMethods(MethodVerifier.java:484)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.verify(MethodVerifier.java:969)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier15.verify(MethodVerifier15.java:1003)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.verify(MethodVerifier.java:979)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.verifyMethods(SourceTypeBinding.java:2538)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.verifyMethods(CompilationUnitScope.java:949)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:824)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
	at java.lang.Thread.run(Unknown Source)
Comment 1 Jan Hoppe CLA 2015-06-15 07:23:14 EDT
Created attachment 254421 [details]
Compiler-Errors/Warning
Comment 2 Jan Hoppe CLA 2015-06-15 07:23:54 EDT
Created attachment 254422 [details]
Preferences Compiler
Comment 3 Sasikanth Bharadwaj CLA 2015-06-15 08:23:06 EDT
Which version of eclipse are you seeing this on? The bug report says 3.1, the Error Details say 4.4.2.M20150204-1700 but as per bug445669 comment 22, this cannot happen anymore because "UnresolvedReferenceBinding.clone() does not throw ISE any more :)". Please check the jdt.core plug-in version as well
Comment 4 Jan Hoppe CLA 2015-06-16 02:42:08 EDT
I am working with Version: Luna Service Release 2 (4.4.2) - Build id: 20150219-0600

Sorry for the wrong specified Version, I expected creating a bug from eclipse itself will do it right!

Eclipse Java Development Tools	3.10.1.v20150204-1700
Comment 5 Jan Hoppe CLA 2015-06-16 05:28:08 EDT
After uninstalling the "JDT Core patch for Groovy-Eclipse plugin" (Version 2.9.1.xx-201411061336-e42-RELEASE) everything works fine!
Please move Issue to SpringSource Groovy team!
Comment 6 Jay Arthanareeswaran CLA 2015-06-16 23:38:36 EDT
(In reply to Jan Hoppe from comment #5)
> After uninstalling the "JDT Core patch for Groovy-Eclipse plugin" (Version
> 2.9.1.xx-201411061336-e42-RELEASE) everything works fine!
> Please move Issue to SpringSource Groovy team!

I don't see that in the product list. Is it even part of eclipse?
Comment 7 Stephan Herrmann CLA 2015-06-26 19:13:43 EDT
(In reply to Jay Arthanareeswaran from comment #6)
> (In reply to Jan Hoppe from comment #5)
> > After uninstalling the "JDT Core patch for Groovy-Eclipse plugin" (Version
> > 2.9.1.xx-201411061336-e42-RELEASE) everything works fine!
> > Please move Issue to SpringSource Groovy team!
> 
> I don't see that in the product list. Is it even part of eclipse?

It's not at Eclipse.org, copying Andy FYI.
Comment 8 Andrew Clement CLA 2015-06-26 20:46:28 EDT
This should be raised as a github issue on https://github.com/groovy/groovy-eclipse

However, there are no further planned updates to Groovy-Eclipse.

The most recent build snapshots of groovy-eclipse were made on the Eclipse Mars 4.5 JDT level - that may address this if you upgrade to Eclipse 4.5 and install that groovy-eclipse, but I can't guarantee it.  If seems if you want reliable null analysis on 4.4 then your only option, I'm afraid, is it to uninstall groovy-eclipse and run with an unpatched JDT.
Comment 9 Jan Hoppe CLA 2015-06-29 00:44:18 EDT
Created an issue entry for groovy-eclipse (https://github.com/groovy/groovy-eclipse/issues/125)
Thank you for your good work!