Bug 151635

Summary: Spurious error badge on com.sun.tools.javac.code.Source
Product: java Reporter: Jesse Glick <jglick>
Component: SourceAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3    
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard: autoproject
Issue Type: DEFECT Exception Report:
Bug Depends on:    
Bug Blocks: 121950    

Description Jesse Glick 2008-10-28 18:31:23 UTC
Running NB on JDK 6, if you open jdk7/langtools from OpenJDK as an autoproject, and after setting up various required
Ant properties such as boot.java.home in ~/.openjdk/build.properties you run make/build.xml#build, src/share/classes/ is
correctly detected as a source root. It is marked with a single error: Source.java gets an error badge (in Projects and
editor tab) though it also has a green box when you open it. Switching focus does not fix the problem. Touching the file
(e.g. SPACE, DELETE, C-S) does remove the badge, at least until you do a clean build.

My log file notes

WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Incorrect error badges detected,
file=/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/code/Source.java.
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute
root=/space/src/jdk7/langtools/src/share/classes, files in
error=[file:/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/code/Source.java].
SEVERE [org.netbeans.modules.java.source.usages.RepositoryUpdater]: Coupling error: class file
jar:file:/space/jdk1.6.0_10/jre/lib/rt.jar!/javax/lang/model/SourceVersion.class, source file
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/SourceVersion.java
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Incorrect error badges detected,
file=/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/code/Source.java.
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute
root=/space/src/jdk7/langtools/src/share/classes, files in
error=[file:/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/code/Source.java].
SEVERE [org.netbeans.modules.java.source.usages.RepositoryUpdater]: Coupling error: class file
jar:file:/space/jdk1.6.0_10/jre/lib/rt.jar!/javax/lang/model/SourceVersion.class, source file
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/SourceVersion.java

Perhaps the reason this one file is problematic is that JDK1_7 is present in Source.java but not in rt.jar? Or
SourceVersion.RELEASE_7?
Comment 1 Rastislav Komara 2009-02-03 10:52:05 UTC
Overtake.
Comment 2 Jan Lahoda 2009-04-15 18:09:56 UTC
Possibly fixed by fix for issue #161599.
Comment 3 Dusan Balek 2009-08-11 10:05:48 UTC
The issue cannot be reproduced using the latest dev build. After running make/build.xml#build, src/share/classes/ is
correctly detected as a source root, however, only the packages that comply with the include/exclude rules defined in
the 'build-classes-apt' target are visible and scanned (so com.sun.tools.javac.code.Source is not scanned anymore). This
behavior follows the autoproject definition stored in autoprojects.properties:

/home/balek/wrk/openjdk/langtools/src/share/classes\#binary=/home/balek/wrk/openjdk/langtools/build/classes
/home/balek/wrk/openjdk/langtools/src/share/classes\#classpath=
/home/balek/wrk/openjdk/langtools/src/share/classes\#excludes=**/package-info.java
/home/balek/wrk/openjdk/langtools/src/share/classes\#includes=com/sun/mirror/,com/sun/tools/apt/
/home/balek/wrk/openjdk/langtools/src/share/classes\#source=\
    /home/balek/wrk/openjdk/langtools/build/bootstrap/gensrc:\
    /home/balek/wrk/openjdk/langtools/src/share/classes:\
    /home/balek/wrk/openjdk/langtools/build/gensrc
Comment 4 Jesse Glick 2009-08-11 18:42:11 UTC
I will fix the autoproject issue by making it union includes (and intersect excludes) when there is >1 <javac> on a
given source root.
Comment 5 Jesse Glick 2009-08-11 18:44:53 UTC
...and now (in a dev build) Source.java is not marked with an error badge. So perhaps something was fixed.
Comment 6 Jesse Glick 2009-08-11 18:58:16 UTC
I take that back. It is marked with an error badge after restarting the IDE. So are some other classes such as
PrintingProcessor. This is using 090811 (86b36ce6f070).
Comment 7 Jesse Glick 2009-08-11 19:07:14 UTC
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Incorrect error badges detected,
file=/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java.
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute
root=/space/src/jdk7/langtools/src/share/classes, files in
error=[file:/space/src/jdk7/langtools/src/share/classes/javax/tools/ForwardingJavaFileObject.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java,
file:/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/code/Source.java,
file:/space/src/jdk7/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java].

and the bad error badges remain.
Comment 8 Dusan Balek 2009-08-12 16:39:09 UTC
The problem is that class files contained in the platform's rt.jar are 'newer' than corresponding OpenJDK sources.

Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/2a6e4ec07692

changeset 0084dac11bc9 in main/nb-javac
details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=0084dac11bc9
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo