简体   繁体   中英

Lombok delombok option doesn't generate code for @Nonnull check

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)

Any ideas?

It was a bug, I reported this one, and it was kindly fixed: https://github.com/rzwitserloot/lombok/issues/950 There is no workaround for this one. You can only wait for a new lombok build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM