FULL PRODUCT VERSION :
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
windows xp
A DESCRIPTION OF THE PROBLEM :
If you try to compile the test case i have included, the compiler will fail to compile the source file with the following stack trace:
An exception has occurred in the compiler (1.6.0_10). 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.
java.lang.NullPointerException
at com.sun.tools.javac.comp.Flow.visitApply(Flow.java:1117)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1210)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanCond(Flow.java:534)
at com.sun.tools.javac.comp.Flow.visitIf(Flow.java:1068)
at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1050)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:492)
at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:747)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.visitForLoop(Flow.java:831)
at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:818)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:492)
at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:747)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:693)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:641)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:575)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:1256)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1090)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1064)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce try to compile the source file.
Note: The simplest way to maybe reproduce this problem is to create a maven project and try to mvn package. The following dependency is needed:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.0.3</version>
<scope>compile</scope>
</dependency>
I would provide a maven sample project but i dont see a way to upload a zip file.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The expected result should be that the compiler compiles the source file.
ACTUAL -
The compiler fails to compile the source file.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
An exception has occurred in the compiler (1.6.0_10). 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.
java.lang.NullPointerException
at com.sun.tools.javac.comp.Flow.visitApply(Flow.java:1117)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1210)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanCond(Flow.java:534)
at com.sun.tools.javac.comp.Flow.visitIf(Flow.java:1068)
at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1050)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:492)
at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:747)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.visitForLoop(Flow.java:831)
at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:818)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.scanStats(Flow.java:492)
at com.sun.tools.javac.comp.Flow.visitBlock(Flow.java:747)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.scanStat(Flow.java:484)
at com.sun.tools.javac.comp.Flow.visitMethodDef(Flow.java:693)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.visitClassDef(Flow.java:641)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:575)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:1256)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1090)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1064)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import com.google.gwt.core.client.JsArray;
public class Example<T> {
JsArray<? extends T> array;
public boolean contains(final Object o) {
final T t = (T) o;
for (int i = 0; i < array.length(); i++) {
if (t.equals(array.get(i))) { return true; }
}
return false;
}
}
Note: This will not run unless the JsArray dependendcy is resolved. I would provide a maven sample project but i dont see a way to upload a zip file.
---------- END SOURCE ----------