-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixes #2120] ecj was not generating explicit nullchecks for builder-…
…setters.
- Loading branch information
1 parent
d41e804
commit e69a991
Showing
9 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
test/transform/resource/after-delombok/BuilderWithNonNull.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class BuilderWithNonNull { | ||
@lombok.NonNull | ||
private final String id; | ||
@java.lang.SuppressWarnings("all") | ||
BuilderWithNonNull(@lombok.NonNull final String id) { | ||
if (id == null) { | ||
throw new java.lang.NullPointerException("id is marked non-null but is null"); | ||
} | ||
this.id = id; | ||
} | ||
@java.lang.SuppressWarnings("all") | ||
public static class BuilderWithNonNullBuilder { | ||
@java.lang.SuppressWarnings("all") | ||
private String id; | ||
@java.lang.SuppressWarnings("all") | ||
BuilderWithNonNullBuilder() { | ||
} | ||
@java.lang.SuppressWarnings("all") | ||
public BuilderWithNonNullBuilder id(@lombok.NonNull final String id) { | ||
if (id == null) { | ||
throw new java.lang.NullPointerException("id is marked non-null but is null"); | ||
} | ||
this.id = id; | ||
return this; | ||
} | ||
@java.lang.SuppressWarnings("all") | ||
public BuilderWithNonNull build() { | ||
return new BuilderWithNonNull(id); | ||
} | ||
@java.lang.Override | ||
@java.lang.SuppressWarnings("all") | ||
public java.lang.String toString() { | ||
return "BuilderWithNonNull.BuilderWithNonNullBuilder(id=" + this.id + ")"; | ||
} | ||
} | ||
@java.lang.SuppressWarnings("all") | ||
public static BuilderWithNonNullBuilder builder() { | ||
return new BuilderWithNonNullBuilder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@lombok.Builder class BuilderWithNonNull { | ||
public static @java.lang.SuppressWarnings("all") class BuilderWithNonNullBuilder { | ||
private @java.lang.SuppressWarnings("all") String id; | ||
@java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder() { | ||
super(); | ||
} | ||
public @java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder id(final @lombok.NonNull String id) { | ||
if ((id == null)) | ||
{ | ||
throw new java.lang.NullPointerException("id is marked non-null but is null"); | ||
} | ||
this.id = id; | ||
return this; | ||
} | ||
public @java.lang.SuppressWarnings("all") BuilderWithNonNull build() { | ||
return new BuilderWithNonNull(id); | ||
} | ||
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { | ||
return (("BuilderWithNonNull.BuilderWithNonNullBuilder(id=" + this.id) + ")"); | ||
} | ||
} | ||
private final @lombok.NonNull String id; | ||
@java.lang.SuppressWarnings("all") BuilderWithNonNull(final @lombok.NonNull String id) { | ||
super(); | ||
if ((id == null)) | ||
{ | ||
throw new java.lang.NullPointerException("id is marked non-null but is null"); | ||
} | ||
this.id = id; | ||
} | ||
public static @java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder builder() { | ||
return new BuilderWithNonNullBuilder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@lombok.Builder | ||
class BuilderWithNonNull { | ||
@lombok.NonNull | ||
private final String id; | ||
} |