gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [1/4] gora git commit: GORA-429 Implement Maven forbidden-apis plugin in Gora
Date Tue, 01 Sep 2015 20:44:19 GMT
Repository: gora
Updated Branches:
  refs/heads/master cfd1c52f3 -> 130257370


GORA-429 Implement Maven forbidden-apis plugin in Gora


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

Branch: refs/heads/master
Commit: a303ff796bff390cdf2368dbf2edfaeba33161f5
Parents: 08c48d9
Author: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Authored: Sat Aug 29 14:47:09 2015 -0700
Committer: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Committed: Sat Aug 29 14:47:09 2015 -0700

----------------------------------------------------------------------
 gora-accumulo/pom.xml                           |  2 +-
 .../gora/accumulo/store/AccumuloStore.java      |  4 +--
 .../gora/accumulo/util/HexEncoderTest.java      |  9 +++---
 .../gora/cassandra/store/CassandraStore.java    |  2 +-
 gora-compiler-cli/pom.xml                       | 11 ++++++-
 .../gora/compiler/cli/GoraCompilerCLI.java      | 20 +++++++-----
 gora-compiler/pom.xml                           | 18 ++++++++++-
 .../org/apache/gora/compiler/GoraCompiler.java  |  9 ++++--
 .../gora/compiler/utils/LicenseHeaders.java     |  8 ++---
 gora-core/pom.xml                               |  8 +++++
 .../gora/examples/WebPageDataCreator.java       |  3 +-
 .../gora/examples/mapreduce/QueryCounter.java   |  9 ++++--
 .../gora/examples/mapreduce/WordCount.java      |  3 +-
 .../apache/gora/mapreduce/GoraRecordReader.java |  3 +-
 .../apache/gora/mapreduce/GoraRecordWriter.java |  4 +--
 .../persistency/ws/impl/BeanFactoryWSImpl.java  |  1 -
 .../org/apache/gora/store/DataStoreFactory.java |  5 +--
 .../store/ws/impl/WSBackedDataStoreBase.java    |  3 +-
 .../gora/store/ws/impl/WSDataStoreFactory.java  |  3 +-
 .../java/org/apache/gora/util/ByteUtils.java    | 22 ++-----------
 .../java/org/apache/gora/util/TimingUtil.java   |  3 +-
 .../java/org/apache/gora/util/VersionInfo.java  | 13 +++++---
 .../persistency/impl/TestPersistentBase.java    |  5 +--
 .../apache/gora/store/DataStoreTestUtil.java    | 20 +++++++-----
 .../apache/gora/store/WSDataStoreTestBase.java  |  3 +-
 gora-goraci/pom.xml                             | 20 ++++++++++++
 .../java/org/apache/gora/goraci/Delete.java     |  9 ++++--
 .../java/org/apache/gora/goraci/Generator.java  | 14 ++++-----
 .../main/java/org/apache/gora/goraci/Loop.java  | 17 +++++-----
 .../main/java/org/apache/gora/goraci/Print.java | 11 +++++--
 .../java/org/apache/gora/goraci/Verify.java     | 13 +++++---
 .../java/org/apache/gora/goraci/Walker.java     | 18 ++++++-----
 .../rackspace/RackspaceOrchestration.java       |  6 ++--
 .../apache/gora/hbase/store/TestHBaseStore.java |  7 +++--
 .../gora/hbase/util/HBaseClusterSingleton.java  |  7 +++--
 .../gora/hbase/util/TestHBaseByteInterface.java |  3 +-
 .../apache/gora/mongodb/store/MongoMapping.java |  3 +-
 .../apache/gora/mongodb/store/MongoStore.java   |  2 +-
 .../gora/mongodb/store/TestMongoMapping.java    | 33 ++++++++++----------
 .../gora/mongodb/utils/TestBSONDecorator.java   | 13 ++++----
 .../org/apache/gora/solr/query/SolrResult.java  |  2 +-
 .../org/apache/gora/solr/store/SolrStore.java   | 24 +++++++-------
 .../apache/gora/tutorial/log/LogAnalytics.java  |  6 ++--
 .../apache/gora/tutorial/log/LogManager.java    | 31 ++++++++++--------
 pom.xml                                         | 33 ++++++++++++++++++--
 45 files changed, 290 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-accumulo/pom.xml
----------------------------------------------------------------------
diff --git a/gora-accumulo/pom.xml b/gora-accumulo/pom.xml
index 9c1b843..dd13ed9 100644
--- a/gora-accumulo/pom.xml
+++ b/gora-accumulo/pom.xml
@@ -122,7 +122,7 @@
     </dependency>
 
     <dependency>
-      <groupId>org.apache.commons</groupId>
+      <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
----------------------------------------------------------------------
diff --git a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
index 780178f..1333bb2 100644
--- a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
+++ b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
@@ -141,8 +141,7 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T
         } else {
           data = decoder.readBytes(null).array();
         }
