Skip to content

Commit 812ca29

Browse files
committed
Fixed jenkinsci#394 - Replace library code with self implemented.
1 parent aecd014 commit 812ca29

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

ReleaseNotes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Release 0.3.9 (NOT RELEASED YET)
44

5-
* ...
5+
* [Fixed Issue 394][issue-394]
6+
7+
Replace `Strings.isNullOrEmpty()` with self implemented code.
68

79
* [Pull Request #386][pull-386]
810

jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,16 @@ public void updateDescription(String description) throws IOException {
273273
updateDescription(description, false);
274274
}
275275

276+
private boolean isNullOrEmpty(String value) {
277+
return value == null || value.isEmpty();
278+
}
279+
276280
private BuildCause convertToBuildCause(Map<String, Object> cause) {
277281
BuildCause cause_object = new BuildCause();
278282

279283
// TODO: Think about it. Can this be done more simpler?
280284
String description = (String) cause.get("shortDescription");
281-
if (!Strings.isNullOrEmpty(description)) {
285+
if (!isNullOrEmpty(description)) {
282286
cause_object.setShortDescription(description);
283287
}
284288

@@ -288,22 +292,22 @@ private BuildCause convertToBuildCause(Map<String, Object> cause) {
288292
}
289293

290294
String upstreamProject = (String) cause.get("upstreamProject");
291-
if (!Strings.isNullOrEmpty(upstreamProject)) {
295+
if (!isNullOrEmpty(upstreamProject)) {
292296
cause_object.setUpstreamProject(upstreamProject);
293297
}
294298

295299
String upstreamUrl = (String) cause.get("upstreamUrl");
296-
if (!Strings.isNullOrEmpty(upstreamUrl)) {
300+
if (!isNullOrEmpty(upstreamUrl)) {
297301
cause_object.setUpstreamUrl(upstreamUrl);
298302
}
299303

300304
String userId = (String) cause.get("userId");
301-
if (!Strings.isNullOrEmpty(userId)) {
305+
if (!isNullOrEmpty(userId)) {
302306
cause_object.setUserId(userId);
303307
}
304308

305309
String userName = (String) cause.get("userName");
306-
if (!Strings.isNullOrEmpty(userName)) {
310+
if (!isNullOrEmpty(userName)) {
307311
cause_object.setUserName(userName);
308312
}
309313
return cause_object;

0 commit comments

Comments
 (0)