accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/6] ACCUMULO-2160 fixed up a lot of findbugs/pmd complaints
Date Wed, 08 Jan 2014 23:33:17 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
b/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
index 1c60640..8ef7d5f 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
@@ -71,7 +71,7 @@ public class UndefinedAnalyzer {
     public IngestInfo(String logDir) throws Exception {
       File dir = new File(logDir);
       File[] ingestLogs = dir.listFiles(new FilenameFilter() {
-        public boolean accept(java.io.File dir, String name) {
+        public boolean accept(File dir, String name) {
           return name.endsWith("ingest.out");
         }
       });
@@ -162,7 +162,7 @@ public class UndefinedAnalyzer {
     TabletHistory(String tableId, String acuLogDir) throws Exception {
       File dir = new File(acuLogDir);
       File[] masterLogs = dir.listFiles(new FilenameFilter() {
-        public boolean accept(java.io.File dir, String name) {
+        public boolean accept(File dir, String name) {
           return name.matches("master.*debug.log.*");
         }
       });

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
index 449d732..9af578c 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
@@ -226,7 +226,7 @@ public class MetadataBatchScanTest {
     bs.close();
     long t2 = System.currentTimeMillis();
     
-    ss.delta1 = (t2 - t1);
+    ss.delta1 = t2 - t1;
     ss.count1 = count;
     
     count = 0;
@@ -237,7 +237,7 @@ public class MetadataBatchScanTest {
     
     t2 = System.currentTimeMillis();
     
-    ss.delta2 = (t2 - t1);
+    ss.delta2 = t2 - t1;
     ss.count2 = count;
     
     return ss;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
index 397f2e8..c9da3a8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
@@ -355,7 +355,7 @@ public class Module extends Node {
   private String getFullName(String name) {
     
     int index = name.indexOf(".");
-    if ((index == -1) || name.endsWith(".xml")) {
+    if (index == -1 || name.endsWith(".xml")) {
       return name;
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
index c94c80e..dad2bcc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
@@ -49,7 +49,7 @@ public class Setup extends Test {
     try {
       if (!tableOps.exists(getTableName())) {
         tableOps.create(getTableName());
-        IteratorSetting is = new IteratorSetting(10, org.apache.accumulo.core.iterators.user.SummingCombiner.class);
+        IteratorSetting is = new IteratorSetting(10, SummingCombiner.class);
         SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
         SummingCombiner.setCombineAllColumns(is, true);
         tableOps.attachIterator(getTableName(), is);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
index aa976f7..e03b7f6 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
@@ -47,7 +47,7 @@ public class AddSplits extends Test {
     TreeSet<Text> splits = new TreeSet<Text>();
     
     for (int i = 0; i < rand.nextInt(10) + 1; i++)
-      splits.add(new Text(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl))));
+      splits.add(new Text(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
     
     try {
       conn.tableOperations().addSplits(tableName, splits);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
index 009dd44..3fa7d47 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
@@ -53,7 +53,7 @@ public class BatchScan extends Test {
       BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 3);
       List<Range> ranges = new ArrayList<Range>();
       for (int i = 0; i < rand.nextInt(2000) + 1; i++)
-        ranges.add(new Range(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl))));
+        ranges.add(new Range(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
       
       bs.setRanges(ranges);
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
index f1c5e22..2e52f12 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
@@ -50,8 +50,8 @@ public class BatchWrite extends Test {
       try {
         int numRows = rand.nextInt(100000);
         for (int i = 0; i < numRows; i++) {
-          Mutation m = new Mutation(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl)));
-          long val = (rand.nextLong() & 0x7fffffffffffffffl);
+          Mutation m = new Mutation(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl));
+          long val = rand.nextLong() & 0x7fffffffffffffffl;
           for (int j = 0; j < 10; j++) {
             m.put("cf", "cq" + j, new Value(String.format("%016x", val).getBytes()));
           }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
index f0a93ac..066ef63 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
@@ -48,7 +48,7 @@ public class CheckBalance extends Test {
       String location = entry.getKey().getColumnQualifier().toString();
       Long count = counts.get(location);
       if (count == null)
-        count = new Long(0);
+        count = Long.valueOf(0);
       counts.put(location, count + 1);
     }
     double total = 0.;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
index cb481f8..502e9e3 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
@@ -43,7 +43,7 @@ public class Setup extends Test {
     }
     
     // Make tables in the default namespace
-    double tableCeil = Math.ceil(numTables / (numNamespaces + 1));
+    double tableCeil = Math.ceil((double)numTables / (numNamespaces + 1));
     for (int i = 0; i < tableCeil; i++) {
       tables.add(String.format("ctt_%03d", i));
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
index 854ad0c..3a805ef 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
@@ -28,7 +28,7 @@ public class Commit extends Test {
     state.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
index 744c761..723bfa8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
@@ -86,9 +86,9 @@ public class ImageFixture extends Fixture {
       log.debug("Configured locality groups for " + imageTableName + " groups = " + groups);
     }
     
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
-    state.set("verified", new Integer(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
+    state.set("verified", Integer.valueOf(0));
     state.set("lastIndexRow", new Text(""));
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
index 7ee15f5..77c66ed 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
@@ -60,7 +60,7 @@ public class ScanMeta extends Test {
     int maxScan = Integer.parseInt(props.getProperty("maxScan"));
     
     Random rand = new Random();
-    int numToScan = rand.nextInt((maxScan - minScan)) + minScan;
+    int numToScan = rand.nextInt(maxScan - minScan) + minScan;
     
     Map<Text,Text> hashes = new HashMap<Text,Text>();
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
index 4206148..35e729f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
@@ -54,7 +54,7 @@ public class Write extends Test {
     int minSize = Integer.parseInt(props.getProperty("minSize"));
     
     Random rand = new Random();
-    int numBytes = rand.nextInt((maxSize - minSize)) + minSize;
+    int numBytes = rand.nextInt(maxSize - minSize) + minSize;
     byte[] imageBytes = new byte[numBytes];
     rand.nextBytes(imageBytes);
     m.put(CONTENT_COLUMN_FAMILY, IMAGE_COLUMN_QUALIFIER, new Value(imageBytes));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
index 341ac02..1153634 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
@@ -33,7 +33,7 @@ public class Commit extends Test {
     log.debug("Committed " + numWrites + " writes.  Total writes: " + totalWrites);
     
     state.set("totalWrites", totalWrites);
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
index 7ea2eb3..8b209b3 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
@@ -34,9 +34,9 @@ public class MultiTableFixture extends Fixture {
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
     
     state.set("tableNamePrefix", String.format("multi_%s_%s_%d", hostname, state.getPid(),
System.currentTimeMillis()));
-    state.set("nextId", new Integer(0));
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
+    state.set("nextId", Integer.valueOf(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
     state.set("tableList", new ArrayList<String>());
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
index 685b05d..278635f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
@@ -188,7 +188,7 @@ public class SecurityHelper {
     try {
       fs = (FileSystem) state.get(filesystem);
     } catch (RuntimeException re) {}
-    ;
+
     if (fs == null) {
       try {
         fs = FileSystem.get(CachedConfiguration.getInstance());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 4bc072c..b3e693c 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -431,7 +431,7 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor,
Au
     try {
       fs = (FileSystem) state.get(filesystem);
     } catch (RuntimeException re) {}
-    ;
+
     if (fs == null) {
       try {
         fs = FileSystem.get(CachedConfiguration.getInstance());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
index 77e1cd5..04da64d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
@@ -61,7 +61,7 @@ public class BatchVerify extends Test {
         if (rangeEnd > (numWrites - 1)) {
           rangeEnd = numWrites - 1;
         }
-        count += (rangeEnd - rangeStart) + 1;
+        count += rangeEnd - rangeStart + 1;
         ranges.add(new Range(new Text(String.format("%010d", rangeStart)), new Text(String.format("%010d",
rangeEnd))));
       }
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
index 8abfb39..cd1ccab 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
@@ -29,7 +29,7 @@ public class Commit extends Test {
     state.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
index 22a7371..1af150f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
@@ -60,7 +60,7 @@ public class MapRedVerifyTool extends Configured implements Tool {
       int index = start;
       while (iterator.hasNext()) {
         int next = iterator.next().get();
-        if (next != (index + 1)) {
+        if (next != index + 1) {
           writeMutation(output, start, index);
           start = next;
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
index 2a5cfa1..927a803 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
@@ -51,8 +51,8 @@ public class SequentialFixture extends Fixture {
     }
     conn.tableOperations().setProperty(seqTableName, "table.scan.max.memory", "1K");
     
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
index 671055b..aa55276 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
@@ -35,7 +35,7 @@ public class Write extends Test {
     state.set("numWrites", state.getLong("numWrites") + 1);
     
     Long totalWrites = state.getLong("totalWrites") + 1;
-    if ((totalWrites % 10000) == 0) {
+    if (totalWrites % 10000 == 0) {
       log.debug("Total writes: " + totalWrites);
     }
     state.set("totalWrites", totalWrites);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
index 0331552..c725e3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
@@ -102,7 +102,7 @@ public class BulkInsert extends Test {
     
     int minInsert = Integer.parseInt(props.getProperty("minInsert"));
     int maxInsert = Integer.parseInt(props.getProperty("maxInsert"));
-    int numToInsert = rand.nextInt((maxInsert - minInsert)) + minInsert;
+    int numToInsert = rand.nextInt(maxInsert - minInsert) + minInsert;
     
     int maxSplits = Integer.parseInt(props.getProperty("maxSplits"));
     
@@ -121,7 +121,7 @@ public class BulkInsert extends Test {
       log.debug("Bulk inserting document " + docID);
     }
     
-    state.set("nextDocID", new Long(nextDocID));
+    state.set("nextDocID", Long.valueOf(nextDocID));
     
     dataWriter.close();
     indexWriter.close();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
index 672dd2e..8e81acb 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
@@ -50,7 +50,7 @@ public class Insert extends Test {
     
     log.debug("Inserted document " + docID);
     
-    state.set("nextDocID", new Long(nextDocID));
+    state.set("nextDocID", Long.valueOf(nextDocID));
   }
   
   static String insertRandomDocument(long did, BatchWriter dataWriter, BatchWriter indexWriter,
String indexTableName, String dataTableName, int numPartitions,

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index a54229f..f93ef9a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@ -35,7 +35,7 @@ public class ShardFixture extends Fixture {
   static SortedSet<Text> genSplits(long max, int numTablets, String format) {
     
     int numSplits = numTablets - 1;
-    long distance = (max / numTablets);
+    long distance = max / numTablets;
     long split = distance;
     
     TreeSet<Text> splits = new TreeSet<Text>();
@@ -78,7 +78,7 @@ public class ShardFixture extends Fixture {
     state.set("numPartitions", new Integer(numPartitions));
     state.set("cacheIndex", rand.nextDouble() < .5);
     state.set("rand", rand);
-    state.set("nextDocID", new Long(0));
+    state.set("nextDocID", Long.valueOf(0));
     
     Connector conn = state.getConnector();
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
index 0c598c0..8c3e371 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
@@ -22,7 +22,6 @@ import java.net.InetAddress;
 
 import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.util.CachedConfiguration;
-import org.apache.accumulo.test.scalability.ScaleTest;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
index c4dd42d..46377d6 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
@@ -57,7 +57,7 @@ public abstract class ScaleTest {
   
   protected void stopTimer(long numEntries, long numBytes) {
     long endTime = System.currentTimeMillis();
-    System.out.printf("ELAPSEDMS %d %d %d%n", (endTime - startTime), numEntries, numBytes);
+    System.out.printf("ELAPSEDMS %d %d %d%n", endTime - startTime, numEntries, numBytes);
   }
   
   public abstract void setup();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 05a8961..9dca7da 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -578,6 +578,12 @@ public class ConditionalWriterIT extends SimpleMacIT {
     cw.close();
   }
 
+  static long abs(long l) {
+    if (l < 0)
+      return -l;
+    return l;
+  }
+
   @Test(timeout = 60 * 1000)
   public void testBigBatch() throws Exception {
 
@@ -598,7 +604,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
     byte[] e = new byte[0];
 
     for (int i = 0; i < num; i++) {
-      rows.add(FastFormat.toZeroPaddedString(Math.abs(r.nextLong()), 16, 16, e));
+      rows.add(FastFormat.toZeroPaddedString(abs(r.nextLong()), 16, 16, e));
     }
 
     for (int i = 0; i < num; i++) {
@@ -891,7 +897,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
           for (ByteSequence row : changes) {
             scanner.setRange(new Range(row.toString()));
             Stats stats = new Stats(scanner.iterator());
-            stats.set(rand.nextInt(10), Math.abs(rand.nextInt()));
+            stats.set(rand.nextInt(10), rand.nextInt(Integer.MAX_VALUE));
             mutations.add(stats.toMutation());
           }
 
@@ -941,7 +947,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
     ArrayList<ByteSequence> rows = new ArrayList<ByteSequence>();
 
     for (int i = 0; i < 1000; i++) {
-      rows.add(new ArrayByteSequence(FastFormat.toZeroPaddedString(Math.abs(rand.nextLong()),
16, 16, new byte[0])));
+      rows.add(new ArrayByteSequence(FastFormat.toZeroPaddedString(abs(rand.nextLong()),
16, 16, new byte[0])));
     }
 
     ArrayList<ConditionalMutation> mutations = new ArrayList<ConditionalMutation>();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index 7873df4..167c07f 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -124,7 +124,7 @@ public class TableOperationsIT {
     List<DiskUsage> diskUsages = connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
     assertEquals(1, diskUsages.size());
     assertEquals(1, diskUsages.get(0).getTables().size());
-    assertEquals(new Long(0), diskUsages.get(0).getUsage());
+    assertEquals(Long.valueOf(0), diskUsages.get(0).getUsage());
     assertEquals(tableName, diskUsages.get(0).getTables().first());
 
     // add some data

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
index 2aaade0..5267174 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
@@ -22,7 +22,7 @@ import java.util.Map;
  * Base interface for gathering and reporting statistics about a block of execution.
  */
 public interface Span {
-  public static final long ROOT_SPAN_ID = 0;
+  static final long ROOT_SPAN_ID = 0;
   
   /** Begin gathering timing information */
   void start();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
index acf9e5c..dfed660 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.trace.instrument.receivers;
 
-import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Map;
@@ -28,7 +27,6 @@ import org.apache.log4j.Level;
  */
 public class LogSpans implements SpanReceiver {
   private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogSpans.class);
-  private static final DateFormat fmt = new SimpleDateFormat("HH:mm:ss.SSS");
   
   static public class SpanLevel extends Level {
     
@@ -51,7 +49,7 @@ public class LogSpans implements SpanReceiver {
     String parentStr = "";
     if (parentId > 0)
       parentStr = " parent:" + parentId;
-    String startStr = fmt.format(new Date(start));
+    String startStr = new SimpleDateFormat("HH:mm:ss.SSS").format(new Date(start));
     return String.format("%20s:%x id:%d%s start:%s ms:%d", description, traceId, spanId,
parentStr, startStr, stop - start);
   }
   


Mime
View raw message