accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-2981 Fix warnings building in JDK8
Date Sat, 13 Dec 2014 19:23:38 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 1a944c06c -> c07e3d063
  refs/heads/master bd4d190ee -> 923accb68


ACCUMULO-2981 Fix warnings building in JDK8

  Remove use of single underscore as an identifier (replaced with
  U+2054). And fix type safety check failure with EasyMock in JDK8.

  Make it easier to switch Java version by moving it to a Maven
  property.


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

Branch: refs/heads/1.6
Commit: c07e3d0636d7922ff2040200cde7831e2100f624
Parents: 1a944c0
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Sat Dec 13 14:00:13 2014 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Sat Dec 13 14:09:11 2014 -0500

----------------------------------------------------------------------
 .../minicluster/impl/CleanShutdownMacTest.java      |  2 +-
 pom.xml                                             |  9 +++++----
 .../java/org/apache/accumulo/master/Master.java     | 16 ++++++++--------
 3 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c07e3d06/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/CleanShutdownMacTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/CleanShutdownMacTest.java
b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/CleanShutdownMacTest.java
index 2ac8d6f..09ee9f4 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/CleanShutdownMacTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/CleanShutdownMacTest.java
@@ -44,7 +44,7 @@ public class CleanShutdownMacTest {
     cluster.setShutdownExecutor(mockService);
 
     EasyMock.expect(future.get()).andReturn(0).anyTimes();
-    EasyMock.expect(mockService.submit(EasyMock.anyObject(Callable.class))).andReturn(future).anyTimes();
+    EasyMock.expect(mockService.<Integer>submit(EasyMock.anyObject(Callable.class))).andReturn(future).anyTimes();
     EasyMock.expect(mockService.shutdownNow()).andReturn(Collections.<Runnable> emptyList()).once();
 
     EasyMock.replay(mockService, future);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c07e3d06/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 824f56c..f40a650 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,6 +123,7 @@
     <!-- overwritten in profiles hadoop-1 or hadoop-2 -->
     <hadoop.version>2.2.0</hadoop.version>
     <httpclient.version>3.1</httpclient.version>
+    <java.ver>1.6</java.ver>
     <jetty.version>8.1.15.v20140411</jetty.version>
     <!-- the maven-release-plugin makes this recommendation, due to plugin bugs -->
     <maven.min-version>3.0.4</maven.min-version>
@@ -572,8 +573,8 @@
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
-            <source>1.6</source>
-            <target>1.6</target>
+            <source>${java.ver}</source>
+            <target>${java.ver}</target>
             <optimize>true</optimize>
             <showDeprecation>true</showDeprecation>
             <showWarnings>true</showWarnings>
@@ -598,7 +599,7 @@
             <encoding>${project.reporting.outputEncoding}</encoding>
             <quiet>true</quiet>
             <reportOutputDirectory>docs</reportOutputDirectory>
-            <javadocVersion>1.6</javadocVersion>
+            <javadocVersion>${java.ver}</javadocVersion>
             <additionalJOption>-J-Xmx512m</additionalJOption>
           </configuration>
         </plugin>
@@ -977,7 +978,7 @@
           </excludes>
           <format>html</format>
           <includeTests>true</includeTests>
-          <targetJdk>1.6</targetJdk>
+          <targetJdk>${java.ver}</targetJdk>
         </configuration>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c07e3d06/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index 83e83cf..496b6a9 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -188,17 +188,17 @@ public class Master implements LiveTServerSet.Listener, TableObserver,
CurrentSt
   }
 
   static final boolean X = true;
-  static final boolean _ = false;
+  static final boolean ⁔ = false; // use U+2054 because a single underscore is deprecated
as an identifier in Java 8.
   // @formatter:off
   static final boolean transitionOK[][] = {
       //                              INITIAL HAVE_LOCK SAFE_MODE NORMAL UNLOAD_META UNLOAD_ROOT
STOP
-      /* INITIAL */                   {X,     X,        _,        _,      _,         _, 
        X},
-      /* HAVE_LOCK */                 {_,     X,        X,        X,      _,         _, 
        X},
-      /* SAFE_MODE */                 {_,     _,        X,        X,      X,         _, 
        X},
-      /* NORMAL */                    {_,     _,        X,        X,      X,         _, 
        X},
-      /* UNLOAD_METADATA_TABLETS */   {_,     _,        X,        X,      X,         X, 
        X},
-      /* UNLOAD_ROOT_TABLET */        {_,     _,        _,        X,      X,         X, 
        X},
-      /* STOP */                      {_,     _,        _,        _,      _,         X, 
        X}};
+      /* INITIAL */                   {X,     X,        ⁔,        ⁔,      ⁔,      
  ⁔,          X},
+      /* HAVE_LOCK */                 {⁔,     X,        X,        X,      ⁔,        
⁔,          X},
+      /* SAFE_MODE */                 {⁔,     ⁔,        X,        X,      X,        
⁔,          X},
+      /* NORMAL */                    {⁔,     ⁔,        X,        X,      X,        
⁔,          X},
+      /* UNLOAD_METADATA_TABLETS */   {⁔,     ⁔,        X,        X,      X,        
X,          X},
+      /* UNLOAD_ROOT_TABLET */        {⁔,     ⁔,        ⁔,        X,      X,      
  X,          X},
+      /* STOP */                      {⁔,     ⁔,        ⁔,        ⁔,      ⁔,  
      X,          X}};
   //@formatter:on
   synchronized void setMasterState(MasterState newState) {
     if (state.equals(newState))


Mime
View raw message