Community
Participate
Working Groups
jdk-9-ea+123 Getting the following warnings in Error Log view: The Java indexing could not index C:/Eclipse/JREs/jdk-9-ea+123_windows-x64_bin/jdk9/jdk-9/jrt-fs.jar|java.base|java/lang/SecurityManager.class. This .class file doesn't follow the class file format specification. Please report this issue against the .class file vendor The Java indexing could not index C:/Eclipse/JREs/jdk-9-ea+123_windows-x64_bin/jdk9/jdk-9/jrt-fs.jar|java.desktop|javax/swing/JApplet.class. This .class file doesn't follow the class file format specification. Please report this issue against the .class file vendor Also, the following code gives error ("SecurityManager cannot be resolved to a type") in a Java 9 project: import java.lang.SecurityManager; public class C { SecurityManager s; }
I see the exception, let me take a look.
Here's the exception that seems to halt the indexer and compiler: java.lang.IllegalStateException at org.eclipse.jdt.internal.compiler.classfmt.AnnotationInfo.scanElementValue(AnnotationInfo.java:375) at org.eclipse.jdt.internal.compiler.classfmt.AnnotationInfo.scanAnnotation(AnnotationInfo.java:334) at org.eclipse.jdt.internal.compiler.classfmt.AnnotationInfo.<init>(AnnotationInfo.java:51) at org.eclipse.jdt.internal.compiler.classfmt.MethodInfo.decodeAnnotations(MethodInfo.java:140) at org.eclipse.jdt.internal.compiler.classfmt.MethodInfo.decodeMethodAnnotations(MethodInfo.java:148) at org.eclipse.jdt.internal.compiler.classfmt.MethodInfo.createMethod(MethodInfo.java:67) at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:319) at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:168) at org.eclipse.jdt.internal.compiler.util.JrtFileSystem.getClassfile(JRTUtil.java:235) at org.eclipse.jdt.internal.compiler.util.JrtFileSystem.getClassfile(JRTUtil.java:272) at org.eclipse.jdt.internal.compiler.util.JRTUtil.getClassfile(JRTUtil.java:154) at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.readFromJrt(ClassFileReader.java:140) at org.eclipse.jdt.internal.core.builder.ClasspathJrt.findClass(ClasspathJrt.java:192) at org.eclipse.jdt.internal.core.builder.NameEnvironment.findClass(NameEnvironment.java:324)
And the affected part is the following annotation on the checkMemberAccess() method: @Deprecated(since="1.8", forRemoval=true) My guess at this point is the newly added attributes in @Deprecated in Java 9 are not accounted for.
Fix released via: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA9&id=ce8c193d2aef1a09a49f2f42720cb83268a87baf The fix is in AnnotationInfo#scanAnnotation() to not return immediately but only after iterating through the annotation values. One might want to make use of the new attributes added to the annotation (namely since() and forRemoval()) to add more details to the error reporting. But that can be taken up later as an enhancement.
*** Bug 497597 has been marked as a duplicate of this bug. ***
*** Bug 520168 has been marked as a duplicate of this bug. ***
For the records: (In reply to Jay Arthanareeswaran from comment #4) > [...] One might want to make > use of the new attributes added to the annotation (namely since() and > forRemoval()) to add more details to the error reporting. But that can be > taken up later as an enhancement. this was done via bug 517326