test/tools/javac/processing/6430209/T6430209.java is supposed to verify a fix for 6430209 but the test is weak (just check for 2 diagnostics and no output to the log) but the completion error still occurs and is probably being written direct to stderr, so not being detected by the test.
------------------------------------------
$ lt.jtreg -J-Xmx512m -ea:com.sun.tools.javac... -esa -jdk:/w/jjg/work/tl/build/linux-amd64/j2sdk-image/ -va test/tools/javac/processing/6430209/
Directory "build/jtreg/report" not found: creating
Directory "build/jtreg/work" not found: creating
Directory "build/jtreg/work/scratch" not found: creating
--------------------------------------------------
TEST: tools/javac/processing/6430209/T6430209.java
JDK under test: (/w/jjg/work/tl/build/linux-amd64/j2sdk-image)
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-jjg_2010_07_26_13_35-b00)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b03, mixed mode)
ACTION: build -- Passed. Build successful
REASON: User specified action: run build b6341534
TIME: 1.01 seconds
messages:
command: build b6341534
reason: User specified action: run build b6341534
elapsed time (seconds): 1.01
ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME: 0.967 seconds
messages:
command: compile /w/jjg/work/anno-complerr/7/langtools/test/tools/javac/processing/6430209/b6341534.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.967
ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME: 0.168 seconds
messages:
command: build T6430209
reason: Named class compiled on demand
elapsed time (seconds): 0.168
ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME: 0.167 seconds
messages:
command: compile /w/jjg/work/anno-complerr/7/langtools/test/tools/javac/processing/6430209/T6430209.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.167
ACTION: main -- Passed. Execution successful
REASON: User specified action: run main T6430209
TIME: 0.183 seconds
messages:
command: main T6430209
reason: User specified action: run main T6430209
elapsed time (seconds): 0.183
STDOUT:
Round1: test0
Round1: dir1.test1
STDERR:
./dir1/test0.java:1: duplicate class: test0
public class test0 { }
^
error: cannot access dir1.test0
bad source file: ./dir1/test0.java
file does not contain class dir1.test0
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
Consult the following stack trace for details.
com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad source file: ./dir1/test0.java
file does not contain class dir1.test0
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
at com.sun.tools.javac.main.JavaCompiler.complete(JavaCompiler.java:753)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2326)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2234)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:423)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:817)
at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:759)
at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:583)
at b6341534.process(b6341534.java:53)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:775)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:704)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$700(JavacProcessingEnvironment.java:88)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:925)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1059)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1061)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:796)
at com.sun.tools.javac.main.Main.compile(Main.java:409)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:139)
at T6430209.main(T6430209.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:613)
at com.sun.javatest.regtest.MainAction$SameVMThread.run(MainAction.java:575)
at java.lang.Thread.run(Thread.java:717)
2 diagnostics; 0 characters
JavaTest Message: Test complete.
TEST RESULT: Passed. Execution successful
--------------------------------------------------
Test results: passed: 1
------------------------------------------
$ lt.jtreg -J-Xmx512m -ea:com.sun.tools.javac... -esa -jdk:/w/jjg/work/tl/build/linux-amd64/j2sdk-image/ -va test/tools/javac/processing/6430209/
Directory "build/jtreg/report" not found: creating
Directory "build/jtreg/work" not found: creating
Directory "build/jtreg/work/scratch" not found: creating
--------------------------------------------------
TEST: tools/javac/processing/6430209/T6430209.java
JDK under test: (/w/jjg/work/tl/build/linux-amd64/j2sdk-image)
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-jjg_2010_07_26_13_35-b00)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b03, mixed mode)
ACTION: build -- Passed. Build successful
REASON: User specified action: run build b6341534
TIME: 1.01 seconds
messages:
command: build b6341534
reason: User specified action: run build b6341534
elapsed time (seconds): 1.01
ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME: 0.967 seconds
messages:
command: compile /w/jjg/work/anno-complerr/7/langtools/test/tools/javac/processing/6430209/b6341534.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.967
ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME: 0.168 seconds
messages:
command: build T6430209
reason: Named class compiled on demand
elapsed time (seconds): 0.168
ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME: 0.167 seconds
messages:
command: compile /w/jjg/work/anno-complerr/7/langtools/test/tools/javac/processing/6430209/T6430209.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.167
ACTION: main -- Passed. Execution successful
REASON: User specified action: run main T6430209
TIME: 0.183 seconds
messages:
command: main T6430209
reason: User specified action: run main T6430209
elapsed time (seconds): 0.183
STDOUT:
Round1: test0
Round1: dir1.test1
STDERR:
./dir1/test0.java:1: duplicate class: test0
public class test0 { }
^
error: cannot access dir1.test0
bad source file: ./dir1/test0.java
file does not contain class dir1.test0
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
Consult the following stack trace for details.
com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad source file: ./dir1/test0.java
file does not contain class dir1.test0
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
at com.sun.tools.javac.main.JavaCompiler.complete(JavaCompiler.java:753)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2326)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2234)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:423)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:817)
at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:759)
at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:583)
at b6341534.process(b6341534.java:53)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:775)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:704)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$700(JavacProcessingEnvironment.java:88)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:925)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1059)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1061)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:796)
at com.sun.tools.javac.main.Main.compile(Main.java:409)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:139)
at T6430209.main(T6430209.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:613)
at com.sun.javatest.regtest.MainAction$SameVMThread.run(MainAction.java:575)
at java.lang.Thread.run(Thread.java:717)
2 diagnostics; 0 characters
JavaTest Message: Test complete.
TEST RESULT: Passed. Execution successful
--------------------------------------------------
Test results: passed: 1
- relates to
-
JDK-6400041 javax.lang.model.element.TypeElement.getKind() throws CompletionFailure
- Closed
-
JDK-6430209 spurious compiler error elicited by packageElement.getEnclosedElements()
- Closed