Skip to content

Commit

Permalink
Extra test with Lombok-like annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-tylenda-sonarsource committed Feb 18, 2025
1 parent 45ac62f commit 0310e5a
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,24 @@ public static checks.MySingleton getInstance() {
}
}

static class CustomLombokLikeAnnotation {
// Custom Lombok-like annotation.
@interface NoArgsConstructor {
AccessLevel access() default AccessLevel.PUBLIC;
}

// This one is tricky - the annotation is not the real one, so it is noncompliant.
@NoArgsConstructor(access = AccessLevel.PRIVATE)
class CustomClass1 { // Noncompliant
public static void foo() {
}
}

@NoArgsConstructor(access = AccessLevel.PUBLIC)
class CustomClass2 { // Noncompliant
public static void foo() {
}
}
}

}

0 comments on commit 0310e5a

Please sign in to comment.