Delombok option doesn't generate code for @Nonnull check. #950

Closed
Scythson opened this Issue Oct 21, 2015 · 3 comments

Projects

None yet

2 participants

@Scythson

So, what I'm trying to do, is to generate null check code with delombok feature, but it doesn't work:

c:\lib>java -jar lombok.jar delombok -p LombokTest.java

package com.some.test;

import lombok.*;

import java.io.Serializable;

public class LombokTest implements Serializable {

        public String text;

        public LombokTest( @NonNull Object text) {
                this.text = text.toString();
        }

        public int setText( @ NonNull String anotherText) {
                this.text = anotherText;
                return anotherText.length();
        }
}

c:\lib>java -jar lombok.jar -version
v1.16.6 "Candid Duck"

c:\lib>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

@rspilker
Collaborator

I can reproduce the problem. Luckily, the compiler does generate the null-check.

@rspilker
Collaborator

Hmm, delombok doesn't work at all. It no longer detects changes to the AST and therefore just copies the input.

@rspilker rspilker added a commit that closed this issue Oct 26, 2015
@rspilker rspilker [fixes #950] A source file with just parameter @NonNull would not tri…
…gger delombok due to lack of ast.setChanged flagging
3041420
@rspilker rspilker closed this in 3041420 Oct 26, 2015
@Scythson

Thank you! Looking forward to see it in the build.

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