Repository: aurora
Updated Branches:
  refs/heads/master 0c98e8a82 -> d7a1619fa


Upgrade checkstyle and pmd versions.

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


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

Branch: refs/heads/master
Commit: d7a1619fa85195937e74d1b09594909f0ed0ffd5
Parents: 0c98e8a
Author: Bill Farner <[email protected]>
Authored: Mon Dec 7 19:47:58 2015 -0800
Committer: Bill Farner <[email protected]>
Committed: Mon Dec 7 19:48:13 2015 -0800

----------------------------------------------------------------------
 build.gradle                                       |  6 ++----
 config/pmd/custom.xml                              | 17 ++++-------------
 .../aurora/scheduler/state/TaskStateMachine.java   |  2 +-
 .../scheduler/thrift/ReadOnlySchedulerImpl.java    |  2 +-
 .../scheduler/thrift/SchedulerThriftInterface.java |  2 +-
 .../aurora/scheduler/updater/InstanceUpdater.java  |  4 ++--
 6 files changed, 11 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index c6799d8..fcf8039 100644
--- a/build.gradle
+++ b/build.gradle
@@ -392,7 +392,7 @@ codeQualityTasks.each {
 
 checkstyle {
   sourceSets = [sourceSets.main , sourceSets.test, sourceSets.jmh]
-  toolVersion = '6.12.1'
+  toolVersion = '6.13'
 }
 
 findbugs {
@@ -410,9 +410,7 @@ tasks.withType(FindBugs) {
 }
 
 pmd {
-  // Avoiding gradle's upgrade of PMD since there have been regressions in 
some rules post-5.1.1.
-  // For example, UnusedPrivateMethod raises some obvious false positives.
-  toolVersion = '5.1.1'
+  toolVersion = '5.4.1'
 
   sourceSets = [sourceSets.main]
   // PMD rule set names match XML files stored in the PMD jar.  For example, 
with 5.11 you can

http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/config/pmd/custom.xml
----------------------------------------------------------------------
diff --git a/config/pmd/custom.xml b/config/pmd/custom.xml
index c31cac9..763051b 100644
--- a/config/pmd/custom.xml
+++ b/config/pmd/custom.xml
@@ -23,21 +23,12 @@ limitations under the License.
   </description>
 
   <rule ref="rulesets/java/basic.xml">
-    <!-- Duplicate definitions - defined in empty.xml below and marked 
deprecated.
-         See http://sourceforge.net/p/pmd/discussion/188193/thread/6e9c6017/ 
-->
-    <exclude name="EmptyCatchBlock"/>
-    <exclude name="EmptyIfStmt"/>
-    <exclude name="EmptyWhileStmt"/>
-    <exclude name="EmptyTryBlock"/>
-    <exclude name="EmptyFinallyBlock"/>
-    <exclude name="EmptySwitchStatements"/>
-    <exclude name="EmptySynchronizedBlock"/>
-    <exclude name="EmptyStatementNotInLoop"/>
-    <exclude name="EmptyInitializer"/>
-    <exclude name="EmptyStatementBlock"/>
-    <exclude name="EmptyStaticInitializer"/>
   </rule>
   <rule ref="rulesets/java/design.xml">
+    <!-- This rule suffers from false positivies in cases where we are 
implementing a third-party
+         interface. -->
+    <exclude name="UseVarargs"/>
+
     <!-- We're not currently focusing on localization. -->
     <exclude name="SimpleDateFormatNeedsLocale"/>
     <exclude name="UseLocaleWithCaseConversions"/>

http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/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 3709c77..9ace5b0 100644
--- a/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
+++ b/src/main/java/org/apache/aurora/scheduler/state/TaskStateMachine.java
@@ -525,7 +525,7 @@ class TaskStateMachine {
      * state transition (e.g. storing resource consumption of a running task), 
we need to find
      * a different way to suppress noop transitions.
      */
-    TaskState taskState = 
status.transform(STATUS_TO_TASK_STATE).or(TaskState.DELETED);
+    TaskState taskState = status.transform(STATUS_TO_TASK_STATE).or(DELETED);
     if (stateMachine.getState() == taskState) {
       return new TransitionResult(NOOP, ImmutableSet.of());
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java 
b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
index ea43912..358b80c 100644
--- 
a/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
+++ 
b/src/main/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImpl.java
@@ -364,7 +364,7 @@ class ReadOnlySchedulerImpl implements 
ReadOnlyScheduler.Iface {
       @Override
       public Response apply(StoreProvider storeProvider) throws 
RuntimeException {
         if (storeProvider.getCronJobStore().fetchJob(job).isPresent()) {
-          return Responses.invalidRequest(NO_CRON);
+          return invalidRequest(NO_CRON);
         }
 
         JobDiff diff = JobDiff.compute(

http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
 
b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
index 326d4fb..2d7c223 100644
--- 
a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ 
b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -650,7 +650,7 @@ class SchedulerThriftInterface implements 
AnnotatedAuroraAdmin {
   @Override
   public Response rewriteConfigs(RewriteConfigsRequest request) {
     if (request.getRewriteCommandsSize() == 0) {
-      return addMessage(Responses.empty(), INVALID_REQUEST, "No rewrite 
commands provided.");
+      return addMessage(empty(), INVALID_REQUEST, "No rewrite commands 
provided.");
     }
 
     return storage.write(new MutateWork.Quiet<Response>() {

http://git-wip-us.apache.org/repos/asf/aurora/blob/d7a1619f/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java 
b/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
index 0acceaa..3a2eec3 100644
--- a/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
+++ b/src/main/java/org/apache/aurora/scheduler/updater/InstanceUpdater.java
@@ -144,10 +144,10 @@ class InstanceUpdater implements 
StateEvaluator<Optional<IScheduledTask>> {
       // This is not the configuration that we would like to run.
       if (isKillable(status)) {
         // Task is active, kill it.
-        return StateEvaluator.Result.KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE;
+        return KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE;
       } else if (Tasks.isTerminated(status) && 
isPermanentlyKilled(actualState)) {
         // The old task has exited, it is now safe to add the new one.
-        return StateEvaluator.Result.REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE;
+        return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE;
       }
     }
 

Reply via email to