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

[BUG] neither lombok.onX.flagUsage nor lombok.experimental.flagUsage works with onX #2848

Closed
mr-july opened this issue May 20, 2021 · 0 comments · Fixed by #3637
Closed

[BUG] neither lombok.onX.flagUsage nor lombok.experimental.flagUsage works with onX #2848

mr-july opened this issue May 20, 2021 · 0 comments · Fixed by #3637
Assignees

Comments

@mr-july
Copy link

mr-july commented May 20, 2021

Describe the bug
Neither lombok.onX.flagUsage = ERROR nor lombok.experimental.flagUsage = ERROR works with onConstructor, onMethod and onParam.

To Reproduce
Create simple gradle project.

// build.gradle
plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    compileOnly 'org.projectlombok:lombok:1.18.20'
    annotationProcessor 'org.projectlombok:lombok:1.18.20'

    implementation group: 'javax.inject', name: 'javax.inject', version: '1'
    implementation group: 'javax.persistence', name: 'javax.persistence-api', version: '2.2'
    implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
}
# lombok.config
lombok.onX.flagUsage = ERROR
lombok.experimental.flagUsage = ERROR
// OnXExample.java
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import javax.inject.Inject;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.validation.constraints.Max;

@AllArgsConstructor(onConstructor=@__(@Inject))
public class OnXExample {
  @Getter(onMethod_={@Id, @Column(name="unique-id")}) //JDK8
  @Setter(onParam_=@Max(10000)) //JDK8
  private long unid;
}

Then execute

./gradlew jar

The compilation is successful. :-(

Expected behavior
Compilation error must occur, because the onConstructor, onMethod and onParam annotations must produce an error according to lombok.onX.flagUsage and lombok.experimental.flagUsage parameters in lombok configuration.

Version info:

  • Lombok 1.18.20
  • Platforms: javac 15.0.2, javac 11.0.11, javac 1.8.0_281

Additional context
Arch Linux x86_64

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

Successfully merging a pull request may close this issue.

2 participants