lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

NullPointerException when @NonNull is used in abstract method #559

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use @NonNull in abstract method:

import lombok.NonNull;

public abstract class Example {
    public abstract void get(@NonNull String a);
}

2. Compile using javac

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

java.lang.NullPointerException
        at lombok.javac.handlers.NonNullHandler.handle(NonNullHandler.java:91)
        at lombok.javac.HandlerLibrary$AnnotationHandlerContainer.handle(HandlerLibrary.java:105)
        at lombok.javac.HandlerLibrary.handleAnnotation(HandlerLibrary.java:243)
        at lombok.javac.JavacTransformer$AnnotationVisitor.visitAnnotationOnMethodArgument(JavacTransformer.java:101)
        at lombok.javac.JavacNode.traverse(JavacNode.java:115)
        at lombok.javac.JavacAST.traverseChildren(JavacAST.java:116)
        at lombok.javac.JavacNode.traverse(JavacNode.java:88)
        at lombok.javac.JavacAST.traverseChildren(JavacAST.java:116)
        at lombok.javac.JavacNode.traverse(JavacNode.java:77)
        at lombok.javac.JavacAST.traverseChildren(JavacAST.java:116)
        at lombok.javac.JavacNode.traverse(JavacNode.java:67)
        at lombok.javac.JavacAST.traverseChildren(JavacAST.java:116)
        at lombok.javac.JavacNode.traverse(JavacNode.java:62)
        at lombok.javac.JavacAST.traverse(JavacAST.java:112)
        at lombok.javac.JavacTransformer.transform(JavacTransformer.java:70)
        at lombok.javac.apt.Processor.process(Processor.java:252)
        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:793)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
        at com.sun.tools.javac.main.Main.compile(Main.java:439)
        at com.sun.tools.javac.main.Main.compile(Main.java:353)
        at com.sun.tools.javac.main.Main.compile(Main.java:342)
        at com.sun.tools.javac.main.Main.compile(Main.java:333)
        at com.sun.tools.javac.Main.compile(Main.java:76)
        at com.sun.tools.javac.Main.main(Main.java:61)
error: Lombok annotation handler class lombok.javac.handlers.NonNullHandler 
failed on Example.java: java.lang.NullPointerException
1 error

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

Lombok version 0.12.0 and javac version 1.7.0_25.

Please provide any additional information below.

Lombok version 0.11.8 works OK.

Original issue reported on code.google.com by panur.1...@gmail.com on 15 Aug 2013 at 8:09

GoogleCodeExporter commented 9 years ago
Confirmed; fixed in revision 72b55dccb1

Please wait for a new release :)

Original comment by askon...@gmail.com on 20 Sep 2013 at 3:19

GoogleCodeExporter commented 9 years ago
Is this fixed? If there's no response soon it will be closed.

Original comment by r.spilker on 23 Jan 2014 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by r.spilker on 28 Feb 2014 at 1:00