Java: enable "don't consider class used when a member is implicitly used" by default and fix tests (IDEA-281800)

GitOrigin-RevId: e9d8112eb8fc4c03ff1abfb4f6883d05bed32c3e
This commit is contained in:
Bas Leijdekkers
2024-06-15 16:57:34 +02:00
committed by intellij-monorepo-bot
parent f1f7ec91fd
commit 5e74812655
6 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import lombok.Getter;
public class GetterLazyInvocationProduceNPE {
public class <warning descr="Class 'GetterLazyInvocationProduceNPE' is never used">GetterLazyInvocationProduceNPE</warning> {
private static class Bar {
public String sayHello() {
return "Bar{}";
@@ -17,7 +17,7 @@ public class GetterLazyInvocationProduceNPE {
private Bar <warning descr="Private field 'bar2' is never assigned">bar2</warning>;
private Car car;
public GetterLazyInvocationProduceNPE(Bar bar, Car car) {
public <warning descr="Constructor 'GetterLazyInvocationProduceNPE(GetterLazyInvocationProduceNPE.Bar, GetterLazyInvocationProduceNPE.Car)' is never used">GetterLazyInvocationProduceNPE</warning>(Bar bar, Car car) {
this.bar = bar;
this.car = car;
}

View File

@@ -1,10 +1,10 @@
import lombok.Getter;
public class GetterLazyVariableNotInitialized {
public class <warning descr="Class 'GetterLazyVariableNotInitialized' is never used">GetterLazyVariableNotInitialized</warning> {
private final String hoge;
public GetterLazyVariableNotInitialized(String hoge) {
public <warning descr="Constructor 'GetterLazyVariableNotInitialized(java.lang.String)' is never used">GetterLazyVariableNotInitialized</warning>(String hoge) {
this.hoge = hoge;
}

View File

@@ -20,7 +20,7 @@ public final class LombokBasics {
}
}
@AllArgsConstructor
class FinalCheck {
class <warning descr="Class 'FinalCheck' is never used">FinalCheck</warning> {
@Getter
private int a;
@Setter
@@ -28,7 +28,7 @@ class FinalCheck {
@Getter @Setter
private int c;
}
final class Foo {
final class <warning descr="Class 'Foo' is never used">Foo</warning> {
@Getter
String bar;
@@ -45,17 +45,17 @@ class <warning descr="Local class 'Inner' is never used">Inner</warning> {
}
}
}
class IntellijInspectionNPEDemo {
class <warning descr="Class 'IntellijInspectionNPEDemo' is never used">IntellijInspectionNPEDemo</warning> {
@Builder
public static class SomeDataClass {
public static class <warning descr="Class 'SomeDataClass' is never used">SomeDataClass</warning> {
public static class <warning descr="Class 'SomeDataClassBuilder' is never used">SomeDataClassBuilder</warning> {
private void <warning descr="Private method 'buildWithJSON()' is never used">buildWithJSON</warning>() {
this.jsonObject = "test";
}
}
public final String jsonObject;
public final String <warning descr="Public field 'jsonObject' is assigned but never accessed">jsonObject</warning>;
}
}

View File

@@ -8,7 +8,7 @@ import lombok.Setter;
//@AllArgsConstructor(onConstructor_ = @Deprecated)
@AllArgsConstructor(onConstructor = @__( @Deprecated))
@RequiredArgsConstructor(onConstructor_ = @Deprecated)
public class OnXExample {
public class <warning descr="Class 'OnXExample' is never used">OnXExample</warning> {
@Getter(onMethod_ = {@Deprecated, @SuppressWarnings(value = "someId")}) //JDK8
@Setter(onMethod_ = @Deprecated, onParam_ = @SuppressWarnings(value = "someOtherId")) //JDK8
private long unid;