FULL PRODUCT VERSION :
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux hendy.dev 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
Linux Mint 17 64-bit KDE
A DESCRIPTION OF THE PROBLEM :
When compiling code with invalid syntax for multiple annotations of @JsonSubTypes.Type (see sample code) generates the internal compiler error: java.lang.NullPointerException at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2707).
Fixing the syntax of the code makes the compile successful. However, this syntax error case should be handled by the compiler by displaying appropriate error message.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create code with invalid multiple annotations syntax as described.
2. Compile
3. internal java compiler error
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Appropriate error message, e.g. "Cannot parse: Invalid multiple annotations syntax"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Information:Using javac 1.8.0_20 to compile java sources
Information:java: An exception has occurred in the compiler (1.8.0_20). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
Information:java: java.lang.NullPointerException
Information:java: at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2707)
Information:java: at com.sun.tools.javac.tree.JCTree$JCAnnotation.accept(JCTree.java:2317)
Information:java: at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
Information:java: at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
Information:java: at com.sun.tools.javac.tree.TreeScanner.visitAnnotation(TreeScanner.java:320)
Information:java: at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2708)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotationTree(Check.java:2713)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotation(Check.java:2780)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotations(Check.java:2767)
Information:java: at com.sun.tools.javac.comp.MemberEnter$6.run(MemberEnter.java:901)
Information:java: at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:155)
Information:java: at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
Information:java: at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
Information:java: at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
Information:java: at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
Information:java: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
Information:java: at com.sun.tools.javac.main.Main.compile(Main.java:523)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:165)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:380)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:298)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:204)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:176)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1140)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:826)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:894)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:789)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:612)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:191)
Information:java: at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:131)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:229)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
Information:java: at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:158)
Information:java: at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
Information:java: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Information:java: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Information:java: at java.lang.Thread.run(Thread.java:745)
Information:java: Errors occurred while compiling module 'id.co.bippo.common'
Information:28/11/14 5:50 - Compilation completed with 1 error and 0 warnings in 3 sec
Error:java: Compilation failed: internal java compiler error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package id.co.bippo.common.rs.commerceplug;
import com.fasterxml.jackson.annotation.*;
import de.escalon.hypermedia.hydra.mapping.Expose;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.ResourceSupport;
import javax.annotation.Nullable;
import javax.measure.DecimalMeasure;
import javax.measure.quantity.Quantity;
import javax.measure.unit.Unit;
import java.math.BigDecimal;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property="@type", defaultImpl=StructuredValue.class)
@JsonSubTypes(@JsonSubTypes.Type(name="StructuredValue", value=StructuredValue.class),
@JsonSubTypes.Type(name="QuantitativeValue", value=QuantitativeValue.class))
@JsonPropertyOrder({"@id", "id", "name", "description", "image", "url",
"additionalType", "alternateName", "potentialAction", "sameAs"})
@JsonIgnoreProperties("links")
public class StructuredValue<V, Q extends Quantity> extends ResourceSupport {
---------- END SOURCE ----------
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux hendy.dev 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
Linux Mint 17 64-bit KDE
A DESCRIPTION OF THE PROBLEM :
When compiling code with invalid syntax for multiple annotations of @JsonSubTypes.Type (see sample code) generates the internal compiler error: java.lang.NullPointerException at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2707).
Fixing the syntax of the code makes the compile successful. However, this syntax error case should be handled by the compiler by displaying appropriate error message.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create code with invalid multiple annotations syntax as described.
2. Compile
3. internal java compiler error
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Appropriate error message, e.g. "Cannot parse: Invalid multiple annotations syntax"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Information:Using javac 1.8.0_20 to compile java sources
Information:java: An exception has occurred in the compiler (1.8.0_20). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
Information:java: java.lang.NullPointerException
Information:java: at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2707)
Information:java: at com.sun.tools.javac.tree.JCTree$JCAnnotation.accept(JCTree.java:2317)
Information:java: at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
Information:java: at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
Information:java: at com.sun.tools.javac.tree.TreeScanner.visitAnnotation(TreeScanner.java:320)
Information:java: at com.sun.tools.javac.comp.Check$1AnnotationValidator.visitAnnotation(Check.java:2708)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotationTree(Check.java:2713)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotation(Check.java:2780)
Information:java: at com.sun.tools.javac.comp.Check.validateAnnotations(Check.java:2767)
Information:java: at com.sun.tools.javac.comp.MemberEnter$6.run(MemberEnter.java:901)
Information:java: at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:155)
Information:java: at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
Information:java: at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
Information:java: at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
Information:java: at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
Information:java: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
Information:java: at com.sun.tools.javac.main.Main.compile(Main.java:523)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:165)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:380)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:298)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:204)
Information:java: at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:176)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1140)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:826)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:894)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:789)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:612)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)
Information:java: at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:191)
Information:java: at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:131)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:229)
Information:java: at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
Information:java: at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:158)
Information:java: at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
Information:java: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Information:java: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Information:java: at java.lang.Thread.run(Thread.java:745)
Information:java: Errors occurred while compiling module 'id.co.bippo.common'
Information:28/11/14 5:50 - Compilation completed with 1 error and 0 warnings in 3 sec
Error:java: Compilation failed: internal java compiler error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package id.co.bippo.common.rs.commerceplug;
import com.fasterxml.jackson.annotation.*;
import de.escalon.hypermedia.hydra.mapping.Expose;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.ResourceSupport;
import javax.annotation.Nullable;
import javax.measure.DecimalMeasure;
import javax.measure.quantity.Quantity;
import javax.measure.unit.Unit;
import java.math.BigDecimal;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property="@type", defaultImpl=StructuredValue.class)
@JsonSubTypes(@JsonSubTypes.Type(name="StructuredValue", value=StructuredValue.class),
@JsonSubTypes.Type(name="QuantitativeValue", value=QuantitativeValue.class))
@JsonPropertyOrder({"@id", "id", "name", "description", "image", "url",
"additionalType", "alternateName", "potentialAction", "sameAs"})
@JsonIgnoreProperties("links")
public class StructuredValue<V, Q extends Quantity> extends ResourceSupport {
---------- END SOURCE ----------
- duplicates
-
JDK-8029161 javac crashing when processing broken annotations
-
- Closed
-