lombok1.14.4 and javac 1.8.0_20 causes java.lang.NoSuchMethodError: com.sun.tools.javac.code.Types.upperBound #766

Closed
lombokissues opened this Issue Jul 14, 2015 · 5 comments

Projects

None yet

2 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 731)

@lombokissues
Collaborator

👤 buzz.taiki   🕗 Aug 21, 2014 at 17:07 UTC

What steps will reproduce the problem?

  1. compile following code with javac 1.8.0_20

import lombok.val;
import java.util.HashMap;

public class ValWithTypeParam {
void useval() {
HashMap<String, String> m = new HashMap<>();
for (val e : m.entrySet()) {
System.out.println(e.getKey());
}
}
}

  1. javac causes lombok1.14.4 and javac 1.8.0_20 causes java.lang.NoSuchMethodError: com.sun.tools.javac.code.Types.upperBound

What is the expected output? What do you see instead?

javac and lombok should compile this code.

What version of the product are you using? On what operating system?

  • lombok1.14.4
  • oracle javac 1.8.0_20

Please provide any additional information below.

javac 1.8.0_11 can compile this code.

stack trace with javac 1.8.0_20 is following:

java.lang.NoSuchMethodError: com.sun.tools.javac.code.Types.upperBound(Lcom/sun/tools/javac/code/Type;)Lcom/sun/tools/javac/code/Type;
at lombok.javac.JavacResolution.ifTypeIsIterableToComponent(JavacResolution.java:196)
at lombok.javac.handlers.HandleVal.visitLocal(HandleVal.java:120)
at lombok.javac.JavacNode.traverse(JavacNode.java:100)
at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
at lombok.javac.JavacNode.traverse(JavacNode.java:106)
at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
at lombok.javac.JavacNode.traverse(JavacNode.java:85)
at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
at lombok.javac.JavacNode.traverse(JavacNode.java:75)
at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
at lombok.javac.JavacNode.traverse(JavacNode.java:70)
at lombok.javac.JavacAST.traverse(JavacAST.java:109)
at lombok.javac.HandlerLibrary.callASTVisitors(HandlerLibrary.java:259)
at lombok.javac.JavacTransformer.transform(JavacTransformer.java:71)
at lombok.javac.apt.Processor.process(Processor.java:250)
at lombok.core.AnnotationProcessor$JavacDescriptor.process(AnnotationProcessor.java:117)
at lombok.core.AnnotationProcessor.process(AnnotationProcessor.java:167)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
error: Lombok visitor handler class lombok.javac.handlers.HandleVal failed: java.lang.NoSuchMethodError: com.sun.tools.javac.code.Types.upperBound(Lcom/sun/tools/javac/code/Type;)Lcom/sun/tools/javac/code/Type;

@lombokissues
Collaborator

👤 buzz.taiki   🕗 Aug 21, 2014 at 17:26 UTC

probably, this error is caused by jdk's http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/rev/0e026d3f2786 change.

@lombokissues
Collaborator

👤 r.spilker   🕗 Aug 21, 2014 at 20:25 UTC

Thanks for spotting the changeset, buzz.taiki :)

This edge release fixes the problem:

https://projectlombok.org/download-edge.html

will be in the next release.

@lombokissues
Collaborator

👤 buzz.taiki   🕗 Aug 22, 2014 at 02:13 UTC

Thanks!

I've succeed to compile ValWithTypeParam and our product code by javac 1.8.0_20 and lombok-edge.

@lombokissues
Collaborator

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment