Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 404722 - ecj -properties file does not see nullity annotation properties
Summary: ecj -properties file does not see nullity annotation properties
Status: VERIFIED DUPLICATE of bug 375366
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-02 08:55 EDT by Frits Jalvingh CLA
Modified: 2013-04-29 13:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frits Jalvingh CLA 2013-04-02 08:55:05 EDT
I am using ecj (tried both 4.2.1 and 4.2.2) to compile an Eclipse project. To get the same errors and warnings as configured in the Eclipse workspace I pass the org.eclipse.jdt.core.prefs file to the batch compiler using the -properties parameter.

The properties file contains, amongst others:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled

org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning

Compiling however does not report any problem due to nullity checking with those annotations.

If I pass the required annotations on the command line, as:
-warn:nullAnnot(javax.annotation.Nullable|javax.annotation.Nonnull|NonnNullByDefault)

then nullity annotations are checked.
Comment 1 Stephan Herrmann CLA 2013-04-02 10:24:50 EDT
Should be fixed as of 4.3 M3.

Can you check with a milestone build like this one:
http://download.eclipse.org/eclipse/downloads/drops4/S-4.3M6-201303141330/#JDTCORE
?

*** This bug has been marked as a duplicate of bug 375366 ***
Comment 2 Frits Jalvingh CLA 2013-04-02 10:33:04 EDT
If I do, I get the for me totally incomprehensible:

1. ERROR in /home/jal/puzzler-bzr/master/vp/4.3/vp-domui-components/test/nl/itris/vp/pages/dms/MergeResultFragmentTest.java (at line 0)
	package nl.itris.vp.pages.dms;
	^
Internal compiler error: java.lang.SecurityException: class "org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:943)
----------
class "org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding"'s signer information does not match signer information of other classes in the same package
Comment 3 Stephan Herrmann CLA 2013-04-02 10:51:23 EDT
(In reply to comment #2)
> If I do, I get the for me totally incomprehensible:
> 
> 1. ERROR in
> /home/jal/puzzler-bzr/master/vp/4.3/vp-domui-components/test/nl/itris/vp/
> pages/dms/MergeResultFragmentTest.java (at line 0)
> 	package nl.itris.vp.pages.dms;
> 	^
> Internal compiler error: java.lang.SecurityException: class
> "org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding"'s
> signer information does not match signer information of other classes in the
> same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:943)
> ----------
> class
> "org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding"'s
> signer information does not match signer information of other classes in the
> same package

Wow :)

So you're invoking ecj from some application with a security manager?
When I call that jar from the command line it seems to work,
BUT, looking inside I see that most classes have been signed, 
but not AptSourceLocalVariableBinding!


I've filed bug 404729 to track this packaging problem.

It seems, M6 is the first milestone where ecj has this bogus shape,
do you want to give another chance to M5a?
Comment 4 Frits Jalvingh CLA 2013-04-02 11:02:08 EDT
Well, I just tested on the command line with a simple script; the command line to start ecj just starts like:

java -jar /home/jal/ecj.jar

followed by options and a huge amount of classpath. The only "special" thing is that a -bootclasspath is used to ensure that the proper JDK libraries are used. But that should not cause it to run inside a security manager....

Anyway, I tested with 4.3m5a and that does indeed report the nullity problems too, so the problem seems fixed there. Thanks ;-) I will add a workaround inside my tool to get the annotation settings from the .prefs file and pass them on the command line.
Comment 5 Stephan Herrmann CLA 2013-04-02 11:33:06 EDT
(In reply to comment #4)
> Anyway, I tested with 4.3m5a and that does indeed report the nullity
> problems too, so the problem seems fixed there. Thanks ;-)

Thanks for confirming!
Comment 6 Jay Arthanareeswaran CLA 2013-04-29 13:19:04 EDT
Verified by the bug reporter already.