mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[lombok] IDEA-352727 Support incomplete mode
- change tests - extract everything connected to dumb and incomplete mode into utils GitOrigin-RevId: 979f4333917f68d947c9d28c04d7e6dfef8400ae
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8a33c22212
commit
1ac9d8ac4e
@@ -6,14 +6,14 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import lombok.NonNull;
|
||||
|
||||
public class TestOnX {
|
||||
@NotNull
|
||||
@NonNull
|
||||
private final Integer someIntField;
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
@NotNull
|
||||
@NonNull
|
||||
private String someStringField;
|
||||
private float someFloatField;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class TestOnX {
|
||||
|
||||
@Inject
|
||||
@Named("myName1")
|
||||
public TestOnX(@NotNull Integer someIntField, @NotNull String someStringField) {
|
||||
public TestOnX(@NonNull Integer someIntField, @NonNull String someStringField) {
|
||||
if (someIntField == null) {
|
||||
throw new NullPointerException("someIntField is marked non-null but is null");
|
||||
} else if (someStringField == null) {
|
||||
@@ -43,7 +43,7 @@ public class TestOnX {
|
||||
|
||||
@Inject
|
||||
@Named("myName2")
|
||||
public TestOnX(@NotNull Integer someIntField, @NotNull String someStringField, float someFloatField) {
|
||||
public TestOnX(@NonNull Integer someIntField, @NonNull String someStringField, float someFloatField) {
|
||||
if (someIntField == null) {
|
||||
throw new NullPointerException("someIntField is marked non-null but is null");
|
||||
} else if (someStringField == null) {
|
||||
@@ -108,7 +108,7 @@ public class TestOnX {
|
||||
}
|
||||
|
||||
@Max(100)
|
||||
@NotNull
|
||||
@NonNull
|
||||
public Integer getSomeIntField() {
|
||||
return this.someIntField;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class TestOnX {
|
||||
@Size(
|
||||
max = 20
|
||||
)
|
||||
@NotNull
|
||||
@NonNull
|
||||
public String getSomeStringField() {
|
||||
return this.someStringField;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class TestOnX {
|
||||
@Size(
|
||||
min = 10
|
||||
)
|
||||
public void setSomeStringField(@Size(min = 15) @NotNull String someStringField) {
|
||||
public void setSomeStringField(@Size(min = 15) @NonNull String someStringField) {
|
||||
if (someStringField == null) {
|
||||
throw new NullPointerException("someStringField is marked non-null but is null");
|
||||
} else {
|
||||
@@ -136,7 +136,7 @@ public class TestOnX {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNull
|
||||
public TestOnX withSomeFloatField(@Min(1) float someFloatField) {
|
||||
return this.someFloatField == someFloatField ? this : new TestOnX(this.someIntField, this.someStringField, someFloatField);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ToString
|
||||
@RequiredArgsConstructor(onConstructor_ = {@Inject, @Named("myName1")})
|
||||
@@ -16,16 +15,16 @@ import org.jetbrains.annotations.NotNull;
|
||||
@EqualsAndHashCode(onParam_ = @Valid)
|
||||
public class TestOnX {
|
||||
@Getter(onMethod_ = @Max(100))
|
||||
@NotNull
|
||||
@NonNull
|
||||
private final Integer someIntField;
|
||||
|
||||
@NotNull
|
||||
@NonNull
|
||||
@Deprecated
|
||||
@Getter(onMethod_ = @Size(max = 20))
|
||||
@Setter(onMethod_ = @Size(min = 10), onParam_ = @Size(min = 15))
|
||||
private String someStringField;
|
||||
|
||||
@With(onMethod_ = @NotNull, onParam_ = @Min(1))
|
||||
@With(onMethod_ = @NonNull, onParam_ = @Min(1))
|
||||
private float someFloatField;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user