Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 353f9bb

Browse files
committed
pointless null check since the with method already does it
1 parent ccfe3ad commit 353f9bb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/org/kohsuke/github/GHReleaseBuilder.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public GHReleaseBuilder(GHRepository ghRepository, String tag) {
2121
* @param body The release notes body.
2222
*/
2323
public GHReleaseBuilder body(String body) {
24-
if (body != null) {
25-
builder.with("body", body);
26-
}
24+
builder.with("body", body);
2725
return this;
2826
}
2927

@@ -35,9 +33,7 @@ public GHReleaseBuilder body(String body) {
3533
* already exists.
3634
*/
3735
public GHReleaseBuilder commitish(String commitish) {
38-
if (commitish != null) {
39-
builder.with("target_commitish", commitish);
40-
}
36+
builder.with("target_commitish", commitish);
4137
return this;
4238
}
4339

@@ -56,9 +52,7 @@ public GHReleaseBuilder draft(boolean draft) {
5652
* @param name the name of the release
5753
*/
5854
public GHReleaseBuilder name(String name) {
59-
if (name != null) {
60-
builder.with("name", name);
61-
}
55+
builder.with("name", name);
6256
return this;
6357
}
6458

0 commit comments

Comments
 (0)