incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [3/8] git commit: Added a random uppercase generator.
Date Tue, 23 Jul 2013 18:58:40 GMT
Added a random uppercase generator.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/17aa07dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/17aa07dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/17aa07dc

Branch: refs/heads/master
Commit: 17aa07dc46995b6c5f99cc1f5af356eb84586482
Parents: bb8a82a
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Jul 23 13:11:02 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Jul 23 13:11:02 2013 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/blur/thrift/util/LoadData.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/17aa07dc/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
index e13908f..93ddce6 100644
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
@@ -119,7 +119,14 @@ public class LoadData {
   }
 
   private static String getWord() {
-    return words.get(random.nextInt(words.size()));
+    return makeUpperCaseRandomly(words.get(random.nextInt(words.size())),random);
+  }
+
+  private static String makeUpperCaseRandomly(String s, Random r) {
+    if (r.nextBoolean()) {
+      return s.substring(0, 1).toUpperCase() + s.substring(1);
+    }
+    return s;
   }
 
   protected static String getRowId() {


Mime
View raw message