accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [02/15] git commit: ACCUMULO-2715 Fix findbugs integer comparison warning in examples
Date Wed, 23 Apr 2014 15:05:35 GMT
ACCUMULO-2715 Fix findbugs integer comparison warning in examples


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

Branch: refs/heads/findbugs
Commit: 936d2e05cbb693f610f758011c087c3db5241d79
Parents: fc28c2a
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Tue Apr 22 12:40:12 2014 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Apr 23 10:31:06 2014 -0400

----------------------------------------------------------------------
 .../examples/simple/client/RandomBatchWriter.java         | 10 ++++------
 pom.xml                                                   |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/936d2e05/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
index 44947d1..ef3d691 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
@@ -124,12 +124,10 @@ public class RandomBatchWriter {
     Opts opts = new Opts();
     BatchWriterOpts bwOpts = new BatchWriterOpts();
     opts.parseArgs(RandomBatchWriter.class.getName(), args, bwOpts);
-    if ((opts.max - opts.min) < (long)opts.num) {
-      System.err
-          .println(String
-              .format(
-                  "You must specify a min and a max that allow for at least num possible
values. For example, you requested %d rows, but a min of %d and a max of %d (exclusive), which
only allows for %d rows.",
-                  opts.num, opts.min, opts.max, (opts.max - opts.min)));
+    if ((opts.max - opts.min) < 1L * opts.num) { // right-side multiplied by 1L to convert
to long in a way that doesn't trigger FindBugs
+      System.err.println(String.format("You must specify a min and a max that allow for at
least num possible values. "
+          + "For example, you requested %d rows, but a min of %d and a max of %d (exclusive),
which only allows for %d rows.", opts.num, opts.min, opts.max,
+          (opts.max - opts.min)));
       System.exit(1);
     }
     Random r;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/936d2e05/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2edb662..f709775 100644
--- a/pom.xml
+++ b/pom.xml
@@ -460,7 +460,7 @@
             <effort>Max</effort>
             <failOnError>true</failOnError>
             <includeTests>true</includeTests>
-            <maxRank>1</maxRank>
+            <maxRank>3</maxRank>
           </configuration>
         </plugin>
         <plugin>


Mime
View raw message