-      } catch (IOException e) {
-        e.printStackTrace();
+      } catch (IOException e) {;
         throw new GoraException("Error decoding union type: ", e);
       }
     } else {
@@ -248,7 +247,6 @@ public class AccumuloStore<K,T extends PersistentBase> extends DataStoreBase<K,T
         avroEncoder.flush();
         return baos.toByteArray();
       } catch (IOException e) {
-        e.printStackTrace();
         return toBytes(o);
       }
     } else {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java
----------------------------------------------------------------------
diff --git a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java
index ebaf395..3da60bf 100644
--- a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java
+++ b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.gora.accumulo.util;
 
+import java.nio.charset.Charset;
 import org.apache.gora.accumulo.encoders.HexEncoder;
 import static org.junit.Assert.assertEquals;
 import org.junit.Test;
@@ -29,8 +30,8 @@ public class HexEncoderTest {
   public void testByte() {
     HexEncoder encoder = new HexEncoder();
     
-    assertEquals("12", new String(encoder.encodeByte((byte) 0x12)));
-    assertEquals("f2", new String(encoder.encodeByte((byte) 0xf2)));
+    assertEquals("12", new String(encoder.encodeByte((byte) 0x12), Charset.defaultCharset()));
+    assertEquals("f2", new String(encoder.encodeByte((byte) 0xf2), Charset.defaultCharset()));
     
     byte b = Byte.MIN_VALUE;
     while (b != Byte.MAX_VALUE) {
@@ -43,8 +44,8 @@ public class HexEncoderTest {
   public void testShort() {
     HexEncoder encoder = new HexEncoder();
     
-    assertEquals("1234", new String(encoder.encodeShort((short) 0x1234)));
-    assertEquals("f234", new String(encoder.encodeShort((short) 0xf234)));
+    assertEquals("1234", new String(encoder.encodeShort((short) 0x1234), Charset.defaultCharset()));
+    assertEquals("f234", new String(encoder.encodeShort((short) 0xf234), Charset.defaultCharset()));
     
     short s = Short.MIN_VALUE;
     while (s != Short.MAX_VALUE) {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
----------------------------------------------------------------------
diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
index dc4cf06..0e5bfbf 100644
--- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
+++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
@@ -342,7 +342,7 @@ public class CassandraStore<K, T extends PersistentBase> extends DataStoreBase<K
     try {
       hasResult = result.next();
     } catch (Exception e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
     return hasResult ? result.get() : null;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-compiler-cli/pom.xml
----------------------------------------------------------------------
diff --git a/gora-compiler-cli/pom.xml b/gora-compiler-cli/pom.xml
index 4f3f9ec..7fffa8d 100644
--- a/gora-compiler-cli/pom.xml
+++ b/gora-compiler-cli/pom.xml
@@ -57,9 +57,18 @@
       <artifactId>gora-compiler</artifactId>
       <groupId>org.apache.gora</groupId>
     </dependency>
+    <!-- Logging Dependencies -->
     <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
     </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-compiler-cli/src/main/java/org/apache/gora/compiler/cli/GoraCompilerCLI.java
----------------------------------------------------------------------
diff --git a/gora-compiler-cli/src/main/java/org/apache/gora/compiler/cli/GoraCompilerCLI.java b/gora-compiler-cli/src/main/java/org/apache/gora/compiler/cli/GoraCompilerCLI.java
index 1849228..6015192 100644
--- a/gora-compiler-cli/src/main/java/org/apache/gora/compiler/cli/GoraCompilerCLI.java
+++ b/gora-compiler-cli/src/main/java/org/apache/gora/compiler/cli/GoraCompilerCLI.java
@@ -23,22 +23,27 @@ import java.io.PrintStream;
 
 import org.apache.gora.compiler.GoraCompiler;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 public class GoraCompilerCLI {
 
+  private static final Logger LOG = LoggerFactory.getLogger(GoraCompilerCLI.class);
+
   public static void main(String[] args) {
     if(args.length == 1 && (args[0].equals("--help") || args[0].equals("-h"))){
       printHelp();
       System.exit(0);
     }
     if(args.length < 2){
-      System.err.println("Must supply at least one source file and an output directory.");
+      LOG.error("Must supply at least one source file and an output directory.");
       printHelp();
       System.exit(1);
     }
     File outputDir = new File(args[args.length-1]);
     if(!outputDir.isDirectory()){
-      System.err.println("Must supply a directory for output");
+      LOG.error("Must supply a directory for output");
       printHelp();
       System.exit(1);
     }
@@ -46,7 +51,7 @@ public class GoraCompilerCLI {
     for(int i  = 0; i<inputs.length; i++){
       File inputFile = new File(args[i]);
       if(!inputFile.isFile()){
-        System.err.println("Input must be a file.");
+        LOG.error("Input must be a file.");
         printHelp();
         System.exit(1);
       }
@@ -54,16 +59,15 @@ public class GoraCompilerCLI {
     }
     try {
       GoraCompiler.compileSchema(inputs, outputDir);
-      System.out.println("Compiler executed SUCCESSFULL.");
+      LOG.info("Compiler executed SUCCESSFULL.");
     } catch (IOException e) {
-      System.err.println("Error while compiling schema files. Check that the schemas are properly formatted.");
+      LOG.error("Error while compiling schema files. Check that the schemas are properly formatted.");
       printHelp();
-      e.printStackTrace(System.err);
+      throw new RuntimeException(e);
     }
   }
 
   private static void printHelp() {
-    PrintStream out = System.out;
-    out.println("Usage: gora-compiler ( -h | --help ) | (<input> [<input>...] <output>)");
+    LOG.info("Usage: gora-compiler ( -h | --help ) | (<input> [<input>...] <output>)");
   }
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-compiler/pom.xml
----------------------------------------------------------------------
diff --git a/gora-compiler/pom.xml b/gora-compiler/pom.xml
index b560f16..6e241be 100644
--- a/gora-compiler/pom.xml
+++ b/gora-compiler/pom.xml
@@ -96,6 +96,22 @@
       <groupId>org.apache.avro</groupId>
       <artifactId>avro-compiler</artifactId>
     </dependency>
+  
+
+    <!-- Logging Dependencies -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+    </dependency>
+    
   </dependencies>
 
-</project>
+  </project>

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
----------------------------------------------------------------------
diff --git a/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java b/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
index f0a04f4..16a6372 100644
--- a/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
+++ b/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
@@ -34,8 +34,13 @@ import org.apache.avro.compiler.specific.SpecificCompiler;
 import org.codehaus.jackson.JsonNode;
 import org.codehaus.jackson.node.JsonNodeFactory;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class GoraCompiler extends SpecificCompiler {
 
+  private static final Logger LOG = LoggerFactory.getLogger(GoraCompiler.class);
+
   public static String DIRTY_BYTES_FIELD_NAME = "__g__dirty";
   public static final int FIRST_UNMANAGED_FIELD_INDEX = 1;
 
@@ -56,7 +61,7 @@ public class GoraCompiler extends SpecificCompiler {
     Schema.Parser parser = new Schema.Parser();
 
     for (File src : srcFiles) {
-      System.out.println("Compiling: " + src.getAbsolutePath());
+      LOG.info("Compiling: {}", src.getAbsolutePath());
       Schema originalSchema = parser.parse(src);
       Map<Schema,Schema> queue = new HashMap<Schema,Schema>();
       //Schema newSchema = getSchemaWithDirtySupport(originalSchema, queue);
@@ -64,7 +69,7 @@ public class GoraCompiler extends SpecificCompiler {
       GoraCompiler compiler = new GoraCompiler(newSchema);
       compiler.setTemplateDir("/org/apache/gora/compiler/templates/");
       compiler.compileToDestination(src, dest);
-      System.out.println("Compiled into: " + dest.getAbsolutePath());
+      LOG.info("Compiled into: {}", dest.getAbsolutePath());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-compiler/src/main/java/org/apache/gora/compiler/utils/LicenseHeaders.java
----------------------------------------------------------------------
diff --git a/gora-compiler/src/main/java/org/apache/gora/compiler/utils/LicenseHeaders.java b/gora-compiler/src/main/java/org/apache/gora/compiler/utils/LicenseHeaders.java
index ff94220..b573346 100644
--- a/gora-compiler/src/main/java/org/apache/gora/compiler/utils/LicenseHeaders.java
+++ b/gora-compiler/src/main/java/org/apache/gora/compiler/utils/LicenseHeaders.java
@@ -230,13 +230,13 @@ public class LicenseHeaders {
           relatedLicenses.put(licenseValue,var);
         }
     } catch (SecurityException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     } catch (NoSuchFieldException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     } catch (IllegalArgumentException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     } catch (IllegalAccessException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/pom.xml
----------------------------------------------------------------------
diff --git a/gora-core/pom.xml b/gora-core/pom.xml
index eab5330..b423887 100644
--- a/gora-core/pom.xml
+++ b/gora-core/pom.xml
@@ -143,6 +143,14 @@
 
     <!-- Logging Dependencies -->
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <exclusions>

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
----------------------------------------------------------------------
diff --git a/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java b/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
index b41ef2d..201bdde 100644
--- a/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
+++ b/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
@@ -20,6 +20,7 @@ package org.apache.gora.examples;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -121,7 +122,7 @@ public class WebPageDataCreator {
         page.setUrl(new Utf8(URLS[i]));
         page.setParsedContent(new ArrayList<CharSequence>());
         if (CONTENTS[i]!=null){
-          page.setContent(ByteBuffer.wrap(CONTENTS[i].getBytes()));
+          page.setContent(ByteBuffer.wrap(CONTENTS[i].getBytes(Charset.defaultCharset())));
           for(String token : CONTENTS[i].split(" ")) {
             page.getParsedContent().add(new Utf8(token));  
           }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java
----------------------------------------------------------------------
diff --git a/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java b/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java
index 0f8f50f..50e6902 100644
--- a/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java
+++ b/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java
@@ -34,11 +34,16 @@ import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.gora.util.ClassLoadingUtils;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Example Hadoop job to count the row of a gora {@link Query}.
  */
 public class QueryCounter<K, T extends Persistent> extends Configured implements Tool {
 
+  private static final Logger LOG = LoggerFactory.getLogger(QueryCounter.class);
+
   public static final String COUNTER_GROUP = "QueryCounter";
   public static final String ROWS = "ROWS";
 
@@ -118,7 +123,7 @@ public class QueryCounter<K, T extends Persistent> extends Configured implements
   public int run(String[] args) throws Exception {
 
     if(args.length < 2) {
-      System.err.println("Usage QueryCounter <keyClass> <persistentClass> [dataStoreClass]");
+      LOG.info("Usage QueryCounter <keyClass> <persistentClass> [dataStoreClass]");
       return 1;
     }
 
@@ -139,7 +144,7 @@ public class QueryCounter<K, T extends Persistent> extends Configured implements
 
     long results = countQuery(dataStore);
 
-    System.out.println("Number of result to the query:" + results);
+    LOG.info("Number of result to the query:" + results);
 
     return 0;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/WordCount.java
----------------------------------------------------------------------
diff --git a/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/WordCount.java b/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/WordCount.java
index 1609b7c..2aac4f6 100644
--- a/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/WordCount.java
+++ b/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/WordCount.java
@@ -19,6 +19,7 @@
 package org.apache.gora.examples.mapreduce;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.StringTokenizer;
 
 import org.apache.gora.examples.generated.TokenDatum;
@@ -67,7 +68,7 @@ public class WordCount extends Configured implements Tool {
       
       if (page.getContent() != null) {
         // Get the content from a WebPage as obtained from the DataStore
-        String content = new String(page.getContent().array());
+        String content = new String(page.getContent().array(), Charset.defaultCharset());
 
         StringTokenizer itr = new StringTokenizer(content);
         while (itr.hasMoreTokens()) {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordReader.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordReader.java b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordReader.java
index f7c1abb..c15ed2f 100644
--- a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordReader.java
+++ b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordReader.java
@@ -120,8 +120,7 @@ public class GoraRecordReader<K, T extends PersistentBase> extends RecordReader<
 	  }
 	  catch(Exception e){
 	    LOG.error("Error reading Gora records");
-	    e.printStackTrace();
-	    return false;
+	    throw new RuntimeException(e);
 	  }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordWriter.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordWriter.java b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordWriter.java
index b05f775..f23d5f8 100644
--- a/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordWriter.java
+++ b/gora-core/src/main/java/org/apache/gora/mapreduce/GoraRecordWriter.java
@@ -57,7 +57,7 @@ public class GoraRecordWriter<K, T> extends RecordWriter<K, T> {
     }catch(Exception e){
       LOG.warn("Exception at GoraRecordWriter.class while closing datastore." + e.getMessage());
       LOG.warn("Trace: " + e.getStackTrace());
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
   }
 
@@ -73,7 +73,7 @@ public class GoraRecordWriter<K, T> extends RecordWriter<K, T> {
     }catch(Exception e){
       LOG.warn("Exception at GoraRecordWriter.class while writing to datastore. " + e.getMessage());
       LOG.warn("Trace: " + e.getStackTrace());
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java b/gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java
index b150ff4..56df668 100644
--- a/gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java
+++ b/gora-core/src/main/java/org/apache/gora/persistency/ws/impl/BeanFactoryWSImpl.java
@@ -109,7 +109,6 @@ public class BeanFactoryWSImpl<K, T extends Persistent> implements BeanFactory<K
     } catch (InstantiationException e) {
       throw new RuntimeException(e);
     } catch (IllegalAccessException e) {
-      e.printStackTrace();
       throw new RuntimeException(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java b/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java
index b1d9c75..e11327a 100644
--- a/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java
+++ b/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java
@@ -20,6 +20,7 @@ package org.apache.gora.store;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
+import java.util.Locale;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.gora.persistency.Persistent;
@@ -291,7 +292,7 @@ public class DataStoreFactory{
     //recursively try the class names until the base class
     Class<?> clazz = store.getClass();
     while(true) {
-      String fullKey = GORA + "." + org.apache.gora.util.StringUtils.getClassname(clazz).toLowerCase() + "." + baseKey;
+      String fullKey = GORA + "." + org.apache.gora.util.StringUtils.getClassname(clazz).toLowerCase(Locale.getDefault()) + "." + baseKey;
       String value = getProperty(properties, fullKey);
       if(value != null) {
         return value;
@@ -395,7 +396,7 @@ public class DataStoreFactory{
     if (!key.matches(regex)) {
       log.warn("Keys should be LOWERCASE. Please change that!");
       log.warn("Using lowecase for key " + key);
-      key = key.toLowerCase();
+      key = key.toLowerCase(Locale.getDefault());
     }
     String result = properties.getProperty(key);
     if (result == null) {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java
index ac01283..7cd93b9 100644
--- a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java
+++ b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSBackedDataStoreBase.java
@@ -51,8 +51,7 @@ public abstract class WSBackedDataStoreBase<K, T extends Persistent>
     try {
       return executeQuery(query);
     } catch (IOException e) {
-      e.printStackTrace();
-      return null;
+      throw new RuntimeException(e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java
index d59a8f5..a3d6ab2 100644
--- a/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java
+++ b/gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java
@@ -19,6 +19,7 @@ package org.apache.gora.store.ws.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Locale;
 import java.util.Properties;
 
 import org.slf4j.Logger;
@@ -301,7 +302,7 @@ public class WSDataStoreFactory{
         return value;
       }
       //try once with lowercase
-      value = getProperty(properties, fullKey.toLowerCase());
+      value = getProperty(properties, fullKey.toLowerCase(Locale.getDefault()));
       if(value != null) {
         return value;
       }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/util/ByteUtils.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/util/ByteUtils.java b/gora-core/src/main/java/org/apache/gora/util/ByteUtils.java
index 8d04b8b..5acabc4 100644
--- a/gora-core/src/main/java/org/apache/gora/util/ByteUtils.java
+++ b/gora-core/src/main/java/org/apache/gora/util/ByteUtils.java
@@ -1,22 +1,4 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Copyright 2009 The Apache Software Foundation
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -169,7 +151,7 @@ public class ByteUtils {
     try {
       result = new String(b, off, len, "UTF-8");
     } catch (UnsupportedEncodingException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
     return result;
   }
@@ -186,7 +168,7 @@ public class ByteUtils {
     try {
       result = s.getBytes("UTF-8");
     } catch (UnsupportedEncodingException e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
     return result;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/util/TimingUtil.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/util/TimingUtil.java b/gora-core/src/main/java/org/apache/gora/util/TimingUtil.java
index cebdee9..8e14d42 100644
--- a/gora-core/src/main/java/org/apache/gora/util/TimingUtil.java
+++ b/gora-core/src/main/java/org/apache/gora/util/TimingUtil.java
@@ -18,6 +18,7 @@
 package org.apache.gora.util;
 
 import java.text.NumberFormat;
+import java.util.Locale;
 
 public class TimingUtil {
 
@@ -41,7 +42,7 @@ public class TimingUtil {
             start += TIME_FACTOR[i] * elapsedTime[i];
         }
 
-        NumberFormat nf = NumberFormat.getInstance();
+        NumberFormat nf = NumberFormat.getInstance(Locale.getDefault());
         nf.setMinimumIntegerDigits(2);
         StringBuffer buf = new StringBuffer();
         for (int i = 0; i < elapsedTime.length; i++) {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/main/java/org/apache/gora/util/VersionInfo.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/util/VersionInfo.java b/gora-core/src/main/java/org/apache/gora/util/VersionInfo.java
index 4fa12c7..71285c5 100644
--- a/gora-core/src/main/java/org/apache/gora/util/VersionInfo.java
+++ b/gora-core/src/main/java/org/apache/gora/util/VersionInfo.java
@@ -20,11 +20,16 @@ package org.apache.gora.util;
 
 import org.apache.gora.GoraVersionAnnotation;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * This class finds the package info for Gora and the GoraVersionAnnotation
  * information.
  */
 public class VersionInfo {
+
+  private static final Logger LOG = LoggerFactory.getLogger(VersionInfo.class);
   private static Package myPackage;
   private static GoraVersionAnnotation version;
   
@@ -100,10 +105,10 @@ public class VersionInfo {
   }
   
   public static void main(String[] args) {
-    System.out.println("Gora " + getVersion());
-    System.out.println("Subversion " + getUrl() + " -r " + getRevision());
-    System.out.println("Compiled by " + getUser() + " on " + getDate());
-    System.out.println("From source with checksum " + getSrcChecksum());
+    LOG.info("Gora " + getVersion());
+    LOG.info("Subversion " + getUrl() + " -r " + getRevision());
+    LOG.info("Compiled by " + getUser() + " on " + getDate());
+    LOG.info("From source with checksum " + getSrcChecksum());
 
   }
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
index 74337e4..af62116 100644
--- a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
+++ b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
@@ -20,6 +20,7 @@ package org.apache.gora.persistency.impl;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.List;
 import org.apache.avro.Schema.Field;
 import org.apache.avro.util.Utf8;
@@ -115,7 +116,7 @@ public class TestPersistentBase {
     page.setUrl(new Utf8("http://foo.com"));
     page.getParsedContent().add(new Utf8("foo"));
     page.getOutlinks().put(new Utf8("foo"), new Utf8("bar"));
-    page.setContent(ByteBuffer.wrap("foo baz bar".getBytes()));
+    page.setContent(ByteBuffer.wrap("foo baz bar".getBytes(Charset.defaultCharset())));
     
     page.clear();
     
@@ -128,7 +129,7 @@ public class TestPersistentBase {
     page.setUrl(new Utf8("http://bar.com"));
     page.getParsedContent().add(new Utf8("bar"));
     page.getOutlinks().put(new Utf8("bar"), new Utf8("baz"));
-    page.setContent(ByteBuffer.wrap("foo baz bar barbaz".getBytes()));
+    page.setContent(ByteBuffer.wrap("foo baz bar barbaz".getBytes(Charset.defaultCharset())));
     
     //test clear new object
     page = WebPage.newBuilder().build();

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
index 7a39d17..4513393 100644
--- a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
+++ b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
@@ -28,6 +28,7 @@ import static org.apache.gora.examples.WebPageDataCreator.createWebPageData;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -57,6 +58,9 @@ import org.apache.gora.util.AvroUtils;
 import org.apache.gora.util.ByteUtils;
 import org.apache.gora.util.StringUtils;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Test utilities for DataStores. This utility class provides everything
  * necessary for convenience tests in {@link DataStoreTestBase} to execute cleanly.
@@ -70,6 +74,8 @@ import org.apache.gora.util.StringUtils;
  */
 public class DataStoreTestUtil {
 
+  private static final Logger LOG = LoggerFactory.getLogger(DataStoreTestUtil.class);
+
   public static final long YEAR_IN_MS = 365L * 24L * 60L * 60L * 1000L;
   private static final int NUM_KEYS = 4;
 
@@ -100,7 +106,7 @@ public class DataStoreTestUtil {
   private static <K> WebPage createWebPage(DataStore<K, Employee> dataStore) {
     WebPage webpage = WebPage.newBuilder().build();
     webpage.setUrl(new Utf8("url.."));
-    webpage.setContent(ByteBuffer.wrap("test content".getBytes()));
+    webpage.setContent(ByteBuffer.wrap("test content".getBytes(Charset.defaultCharset())));
     webpage.setParsedContent(new ArrayList<CharSequence>());
     Metadata metadata = Metadata.newBuilder().build();
     webpage.setMetadata(metadata);
@@ -212,7 +218,7 @@ public class DataStoreTestUtil {
     WebPage webpage = new BeanFactoryImpl<String,WebPage>(String.class,WebPage.class).newPersistent() ;
     
     webpage.setUrl(new Utf8("url..")) ;
-    webpage.setContent(ByteBuffer.wrap("test content".getBytes())) ;
+    webpage.setContent(ByteBuffer.wrap("test content".getBytes(Charset.defaultCharset()))) ;
     webpage.setParsedContent(new ArrayList<CharSequence>());
     Metadata metadata = new BeanFactoryImpl<String,Metadata>(String.class,Metadata.class).newPersistent();
     webpage.setMetadata(metadata) ;
@@ -708,10 +714,10 @@ public class DataStoreTestUtil {
     assertEquals(URLS[i], page.getUrl().toString());
     // 'content' is optional
     if (page.getContent() != null) {
-      assertTrue("content error:" + new String( toByteArray(page.getContent()) ) +
+      assertTrue("content error:" + new String( toByteArray(page.getContent()), Charset.defaultCharset() ) +
         " actual=" + CONTENTS[i] + " i=" + i
         , Arrays.equals( toByteArray(page.getContent() )
-        , CONTENTS[i].getBytes()));
+        , CONTENTS[i].getBytes(Charset.defaultCharset())));
     
       List<CharSequence> parsedContent = page.getParsedContent();
       assertNotNull(parsedContent);
@@ -1053,8 +1059,8 @@ public class DataStoreTestUtil {
           + "not only removes the data but also the data structure.", 0, page.getOutlinks().size());
       assertEquals(0, page.getParsedContent().size());
       if(page.getContent() != null) {
-        System.out.println("url:" + page.getUrl().toString());
-        System.out.println( "limit:" + page.getContent().limit());
+        LOG.info("url:" + page.getUrl().toString());
+        LOG.info( "limit:" + page.getContent().limit());
       } else {
         assertNull(page.getContent());
       }
@@ -1146,7 +1152,7 @@ public class DataStoreTestUtil {
     store.createSchema();
     WebPage page = WebPage.newBuilder().build();
     page.setUrl(new Utf8("http://example.com"));
-    byte[] contentBytes = "example content in example.com".getBytes();
+    byte[] contentBytes = "example content in example.com".getBytes(Charset.defaultCharset());
     ByteBuffer buff = ByteBuffer.wrap(contentBytes);
     page.setContent(buff);
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java b/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java
index 0414aa7..475df09 100644
--- a/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java
+++ b/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java
@@ -19,6 +19,7 @@
 package org.apache.gora.store;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 
 import org.junit.BeforeClass;
 import org.junit.Before;
@@ -188,7 +189,7 @@ public abstract class WSDataStoreTestBase<K, T extends Persistent> {
   @Test
   public void testPutBytes() throws IOException, Exception {
     log.info("test method: testPutBytes");
-    byte[] contentBytes = "example content in example.com".getBytes();
+    byte[] contentBytes = "example content in example.com".getBytes(Charset.defaultCharset());
 
     assertPutBytes(contentBytes);
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/pom.xml
----------------------------------------------------------------------
diff --git a/gora-goraci/pom.xml b/gora-goraci/pom.xml
index 6f94437..0ed3d50 100644
--- a/gora-goraci/pom.xml
+++ b/gora-goraci/pom.xml
@@ -382,6 +382,26 @@
       <version>${jclouds.version}</version>
     </dependency>
 
+    <!-- Logging Dependencies -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.jms</groupId>
+          <artifactId>jms</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
   </dependencies>
 
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Delete.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Delete.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Delete.java
index 9884f64..35ea294 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Delete.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Delete.java
@@ -27,14 +27,19 @@ import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A stand alone program that deletes a single node.
  */
 public class Delete extends Configured implements Tool {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Delete.class);
   
   public int run(String[] args) throws Exception {
     if (args.length != 1) {
-      System.out.println("Usage : " + Delete.class.getSimpleName() + " <node to delete>");
+      LOG.info("Usage : {} <node to delete>", Delete.class.getSimpleName());
       return 0;
     }
     
@@ -43,7 +48,7 @@ public class Delete extends Configured implements Tool {
     boolean ret = store.delete(new BigInteger(args[0], 16).longValue());
     store.flush();
     
-    System.out.println("Delete returned " + ret);
+    LOG.info("Delete returned {}", ret);
     
     store.close();
 

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
index 53e58c6..e3b86cd 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
@@ -33,8 +33,6 @@ import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.gora.store.DataStore;
 import org.apache.gora.store.DataStoreFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -53,12 +51,15 @@ import org.apache.hadoop.mapreduce.lib.output.NullOutputFormat;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A Map only job that generates random linked list and stores them using Gora.
  */
 public class Generator extends Configured implements Tool {
   
-  private static final Log LOG = LogFactory.getLog(Generator.class);
+  private static final Logger LOG = LoggerFactory.getLogger(Generator.class);
   
   static final int WIDTH = 1000000;
   static final int WRAP = WIDTH * 25;
@@ -189,7 +190,7 @@ public class Generator extends Configured implements Tool {
     @Override
     protected void map(LongWritable key, NullWritable value, Context output) throws IOException {
       long num = key.get();
-      System.out.println("num" + num);
+      LOG.info("num {}", num);
       
       Utf8 id = new Utf8(UUID.randomUUID().toString());
       
@@ -304,8 +305,7 @@ public class Generator extends Configured implements Tool {
         throw new ParseException("Did not see expected # of arguments, saw " + cmd.getArgs().length);
       }
     } catch (ParseException e) {
-      System.err.println("Failed to parse command line " + e.getMessage());
-      System.err.println();
+      LOG.error("Failed to parse command line {}", e.getMessage());
       HelpFormatter formatter = new HelpFormatter();
       formatter.printHelp(getClass().getSimpleName() + " <num mappers> <num nodes per map>", options);
       System.exit(-1);
@@ -317,7 +317,7 @@ public class Generator extends Configured implements Tool {
   }
 
   public int run(int numMappers, long numNodes, boolean concurrent) throws Exception {
-    LOG.info("Running Generator with numMappers=" + numMappers +", numNodes=" + numNodes);
+    LOG.info("Running Generator with numMappers={}, numNodes={}", numMappers, numNodes);
     
     Job job = new Job(getConf());
     

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Loop.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Loop.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Loop.java
index 29c4812..cbddb43 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Loop.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Loop.java
@@ -20,26 +20,28 @@ package org.apache.gora.goraci;
 
 import java.util.Arrays;
 import java.util.UUID;
+import java.util.Locale;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /** 
  * Executes Generate and Verify in a loop. Data is not cleaned between runs, so each iteration
  * adds more data.
  */
 public class Loop extends Configured implements Tool {
 
-  private static final Log LOG = LogFactory.getLog(Loop.class); 
+  private static final Logger LOG = LoggerFactory.getLogger(Loop.class); 
   
   protected void runGenerator(int numMappers, long numNodes, boolean concurrent) throws Exception {
     Generator generator = new Generator();
@@ -67,7 +69,7 @@ public class Loop extends Configured implements Tool {
       throw new RuntimeException("Verify.verify failed");
     }
     
-    LOG.info("Verify finished with succees. Total nodes=" + expectedNumNodes);
+    LOG.info("Verify finished with succees. Total nodes={}", expectedNumNodes);
   }
 
   protected Verify startVerify(String outputDir, int numReducers, boolean concurrent) throws Exception {
@@ -95,8 +97,7 @@ public class Loop extends Configured implements Tool {
         throw new ParseException("Did not see expected # of arguments, saw " + cmd.getArgs().length);
       }
     } catch (ParseException e) {
-      System.err.println("Failed to parse command line " + e.getMessage());
-      System.err.println();
+      LOG.error("Failed to parse command line {}", e.getMessage());
       HelpFormatter formatter = new HelpFormatter();
       formatter.printHelp(getClass().getSimpleName() + " <num iterations> <num mappers> <num nodes per mapper> <output dir> <num reducers>", options);
       System.exit(-1);
@@ -112,7 +113,7 @@ public class Loop extends Configured implements Tool {
     int numReducers = Integer.parseInt(cmd.getArgs()[4]);
     
     if (numNodes % Generator.WRAP != 0) {
-      throw new RuntimeException("Number of node per mapper is not a multiple of " + String.format("%,d", Generator.WRAP));
+      throw new RuntimeException("Number of node per mapper is not a multiple of " + String.format(Locale.getDefault(), "%,d", Generator.WRAP));
     }
 
     long expectedNumNodes = 0;
@@ -125,7 +126,7 @@ public class Loop extends Configured implements Tool {
     long verifyNodes = 0;
 
     for (int i=0; i < numIterations; i++) {
-      LOG.info("Starting iteration = " + i);
+      LOG.info("Starting iteration = {}", i);
       runGenerator(numMappers, numNodes, concurrent);
       expectedNumNodes += numMappers * numNodes;
       

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Print.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Print.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Print.java
index cc940e3..372c1fc 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Print.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Print.java
@@ -34,10 +34,15 @@ import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A stand alone program that prints out portions of a list created by {@link Generator}
  */
 public class Print extends Configured implements Tool {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Print.class);
   
   public int run(String[] args) throws Exception {
     Options options = new Options();
@@ -53,8 +58,7 @@ public class Print extends Configured implements Tool {
         throw new ParseException("Command takes no arguments");
       }
     } catch (ParseException e) {
-      System.err.println("Failed to parse command line " + e.getMessage());
-      System.err.println();
+      LOG.error("Failed to parse command line " + e.getMessage());
       HelpFormatter formatter = new HelpFormatter();
       formatter.printHelp(getClass().getSimpleName(), options);
       System.exit(-1);
@@ -79,7 +83,8 @@ public class Print extends Configured implements Tool {
 
     while (rs.next()) {
       CINode node = rs.get();
-      System.out.printf("%016x:%016x:%012d:%s\n", rs.getKey(), node.getPrev(), node.getCount(), node.getClient());
+      LOG.info("%016x:%016x:%012d:%s\n {} {} {} {}", new Object[] {rs.getKey(), 
+        node.getPrev(), node.getCount(), node.getClient()});
 
     }
     

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
index 7a449c6..83271a4 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
@@ -22,6 +22,7 @@ import org.apache.gora.goraci.generated.Flushed;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.avro.util.Utf8;
@@ -51,13 +52,16 @@ import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A Map Reduce job that verifies that the linked list generated by {@link org.apache.gora.goraci.Generator} do not have any holes.
  */
 public class Verify extends Configured implements Tool {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Verify.class);
   
-  private static final Log LOG = LogFactory.getLog(Verify.class);
   private static final VLongWritable DEF = new VLongWritable(-1);
   
   private Job job;
@@ -135,10 +139,10 @@ public class Verify extends Configured implements Tool {
         for (Long ref : refs) {
           sb.append(comma);
           comma = ",";
-          sb.append(String.format("%016x", ref));
+          sb.append(String.format(Locale.getDefault(), "%016x", ref));
         }
         
-        context.write(new Text(String.format("%016x", key.get())), new Text(sb.toString()));
+        context.write(new Text(String.format(Locale.getDefault(), "%016x", key.get())), new Text(sb.toString()));
         context.getCounter(Counts.UNDEFINED).increment(1);
         
       } else if (defCount > 0 && refs.size() == 0) {
@@ -166,8 +170,7 @@ public class Verify extends Configured implements Tool {
         throw new ParseException("Did not see expected # of arguments, saw " + cmd.getArgs().length);
       }
     } catch (ParseException e) {
-      System.err.println("Failed to parse command line " + e.getMessage());
-      System.err.println();
+      LOG.error("Failed to parse command line " + e.getMessage());
       HelpFormatter formatter = new HelpFormatter();
       formatter.printHelp(getClass().getSimpleName() + " <output dir> <num reducers>", options);
       System.exit(-1);

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/Walker.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Walker.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Walker.java
index d0e0165..d6a0bad 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Walker.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Walker.java
@@ -35,10 +35,15 @@ import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A stand alone program that follows a linked list created by {@link Generator} and prints timing info.
  */
 public class Walker extends Configured implements Tool {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Walker.class);
   
   private static final String[] PREV_FIELD = new String[] {"prev"};
 
@@ -54,8 +59,7 @@ public class Walker extends Configured implements Tool {
         throw new ParseException("Command takes no arguments");
       }
     } catch (ParseException e) {
-      System.err.println("Failed to parse command line " + e.getMessage());
-      System.err.println();
+      LOG.error("Failed to parse command line {}", e.getMessage());
       HelpFormatter formatter = new HelpFormatter();
       formatter.printHelp(getClass().getSimpleName(), options);
       System.exit(-1);
@@ -81,13 +85,13 @@ public class Walker extends Configured implements Tool {
         long t1 = System.currentTimeMillis();
         node = store.get(prev, PREV_FIELD);
         long t2 = System.currentTimeMillis();
-        System.out.printf("CQ %d %016x \n", t2 - t1, prev);
+        LOG.info("CQ %d %016x \n {}", new Object [] {t2 - t1, prev});
         numQueries++;
         
         t1 = System.currentTimeMillis();
         node = store.get(prev, PREV_FIELD);
         t2 = System.currentTimeMillis();
-        System.out.printf("HQ %d %016x \n", t2 - t1, prev);
+        LOG.info("HQ %d %016x \n {}", new Object [] {t2 - t1, prev});
         numQueries++;
 
       }
@@ -109,14 +113,14 @@ public class Walker extends Configured implements Tool {
     
     try {
       if (rs.next()) {
-        System.out.printf("FSR %d %016x\n", t2 - t1, rs.getKey());
+        LOG.info("FSR %d %016x\n {}", new Object[] {t2 - t1, rs.getKey()});
         return rs.get();
       }
     } catch (Exception e) {
-      e.printStackTrace();
+      throw new RuntimeException(e);
     }
     
-    System.out.println("FSR " + (t2 - t1));
+    LOG.info("FSR {}", new Object [] {(t2 - t1)});
     
     return null;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
----------------------------------------------------------------------
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java b/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
index b27baaa..338708a 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
@@ -77,7 +77,7 @@ public class RackspaceOrchestration<K> {
    * @throws InstantiationException 
    * @throws NoSuchElementException 
    */
-  public static void main(String[] args) throws NoSuchElementException, InstantiationException, IllegalAccessException {
+  public static void main(String[] args) throws NoSuchElementException, InstantiationException, IllegalAccessException, IOException {
     Properties properties = DataStoreFactory.createProps();
     String rsContinent = DataStoreFactory.findProperty(properties, MockDataStore.class.newInstance(), 
         RS_CONTINENT, "rackspace-cloudservers-us");
@@ -122,12 +122,12 @@ public class RackspaceOrchestration<K> {
         try {
           Files.write(keyPair.getPrivateKey(), keyPairFile, Charsets.UTF_8);
         } catch (IOException e) {
-          e.printStackTrace();
+          throw new IOException(e);
         }
         try {
           publicKey = Files.toString(keyPairFile, Charsets.UTF_8);
         } catch (IOException e) {
-          e.printStackTrace();
+          throw new IOException(e);
         }
         keyPairApi.createWithPublicKey("goraci-keypair", publicKey);
       }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
----------------------------------------------------------------------
diff --git a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
index 8dd319f..0564d43 100644
--- a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
+++ b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
@@ -35,6 +35,7 @@ import org.junit.Test;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.Arrays;
 
 import static org.junit.Assert.assertEquals;
@@ -140,12 +141,12 @@ public class TestHBaseStore extends DataStoreTestBase {
     // Test writing+reading an empty bytes field. FIELD in HBASE MUST 
     // become EMPTY (byte[0])
     page = webPageStore.get("com.example/http") ;
-    page.setContent(ByteBuffer.wrap("".getBytes())) ;
+    page.setContent(ByteBuffer.wrap("".getBytes(Charset.defaultCharset()))) ;
     webPageStore.put("com.example/http", page) ;
     webPageStore.close() ;
     webPageStore = testDriver.createDataStore(String.class, WebPage.class);
     page = webPageStore.get("com.example/http") ;
-    assertTrue(Arrays.equals("".getBytes(),page.getContent().array())) ;
+    assertTrue(Arrays.equals("".getBytes(Charset.defaultCharset()),page.getContent().array())) ;
     // Check directly with HBase
     table = new HTable(conf,"WebPage");
     get = new Get(Bytes.toBytes("com.example/http"));
@@ -167,7 +168,7 @@ public class TestHBaseStore extends DataStoreTestBase {
     
     // Write webpage data
     page.setUrl((CharSequence) new Utf8("http://example.com"));
-    byte[] contentBytes = "example content in example.com".getBytes();
+    byte[] contentBytes = "example content in example.com".getBytes(Charset.defaultCharset());
     ByteBuffer buff = ByteBuffer.wrap(contentBytes);
     page.setContent(buff);
     webPageStore.put("com.example/http", page);

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java
----------------------------------------------------------------------
diff --git a/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java b/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java
index d9888be..9de2dc2 100644
--- a/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java
+++ b/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java
@@ -20,6 +20,7 @@ package org.apache.gora.hbase.util;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.charset.Charset;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
@@ -64,7 +65,7 @@ public final class HBaseClusterSingleton {
     // 0777 & ~umask, and use that to set the config value.
     try {
       Process process = Runtime.getRuntime().exec("/bin/sh -c umask");
-      BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
+      BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream(), Charset.defaultCharset()));
       int rc = process.waitFor();
       if(rc == 0) {
         String umask = br.readLine();
@@ -73,14 +74,14 @@ public final class HBaseClusterSingleton {
         int permBits = 0777 & ~umaskBits;
         String perms = Integer.toString(permBits, 8);
 
-        LOG.info("Setting dfs.datanode.data.dir.perm to " + perms);
+        LOG.info("Setting dfs.datanode.data.dir.perm to {}",  perms);
         htu.getConfiguration().set("dfs.datanode.data.dir.perm", perms);
       } else {
         LOG.warn("Failed running umask command in a shell, nonzero return value");
       }
     } catch (Exception e) {
       // ignore errors, we might not be running on POSIX, or "sh" might not be on the path
-      LOG.warn("Couldn't get umask", e);
+      LOG.warn("Couldn't get umask {}", e);
     }
 
     htu.getConfiguration().setBoolean("dfs.support.append", true);

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java
----------------------------------------------------------------------
diff --git a/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java b/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java
index 1fcbc69..834fdd3 100644
--- a/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java
+++ b/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java
@@ -101,9 +101,8 @@ public class TestHBaseByteInterface {
             // everything ok, return 0
             return 0;
           } catch (Exception e) {
-            e.printStackTrace();
+            throw new RuntimeException(e);
             // this will fail the test
-            return 1;
           }
         }
       });

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoMapping.java
----------------------------------------------------------------------
diff --git a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoMapping.java b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoMapping.java
index 06162b1..7f754ff 100644
--- a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoMapping.java
+++ b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoMapping.java
@@ -20,6 +20,7 @@ package org.apache.gora.mongodb.store;
 import static org.apache.gora.mongodb.store.MongoMapping.DocumentFieldType.*;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.regex.Pattern;
 
 import org.slf4j.Logger;
@@ -165,7 +166,7 @@ public class MongoMapping {
       String docFieldName, String fieldType) {
     try {
       // Register a new field for the mongo document
-      newDocumentField(docFieldName, valueOf(fieldType.toUpperCase()));
+      newDocumentField(docFieldName, valueOf(fieldType.toUpperCase(Locale.getDefault())));
     } catch (final IllegalArgumentException e) {
       throw new IllegalStateException("Declared '" + fieldType
           + "' for class field '" + classFieldName

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java
----------------------------------------------------------------------
diff --git a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java
index 6794e70..ebaf010 100644
--- a/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java
+++ b/gora-mongodb/src/main/java/org/apache/gora/mongodb/store/MongoStore.java
@@ -649,7 +649,7 @@ public class MongoStore<K, T extends PersistentBase> extends
     } else if (storeType == DocumentFieldType.DATE) {
       Object bin = easybson.get(docf);
       if (bin instanceof Date) {
-        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.getDefault());
         calendar.setTime((Date) bin);
         result = new Utf8(DatatypeConverter.printDateTime(calendar));
       } else {

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoMapping.java
----------------------------------------------------------------------
diff --git a/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoMapping.java b/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoMapping.java
index e6f4fb6..df6dc03 100644
--- a/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoMapping.java
+++ b/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoMapping.java
@@ -17,6 +17,7 @@
  */
 package org.apache.gora.mongodb.store;
 
+import java.util.Locale;
 import static org.junit.Assert.assertEquals;
 
 import org.apache.gora.mongodb.store.MongoMapping.DocumentFieldType;
@@ -32,58 +33,58 @@ public class TestMongoMapping {
     MongoMapping mapping = new MongoMapping();
     // Add fields of type binary
     mapping.addClassField("test", "classBin1", "topLevel1",
-        DocumentFieldType.BINARY.toString().toLowerCase());
+        DocumentFieldType.BINARY.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classBin2", "topLevel2",
-        DocumentFieldType.BINARY.toString().toUpperCase());
+        DocumentFieldType.BINARY.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel1", mapping.getDocumentField("classBin1"));
     assertEquals("topLevel2", mapping.getDocumentField("classBin2"));
     // Add fields of type int32
     mapping.addClassField("test", "classInt321", "topLevel3",
-        DocumentFieldType.INT32.toString().toLowerCase());
+        DocumentFieldType.INT32.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classInt322", "topLevel4",
-        DocumentFieldType.INT32.toString().toUpperCase());
+        DocumentFieldType.INT32.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel3", mapping.getDocumentField("classInt321"));
     assertEquals("topLevel4", mapping.getDocumentField("classInt322"));
     // Add fields of type int64
     mapping.addClassField("test", "classInt641", "topLevel5",
-        DocumentFieldType.INT64.toString().toLowerCase());
+        DocumentFieldType.INT64.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classInt642", "topLevel6",
-        DocumentFieldType.INT64.toString().toUpperCase());
+        DocumentFieldType.INT64.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel5", mapping.getDocumentField("classInt641"));
     assertEquals("topLevel6", mapping.getDocumentField("classInt642"));
     // Add fields of type double
     mapping.addClassField("test", "classDouble1", "topLevel7",
-        DocumentFieldType.DOUBLE.toString().toLowerCase());
+        DocumentFieldType.DOUBLE.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classDouble2", "topLevel8",
-        DocumentFieldType.DOUBLE.toString().toUpperCase());
+        DocumentFieldType.DOUBLE.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel7", mapping.getDocumentField("classDouble1"));
     assertEquals("topLevel8", mapping.getDocumentField("classDouble2"));
     // Add fields of type string
     mapping.addClassField("test", "classString1", "topLevel9",
-        DocumentFieldType.STRING.toString().toLowerCase());
+        DocumentFieldType.STRING.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classString2", "topLevel10",
-        DocumentFieldType.STRING.toString().toUpperCase());
+        DocumentFieldType.STRING.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel9", mapping.getDocumentField("classString1"));
     assertEquals("topLevel10", mapping.getDocumentField("classString2"));
     // Add fields of type date
     mapping.addClassField("test", "classDate1", "topLevel11",
-        DocumentFieldType.DATE.toString().toLowerCase());
+        DocumentFieldType.DATE.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classDate2", "topLevel12",
-        DocumentFieldType.DATE.toString().toUpperCase());
+        DocumentFieldType.DATE.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel11", mapping.getDocumentField("classDate1"));
     assertEquals("topLevel12", mapping.getDocumentField("classDate2"));
     // Add fields of type list
     mapping.addClassField("test", "classList1", "topLevel13",
-        DocumentFieldType.LIST.toString().toLowerCase());
+        DocumentFieldType.LIST.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classList2", "topLevel14",
-        DocumentFieldType.LIST.toString().toUpperCase());
+        DocumentFieldType.LIST.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel13", mapping.getDocumentField("classList1"));
     assertEquals("topLevel14", mapping.getDocumentField("classList2"));
     // Add fields of type document
     mapping.addClassField("test", "classDocument1", "topLevel15",
-        DocumentFieldType.DOCUMENT.toString().toLowerCase());
+        DocumentFieldType.DOCUMENT.toString().toLowerCase(Locale.getDefault()));
     mapping.addClassField("test", "classDocument2", "topLevel16",
-        DocumentFieldType.DOCUMENT.toString().toUpperCase());
+        DocumentFieldType.DOCUMENT.toString().toUpperCase(Locale.getDefault()));
     assertEquals("topLevel15", mapping.getDocumentField("classDocument1"));
     assertEquals("topLevel16", mapping.getDocumentField("classDocument2"));
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-mongodb/src/test/java/org/apache/gora/mongodb/utils/TestBSONDecorator.java
----------------------------------------------------------------------
diff --git a/gora-mongodb/src/test/java/org/apache/gora/mongodb/utils/TestBSONDecorator.java b/gora-mongodb/src/test/java/org/apache/gora/mongodb/utils/TestBSONDecorator.java
index 238de52..ad8b45c 100644
--- a/gora-mongodb/src/test/java/org/apache/gora/mongodb/utils/TestBSONDecorator.java
+++ b/gora-mongodb/src/test/java/org/apache/gora/mongodb/utils/TestBSONDecorator.java
@@ -20,6 +20,7 @@ package org.apache.gora.mongodb.utils;
 import static org.junit.Assert.*;
 
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 
 import org.junit.Test;
 
@@ -69,27 +70,27 @@ public class TestBSONDecorator {
     DBObject dbo1 = BasicDBObjectBuilder
         .start()
         .add("root0", "value")
-        .add("root1", new BasicDBObject("leaf1", "abcdefgh".getBytes()))
+        .add("root1", new BasicDBObject("leaf1", "abcdefgh".getBytes(Charset.defaultCharset())))
         .add(
             "root2",
             new BasicDBObject("parent1", new BasicDBObject("leaf2", "test"
-                .getBytes())))
-        .add("root3", ByteBuffer.wrap("test2".getBytes())).get();
+                .getBytes(Charset.defaultCharset()))))
+        .add("root3", ByteBuffer.wrap("test2".getBytes(Charset.defaultCharset()))).get();
     BSONDecorator dboc = new BSONDecorator(dbo1);
 
     // Access first bytes field
     assertTrue(dboc.containsField("root1.leaf1"));
-    assertArrayEquals("abcdefgh".getBytes(), dboc.getBytes("root1.leaf1")
+    assertArrayEquals("abcdefgh".getBytes(Charset.defaultCharset()), dboc.getBytes("root1.leaf1")
         .array());
 
     // Access second bytes field
     assertTrue(dboc.containsField("root2.parent1.leaf2"));
-    assertArrayEquals("test".getBytes(), dboc.getBytes("root2.parent1.leaf2")
+    assertArrayEquals("test".getBytes(Charset.defaultCharset()), dboc.getBytes("root2.parent1.leaf2")
         .array());
 
     // Access third bytes field
     assertTrue(dboc.containsField("root3"));
-    assertArrayEquals("test2".getBytes(), dboc.getBytes("root3").array());
+    assertArrayEquals("test2".getBytes(Charset.defaultCharset()), dboc.getBytes("root3").array());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java
----------------------------------------------------------------------
diff --git a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java
index 60505cd..9480540 100644
--- a/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java
+++ b/gora-solr/src/main/java/org/apache/gora/solr/query/SolrResult.java
@@ -36,6 +36,7 @@ import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 
 public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> {
+
   SolrDocumentList list = null;
   SolrStore<K, T> store;
   String[] fields;
@@ -70,7 +71,6 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T> {
       QueryResponse rsp = server.query(params);
       list = rsp.getResults();
     } catch (SolrServerException e) {
-      e.printStackTrace();
       throw new IOException(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
----------------------------------------------------------------------
diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
index f89762c..cc38fa5 100644
--- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
+++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
@@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
@@ -209,7 +210,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
     LOG.info("Using Solr server at " + solrServerUrl);
     String solrJServerType = ((solrJServerImpl == null || solrJServerImpl.equals(""))?"http":solrJServerImpl);
     // HttpSolrServer - denoted by "http" in properties
-    if (solrJServerType.toString().toLowerCase().equals("http")) {
+    if (solrJServerType.toString().toLowerCase(Locale.getDefault()).equals("http")) {
       LOG.info("Using HttpSolrServer Solrj implementation.");
       this.adminServer = new HttpSolrServer(solrServerUrl);
       this.server = new HttpSolrServer( solrServerUrl + "/" + mapping.getCoreName() );
@@ -222,7 +223,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
             serverUsername, serverPassword);
       }
       // CloudSolrServer - denoted by "cloud" in properties
-    } else if (solrJServerType.toString().toLowerCase().equals("cloud")) {
+    } else if (solrJServerType.toString().toLowerCase(Locale.getDefault()).equals("cloud")) {
       LOG.info("Using CloudSolrServer Solrj implementation.");
       this.adminServer = new CloudSolrServer(solrServerUrl);
       this.server = new CloudSolrServer( solrServerUrl + "/" + mapping.getCoreName() );
@@ -234,23 +235,23 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
             (DefaultHttpClient) ((CloudSolrServer) server).getLbServer().getHttpClient(),
             serverUsername, serverPassword);
       }
-    } else if (solrJServerType.toString().toLowerCase().equals("concurrent")) {
+    } else if (solrJServerType.toString().toLowerCase(Locale.getDefault()).equals("concurrent")) {
       LOG.info("Using ConcurrentUpdateSolrServer Solrj implementation.");
       this.adminServer = new ConcurrentUpdateSolrServer(solrServerUrl, 1000, 10);
       this.server = new ConcurrentUpdateSolrServer( solrServerUrl + "/" + mapping.getCoreName(), 1000, 10);
       // LBHttpSolrServer - denoted by "loadbalance" in properties
-    } else if (solrJServerType.toString().toLowerCase().equals("loadbalance")) {
+    } else if (solrJServerType.toString().toLowerCase(Locale.getDefault()).equals("loadbalance")) {
       LOG.info("Using LBHttpSolrServer Solrj implementation.");
       String[] solrUrlElements = StringUtils.split(solrServerUrl);
       try {
         this.adminServer = new LBHttpSolrServer(solrUrlElements);
       } catch (MalformedURLException e) {
-        e.printStackTrace();
+        throw new RuntimeException(e);
       }
       try {
         this.server = new LBHttpSolrServer( solrUrlElements + "/" + mapping.getCoreName() );
       } catch (MalformedURLException e) {
-        e.printStackTrace();
+        throw new RuntimeException(e);
       }
       if (serverUserAuth) {
         HttpClientUtil.setBasicAuth(
@@ -270,8 +271,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
       try {
         batchSize = Integer.parseInt(batchSizeString);
       } catch (NumberFormatException nfe) {
-        LOG.warn("Invalid batch size '" + batchSizeString + "', using default "
-            + DEFAULT_BATCH_SIZE);
+        LOG.warn("Invalid batch size '{}', using default {}", batchSizeString, DEFAULT_BATCH_SIZE);
       }
     }
     batch = new ArrayList<SolrInputDocument>(batchSize);
@@ -281,8 +281,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
       try {
         commitWithin = Integer.parseInt(commitWithinString);
       } catch (NumberFormatException nfe) {
-        LOG.warn("Invalid commit within '" + commitWithinString
-            + "', using default " + DEFAULT_COMMIT_WITHIN);
+        LOG.warn("Invalid commit within '{}' , using default {}", commitWithinString, DEFAULT_COMMIT_WITHIN);
       }
     }
     String resultsSizeString = DataStoreFactory.findProperty(properties, this,
@@ -291,8 +290,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
       try {
         resultsSize = Integer.parseInt(resultsSizeString);
       } catch (NumberFormatException nfe) {
-        LOG.warn("Invalid results size '" + resultsSizeString
-            + "', using default " + DEFAULT_RESULTS_SIZE);
+        LOG.warn("Invalid results size '{}' , using default {}", resultsSizeString, DEFAULT_RESULTS_SIZE);
       }
     }
   }
@@ -332,7 +330,7 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
         LOG.warn("Check that 'keyClass' and 'name' parameters in gora-solr-mapping.xml "
             + "match with intended values. A mapping mismatch has been found therefore "
             + "no mapping has been initialized for class mapping at position " 
-            + classes.indexOf(classElement) + " in mapping file.");
+            + " {} in mapping file.", classes.indexOf(classElement));
       }
     } catch (Exception ex) {
       throw new IOException(ex);

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
----------------------------------------------------------------------
diff --git a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
index 6691fd6..e27eaba 100644
--- a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
+++ b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
@@ -139,7 +139,7 @@ public class LogAnalytics extends Configured implements Tool {
       DataStore<String, MetricDatum> outStore, int numReducer) throws IOException {
     Job job = new Job(getConf());
     job.setJobName("Log Analytics");
-    log.info("Creating Hadoop Job: " + job.getJobName());
+    log.info("Creating Hadoop Job: {}", job.getJobName());
     job.setNumReduceTasks(numReducer);
     job.setJarByClass(getClass());
 
@@ -183,7 +183,7 @@ public class LogAnalytics extends Configured implements Tool {
     inStore.close();
     outStore.close();
     
-    log.info("Log completed with " + (success ? "success" : "failure"));
+    log.info("Log completed with {}", (success ? "success" : "failure"));
     
     return success ? 0 : 1;
   }
@@ -192,7 +192,7 @@ public class LogAnalytics extends Configured implements Tool {
   
   public static void main(String[] args) throws Exception {
     if(args.length < 2) {
-      System.err.println(USAGE);
+      log.info(USAGE);
       System.exit(1);
     }
     //run as any other MR job

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java
----------------------------------------------------------------------
diff --git a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java
index a6f9ffa..cbc9d8e 100644
--- a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java
+++ b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogManager.java
@@ -17,11 +17,16 @@
  */
 package org.apache.gora.tutorial.log;
 
+import java.nio.charset.Charset;
 import java.io.BufferedReader;
 import java.io.FileReader;
+import java.io.InputStreamReader;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.Locale;
 import java.util.StringTokenizer;
 
 import org.apache.avro.util.Utf8;
@@ -55,7 +60,7 @@ public class LogManager {
   private DataStore<Long, Pageview> dataStore; 
   
   private static final SimpleDateFormat dateFormat 
-    = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z");
+    = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", Locale.getDefault());
   
   public LogManager() {
     try {
@@ -78,8 +83,9 @@ public class LogManager {
    * @param input the input file location
    */
   private void parse(String input) throws IOException, ParseException, Exception {
-    log.info("Parsing file:" + input);
-    BufferedReader reader = new BufferedReader(new FileReader(input));
+    log.info("Parsing file: {}", input);
+    BufferedReader reader = new BufferedReader(new InputStreamReader(
+      new FileInputStream(input), Charset.defaultCharset()));
     long lineCount = 0;
     try {
       String line = reader.readLine();
@@ -97,7 +103,7 @@ public class LogManager {
     } finally {
       reader.close();  
     }
-    log.info("finished parsing file. Total number of log lines:" + lineCount);
+    log.info("finished parsing file. Total number of log lines: {}", lineCount);
   }
   
   /** Parses a single log line in combined log format using StringTokenizers */
@@ -177,7 +183,7 @@ public class LogManager {
     dataStore.delete(lineNum);
     dataStore.flush(); //write changes may need to be flushed before
                        //they are committed 
-    log.info("pageview with key:" + lineNum + " deleted");
+    log.info("pageview with key: {} deleted", lineNum);
   }
   
   /** This method illustrates delete by query call */
@@ -189,7 +195,7 @@ public class LogManager {
     query.setEndKey(endKey);
     
     dataStore.deleteByQuery(query);
-    log.info("pageviews with keys between " + startKey + " and " + endKey + " are deleted");
+    log.info("pageviews with keys between {} and {} are deleted.", startKey, endKey);
   }
   
   private void printResult(Result<Long, Pageview> result) throws IOException, Exception {
@@ -198,20 +204,19 @@ public class LogManager {
       long resultKey = result.getKey(); //obtain current key
       Pageview resultPageview = result.get(); //obtain current value object
       
-      //print the results
-      System.out.println(resultKey + ":");
+      log.info("{} :", resultKey);
       printPageview(resultPageview);
     }
     
-    System.out.println("Number of pageviews from the query:" + result.getOffset());
+    log.info("Number of pageviews from the query: {}", result.getOffset());
   }
   
   /** Pretty prints the pageview object to stdout */
   private void printPageview(Pageview pageview) {
     if(pageview == null) {
-      System.out.println("No result to show"); 
+      log.info("No result to show"); 
     } else {
-      System.out.println(pageview.toString());
+      log.info(pageview.toString());
     }
   }
   
@@ -231,7 +236,7 @@ public class LogManager {
   
   public static void main(String[] args) throws Exception {
     if(args.length < 2) {
-      System.err.println(USAGE);
+      log.error(USAGE);
       System.exit(1);
     }
     
@@ -251,7 +256,7 @@ public class LogManager {
     } else if("-deleteByQuery".equalsIgnoreCase(args[0])) {
       manager.deleteByQuery(Long.parseLong(args[1]), Long.parseLong(args[2]));
     } else {
-      System.err.println(USAGE);
+      log.info(USAGE);
       System.exit(1);
     }
     

http://git-wip-us.apache.org/repos/asf/gora/blob/a303ff79/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 01a7fee..e8ed87d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -435,6 +435,34 @@
     </pluginManagement>
     <plugins>
       <plugin>
+        <groupId>de.thetaphi</groupId>
+        <artifactId>forbiddenapis</artifactId>
+        <version>1.8</version>
+        <configuration>
+          <!-- disallow undocumented classes like sun.misc.Unsafe: -->
+          <internalRuntimeForbidden>true</internalRuntimeForbidden>
+          <!--
+            if the used Java version is too new,
+            don't fail, just do nothing:
+          -->
+          <failOnUnsupportedJava>false</failOnUnsupportedJava>
+          <bundledSignatures>
+            <bundledSignature>jdk-unsafe</bundledSignature>
+            <bundledSignature>jdk-deprecated</bundledSignature>
+            <bundledSignature>jdk-system-out</bundledSignature>
+            <!--bundledSignature>commons-io-unsafe-${commons-io.version}</bundledSignature-->
+          </bundledSignatures>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>check</goal>
+              <goal>testCheck</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
       </plugin>
@@ -641,7 +669,7 @@
     <jetty.version>8.1.8.v20121106</jetty.version>
     <tika.version>1.7</tika.version>
     <httpcomponents.version>4.3.1</httpcomponents.version>
-    <commons-io.version>1.3.2</commons-io.version>
+    <commons-io.version>2.4</commons-io.version>
     <restlet.version>2.3.1</restlet.version>
 
     <!-- Misc Dependencies -->
@@ -681,6 +709,7 @@
     <implementation.build>${scmBranch}@r${buildNumber}</implementation.build>
     <javac.src.version>1.7</javac.src.version>
     <javac.target.version>1.7</javac.target.version>
+    <maven.compiler.target>1.7</maven.compiler.target>
     <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format>
     <skipTests>false</skipTests>
     <assembly.finalName>apache-${project.build.finalName}</assembly.finalName>
@@ -1051,7 +1080,7 @@
         <version>1.2.1</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.commons</groupId>
+        <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
         <version>${commons-io.version}</version>
       </dependency>


Mime
View raw message