aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject git commit: Add PMD to the build.
Date Wed, 21 May 2014 19:59:51 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 8f3b20404 -> 2fb6b7dc8


Add PMD to the build.

Reviewed at https://reviews.apache.org/r/21754/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/2fb6b7dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/2fb6b7dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/2fb6b7dc

Branch: refs/heads/master
Commit: 2fb6b7dc8e9c8c0255dfbf9a497ac0f40e23a3d5
Parents: 8f3b204
Author: Bill Farner <wfarner@apache.org>
Authored: Wed May 21 12:54:00 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Wed May 21 12:54:00 2014 -0700

----------------------------------------------------------------------
 build.gradle                                    |  8 ++-
 .../aurora/scheduler/UserTaskLauncher.java      |  6 +-
 .../aurora/scheduler/async/HistoryPruner.java   | 18 +++---
 .../aurora/scheduler/async/OfferQueue.java      |  2 +-
 .../apache/aurora/scheduler/base/Numbers.java   |  2 +-
 .../org/apache/aurora/scheduler/base/Query.java |  2 +-
 .../configuration/ConfigurationManager.java     |  2 +-
 .../scheduler/configuration/Resources.java      | 10 ++--
 .../aurora/scheduler/events/PubsubEvent.java    |  6 +-
 .../scheduler/filter/SchedulingFilter.java      |  4 +-
 .../scheduler/filter/SchedulingFilterImpl.java  |  2 +-
 .../scheduler/http/TransformationUtils.java     |  2 +-
 .../local/IsolatedSchedulerModule.java          |  6 +-
 .../aurora/scheduler/metadata/NearestFit.java   |  2 +-
 .../scheduler/state/StateManagerImpl.java       |  2 +-
 .../scheduler/state/TaskStateMachine.java       |  6 +-
 .../scheduler/state/TransitionResult.java       |  2 +-
 .../scheduler/storage/mem/MemTaskStore.java     | 60 ++++++++------------
 18 files changed, 67 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index ac54257..77fba33 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,6 +24,7 @@ apply plugin: 'java'
 apply plugin: 'js'
 apply plugin: 'license'
 apply plugin: 'maven-publish'
+apply plugin: 'pmd'
 apply plugin: 'project-report'
 apply plugin: 'versions'
 
@@ -247,6 +248,11 @@ tasks.withType(FindBugs) {
   excludeFilter = rootProject.file('config/findbugs/excludeFilter.xml')
 }
 
