Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Scythson opened this issue Oct 21, 2015 · 6 comments
Closed

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

Scythson opened this issue Oct 21, 2015 · 6 comments

Comments

@Scythson
Copy link

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
Copy link
Collaborator

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

@rspilker
Copy link
Collaborator

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

@Scythson
Copy link
Author

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

@kloklo90
Copy link

kloklo90 commented May 2, 2017

I have switched to delombok 1.16.16.0 and lombok 1.16.16 the combination does not get rid of the issue with lombok nonnull. Did anyone else fix the issue with lombok.nonnull

@soach
Copy link

soach commented Feb 18, 2021

i meet the same problem : java 8, delombok: v1.18.18 "Envious Ferret"
delombok can generate the check code but can not remove nonNull annotations.
is there anything wrong when i use delombok?
java -jar ./lombok.jar delombok -f generateDelombokComment:skip -f javaLangAsFQN:skip -f suppressWarnings:skip $srcPath -d $targetPath

@NicklasWallgren
Copy link

This issue is still present in 1.18.20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants