@@ -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