+pmd {
+  sourceSets = [ sourceSets.main ]
+  toolVersion = '5.1.1'
+}
+
 task checkPython() {
   def py_versions = ['python2.7', 'python2.6', 'python']
 
@@ -473,4 +479,4 @@ task FlagSchemaChanges(type: Test) << {
 
 javadoc {
   classpath += sourceSets.generated.output
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java b/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
index fd26441..c9e62f1 100644
--- a/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
+++ b/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
@@ -76,9 +76,9 @@ class UserTaskLauncher implements TaskLauncher {
       ScheduleStatus translatedState = Conversions.convertProtoState(status.getState());
       // TODO(William Farner): Remove this hack once Mesos API change is done.
       //                       Tracked by: https://issues.apache.org/jira/browse/MESOS-343
-      if ((translatedState == ScheduleStatus.FAILED)
-          && (message != null)
-          && (message.contains(MEMORY_LIMIT_EXCEEDED))) {
+      if (translatedState == ScheduleStatus.FAILED
+          && message != null
+          && message.contains(MEMORY_LIMIT_EXCEEDED)) {
         message = MEMORY_LIMIT_DISPLAY;
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java b/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
index 59f615c..ab47f88 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
@@ -156,16 +156,14 @@ public class HistoryPruner implements EventSubscriber {
         Collection<IScheduledTask> inactiveTasks =
             Storage.Util.weaklyConsistentFetchTasks(storage, jobHistoryQuery(jobKey));
         int tasksToPrune = inactiveTasks.size() - settings.perJobHistoryGoal;
-        if (tasksToPrune > 0) {
-          if (inactiveTasks.size() > settings.perJobHistoryGoal) {
-            Set<String> toPrune = FluentIterable
-                .from(Tasks.LATEST_ACTIVITY.sortedCopy(inactiveTasks))
-                .filter(safeToDelete)
-                .limit(tasksToPrune)
-                .transform(Tasks.SCHEDULED_TO_ID)
-                .toSet();
-            deleteTasks(toPrune);
-          }
+        if (tasksToPrune > 0 && inactiveTasks.size() > settings.perJobHistoryGoal)
{
+          Set<String> toPrune = FluentIterable
+              .from(Tasks.LATEST_ACTIVITY.sortedCopy(inactiveTasks))
+              .filter(safeToDelete)
+              .limit(tasksToPrune)
+              .transform(Tasks.SCHEDULED_TO_ID)
+              .toSet();
+          deleteTasks(toPrune);
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
index b85e42b..87c3797 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
@@ -250,7 +250,7 @@ public interface OfferQueue extends EventSubscriber {
           return false;
         }
         HostOffer other = (HostOffer) o;
-        return Objects.equal(offer, other.offer) && (mode == other.mode);
+        return Objects.equal(offer, other.offer) && mode == other.mode;
       }
 
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Numbers.java b/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
index 54739e0..5fb22e7 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Numbers.java
@@ -53,7 +53,7 @@ public final class Numbers {
       int start = iterator.next();
       int end = start;
       // Increment the end until the range is non-contiguous.
-      while (iterator.hasNext() && (iterator.peek() == (end + 1))) {
+      while (iterator.hasNext() && iterator.peek() == end + 1) {
         end++;
         iterator.next();
       }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/base/Query.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Query.java b/src/main/java/org/apache/aurora/scheduler/base/Query.java
index 1e586c5..825318a 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Query.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Query.java
@@ -56,7 +56,7 @@ public final class Query {
    */
   public static boolean isJobScoped(Builder taskQuery) {
     TaskQuery q = taskQuery.get();
-    return (q.isSetOwner() && q.getOwner().isSetRole() && q.isSetEnvironment()
&& q.isSetJobName())
+    return q.isSetOwner() && q.getOwner().isSetRole() && q.isSetEnvironment()
&& q.isSetJobName()
         || q.isSetJobKeys();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
index e5ad461..8d95c7e 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
@@ -173,7 +173,7 @@ public final class ConfigurationManager {
   public static boolean isGoodIdentifier(@Nullable String identifier) {
     return identifier != null
         && GOOD_IDENTIFIER.matcher(identifier).matches()
-        && (identifier.length() <= MAX_IDENTIFIER_LENGTH);
+        && identifier.length() <= MAX_IDENTIFIER_LENGTH;
   }
 
   private static void checkNotNull(Object value, String error) throws TaskDescriptionException
{

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java b/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
index 5e3015d..9139b06 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
@@ -96,10 +96,10 @@ public class Resources {
    *    equivalents from {@code other}, otherwise {@code false}.
    */
   public boolean greaterThanOrEqual(Resources other) {
-    return (numCpus >= other.numCpus)
-        && (disk.as(Data.MB) >= other.disk.as(Data.MB))
-        && (ram.as(Data.MB) >= other.ram.as(Data.MB))
-        && (numPorts >= other.numPorts);
+    return numCpus >= other.numCpus
+        && disk.as(Data.MB) >= other.disk.as(Data.MB)
+        && ram.as(Data.MB) >= other.ram.as(Data.MB)
+        && numPorts >= other.numPorts;
   }
 
   /**
@@ -244,7 +244,7 @@ public class Resources {
   private static int getNumAvailablePorts(List<Resource> resource) {
     int offeredPorts = 0;
     for (Range range : getPortRanges(resource)) {
-      offeredPorts += 1 + (range.getEnd() - range.getBegin());
+      offeredPorts += 1 + range.getEnd() - range.getBegin();
     }
     return offeredPorts;
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
index 2669781..c8b6060 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
@@ -225,7 +225,7 @@ public interface PubsubEvent {
   public static class DriverRegistered implements PubsubEvent {
     @Override
     public boolean equals(Object o) {
-      return (o != null) && getClass().equals(o.getClass());
+      return o != null && getClass().equals(o.getClass());
     }
 
     @Override
@@ -237,7 +237,7 @@ public interface PubsubEvent {
   public static class DriverDisconnected implements PubsubEvent {
     @Override
     public boolean equals(Object o) {
-      return (o != null) && getClass().equals(o.getClass());
+      return o != null && getClass().equals(o.getClass());
     }
 
     @Override
@@ -249,7 +249,7 @@ public interface PubsubEvent {
   public static class SchedulerActive implements PubsubEvent {
     @Override
     public boolean equals(Object o) {
-      return (o != null) && getClass().equals(o.getClass());
+      return o != null && getClass().equals(o.getClass());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
index f428be4..cf2a425 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
@@ -83,8 +83,8 @@ public interface SchedulingFilter {
 
       Veto other = (Veto) o;
       return Objects.equal(reason, other.reason)
-          && (score == other.score)
-          && (valueMismatch == other.valueMismatch);
+          && score == other.score
+          && valueMismatch == other.valueMismatch;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
index 7c6e9ba..cd27bf1 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
@@ -132,7 +132,7 @@ public class SchedulingFilterImpl implements SchedulingFilter {
     }
 
     private static int scale(double value, int range) {
-      return Math.min(Veto.MAX_SCORE, (int) ((Veto.MAX_SCORE * value)) / range);
+      return Math.min(Veto.MAX_SCORE, (int) (Veto.MAX_SCORE * value) / range);
     }
 
     @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/http/TransformationUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/TransformationUtils.java b/src/main/java/org/apache/aurora/scheduler/http/TransformationUtils.java
index e99d41c..c2878f2 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/TransformationUtils.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/TransformationUtils.java
@@ -47,7 +47,7 @@ final class TransformationUtils {
         public String apply(Range<Integer> range) {
           int lower = range.lowerEndpoint();
           int upper = range.upperEndpoint();
-          return (lower == upper) ? String.valueOf(lower) : (lower + " - " + upper);
+          return lower == upper ? String.valueOf(lower) : lower + " - " + upper;
         }
       };
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/local/IsolatedSchedulerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/local/IsolatedSchedulerModule.java
b/src/main/java/org/apache/aurora/scheduler/local/IsolatedSchedulerModule.java
index 1bfd4b6..80f3cac 100644
--- a/src/main/java/org/apache/aurora/scheduler/local/IsolatedSchedulerModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/local/IsolatedSchedulerModule.java
@@ -201,21 +201,21 @@ public class IsolatedSchedulerModule extends AbstractModule {
           Identity mesosUser = new Identity("mesos", "mesos");
           for (int i = 0; i < 20; i++) {
             JobConfiguration service = createJob("serviceJob" + i, mesosUser);
-            service.getTaskConfig().setProduction((i % 2) == 0);
+            service.getTaskConfig().setProduction(i % 2 == 0);
             service.getTaskConfig().setIsService(true);
             submitJob(service);
           }
 
           for (int i = 0; i < 20; i++) {
             JobConfiguration adhocJob = createJob("adhocJob" + i, mesosUser);
-            adhocJob.getTaskConfig().setProduction((i % 2) == 0);
+            adhocJob.getTaskConfig().setProduction(i % 2 == 0);
             adhocJob.getTaskConfig();
             submitJob(adhocJob);
           }
 
           for (int i = 0; i < 20; i++) {
             JobConfiguration cron = createJob("cronJob" + i, mesosUser);
-            cron.getTaskConfig().setProduction((i % 2) == 0);
+            cron.getTaskConfig().setProduction(i % 2 == 0);
             cron.setCronSchedule("* * * * *");
             submitJob(cron);
           }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java b/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
index c328ff8..a9e2a05 100644
--- a/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
+++ b/src/main/java/org/apache/aurora/scheduler/metadata/NearestFit.java
@@ -169,7 +169,7 @@ public class NearestFit implements EventSubscriber {
       if (valueMismatchOld == valueMismatchNew) {
         if (newVetoes.size() < vetoes.size()) {
           update(newVetoes);
-        } else if ((newVetoes.size() == vetoes.size()) && (score(newVetoes) <
score(vetoes))) {
+        } else if (newVetoes.size() == vetoes.size() && score(newVetoes) < score(vetoes))
{
           update(newVetoes);
         }
       } else if (valueMismatchOld) {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java b/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
index c0c34b6..58e39e0 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/StateManagerImpl.java
@@ -255,7 +255,7 @@ public class StateManagerImpl implements StateManager {
 
         // CAS operation fails if the task does not exist, or the states don't match.
         if (casState.isPresent()
-            && (!task.isPresent() || (casState.get() != task.get().getStatus())))
{
+            && (!task.isPresent() || casState.get() != task.get().getStatus())) {
 
           return false;
         }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
index 6072a24..f38fe6b 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
@@ -249,7 +249,7 @@ class TaskStateMachine {
         // Max failures is ignored when set to -1.
         int maxFailures = task.get().getAssignedTask().getTask().getMaxTaskFailures();
         boolean belowMaxFailures =
-            (maxFailures == -1) || (task.get().getFailureCount() < (maxFailures - 1));
+            maxFailures == -1 || task.get().getFailureCount() < (maxFailures - 1);
         if (isService || belowMaxFailures) {
           addFollowup(RESCHEDULE);
         } else {
@@ -481,10 +481,10 @@ class TaskStateMachine {
                   // (save followed by delete), but it shows a wart with this catch-all behavior.
                   // Strongly consider pushing the SAVE_STATE behavior to each transition
handler.
                   boolean pendingDeleteHack =
-                      !(((from == PENDING) || (from == THROTTLED)) && (to == KILLING));
+                      !((from == PENDING || from == THROTTLED) && to == KILLING);
 
                   // Don't bother saving state of a task that is being removed.
-                  if ((to != DELETED) && pendingDeleteHack) {
+                  if (to != DELETED && pendingDeleteHack) {
                     addFollowup(SAVE_STATE);
                   }
                   previousState = Optional.of(from);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java b/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
index 15174bd..5a0ee34 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TransitionResult.java
@@ -54,7 +54,7 @@ public class TransitionResult {
     }
 
     TransitionResult other = (TransitionResult) o;
-    return (success == other.success)
+    return success == other.success
         && Objects.equal(sideEffects, other.sideEffects);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2fb6b7dc/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
index 8589010..80d256d 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/mem/MemTaskStore.java
@@ -123,7 +123,7 @@ class MemTaskStore implements TaskStore.Mutable {
     long start = System.nanoTime();
     ImmutableSet<IScheduledTask> result = matches(query).transform(TO_SCHEDULED).toSet();
     long durationNanos = System.nanoTime() - start;
-    Level level = (durationNanos >= slowQueryThresholdNanos) ? Level.INFO : Level.FINE;
+    Level level = durationNanos >= slowQueryThresholdNanos ? Level.INFO : Level.FINE;
     if (LOG.isLoggable(level)) {
       Long time = Amount.of(durationNanos, Time.NANOSECONDS).as(Time.MILLISECONDS);
       LOG.log(level, "Query took " + time + " ms: " + query.get());
@@ -232,53 +232,41 @@ class MemTaskStore implements TaskStore.Mutable {
         IScheduledTask task = canonicalTask.task;
         ITaskConfig config = task.getAssignedTask().getTask();
         if (query.getOwner() != null) {
-          if (!StringUtils.isBlank(query.getOwner().getRole())) {
-            if (!query.getOwner().getRole().equals(config.getOwner().getRole())) {
-              return false;
-            }
-          }
-          if (!StringUtils.isBlank(query.getOwner().getUser())) {
-            if (!query.getOwner().getUser().equals(config.getOwner().getUser())) {
-              return false;
-            }
-          }
-        }
-        if (query.getEnvironment() != null) {
-          if (!query.getEnvironment().equals(config.getEnvironment())) {
+          if (!StringUtils.isBlank(query.getOwner().getRole())
+              && !query.getOwner().getRole().equals(config.getOwner().getRole()))
{
             return false;
           }
-        }
-        if (query.getJobName() != null) {
-          if (!query.getJobName().equals(config.getJobName())) {
+          if (!StringUtils.isBlank(query.getOwner().getUser())
+              && !query.getOwner().getUser().equals(config.getOwner().getUser()))
{
             return false;
           }
         }
+        if (query.getEnvironment() != null
+            && !query.getEnvironment().equals(config.getEnvironment())) {
+          return false;
+        }
+        if (query.getJobName() != null && !query.getJobName().equals(config.getJobName()))
{
+          return false;
+        }
 
-        if (query.getJobKeysSize() > 0) {
-          if (!query.getJobKeys().contains(JobKeys.from(config).newBuilder())) {
-            return false;
-          }
+        if (query.getJobKeysSize() > 0
+            && !query.getJobKeys().contains(JobKeys.from(config).newBuilder())) {
+          return false;
         }
-        if (query.getTaskIds() != null) {
-          if (!query.getTaskIds().contains(Tasks.id(task))) {
+        if (query.getTaskIds() != null && !query.getTaskIds().contains(Tasks.id(task)))
{
             return false;
-          }
         }
 
-        if (query.getStatusesSize() > 0) {
-          if (!query.getStatuses().contains(task.getStatus())) {
-            return false;
-          }
+        if (query.getStatusesSize() > 0 && !query.getStatuses().contains(task.getStatus()))
{
+          return false;
         }
-        if (query.getSlaveHostsSize() > 0) {
-          if (!query.getSlaveHosts().contains(task.getAssignedTask().getSlaveHost())) {
-            return false;
-          }
+        if (query.getSlaveHostsSize() > 0
+            && !query.getSlaveHosts().contains(task.getAssignedTask().getSlaveHost()))
{
+          return false;
         }
-        if (query.getInstanceIdsSize() > 0) {
-          if (!query.getInstanceIds().contains(task.getAssignedTask().getInstanceId())) {
-            return false;
-          }
+        if (query.getInstanceIdsSize() > 0
+            && !query.getInstanceIds().contains(task.getAssignedTask().getInstanceId()))
{
+          return false;
         }
 
         return true;


Mime
View raw message