Author: olga
Date: Thu Oct 22 23:08:33 2009
New Revision: 828891

URL: http://svn.apache.org/viewvc?rev=828891&view=rev
Log:
PIG-1032: FINDBUGS: DM_STRING_CTOR: Method invokes inefficient new
String(String) constructor (olgan)

Modified:
    hadoop/pig/trunk/CHANGES.txt
    hadoop/pig/trunk/src/org/apache/pig/backend/executionengine/PigSlice.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/BinaryComparisonOperator.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/ExpressionOperator.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONot.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/plans/PhysicalPlan.java
    hadoop/pig/trunk/src/org/apache/pig/data/TimestampedTuple.java
    hadoop/pig/trunk/src/org/apache/pig/impl/io/PigNullableWritable.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOGenerate.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOSort.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LogicalPlan.java
    
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/RemoveRedundantOperators.java
    
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/optimizer/ImplicitSplitInserter.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java
    
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java
    hadoop/pig/trunk/src/org/apache/pig/pen/AugmentBaseDataVisitor.java
    hadoop/pig/trunk/src/org/apache/pig/tools/cmdline/CmdLineParser.java
    
hadoop/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java
    hadoop/pig/trunk/test/findbugsExcludeFile.xml

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Thu Oct 22 23:08:33 2009
@@ -26,6 +26,9 @@
 
 IMPROVEMENTS
 
+PIG-1032: FINDBUGS: DM_STRING_CTOR: Method invokes inefficient new
+String(String) constructor (olgan)
+
 PIG-984:  Add map side grouping for data that is already collected when
 it is read into the map (rding via gates).
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/executionengine/PigSlice.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/executionengine/PigSlice.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/backend/executionengine/PigSlice.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/backend/executionengine/PigSlice.java 
Thu Oct 22 23:08:33 2009
@@ -117,7 +117,7 @@
                }
        }
         
-        loader.bindTo(file.toString(), new BufferedPositionedInputStream(is,
+        loader.bindTo(file, new BufferedPositionedInputStream(is,
                 start), start, end);
                 
     }

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
 Thu Oct 22 23:08:33 2009
@@ -478,8 +478,8 @@
 
     private String copyHadoopConfLocally(String server) throws ExecException {
         String localDir = createTempDir(LOCAL);
-        String remoteFile = new String(hodConfDir + "/hadoop-site.xml");
-        String localFile = new String(localDir + "/hadoop-site.xml");
+        String remoteFile = hodConfDir + "/hadoop-site.xml";
+        String localFile = localDir + "/hadoop-site.xml";
 
         remoteHodConfDir = hodConfDir;
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/Launcher.java
 Thu Oct 22 23:08:33 2009
@@ -596,7 +596,7 @@
         if(messages.length > 0) {
             return messages[0];
         } else {
-            return new String(message);
+            return message;
         }        
     }
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/BinaryComparisonOperator.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/BinaryComparisonOperator.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/BinaryComparisonOperator.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/BinaryComparisonOperator.java
 Thu Oct 22 23:08:33 2009
@@ -58,8 +58,8 @@
     // Necessary because the objects are serialized, not constructed on the
     // other side.
     protected void initializeRefs() {
-        trueRef = new Boolean(true);
-        falseRef = new Boolean(false);
+        trueRef = Boolean.valueOf(true);
+        falseRef = Boolean.valueOf(false);
     }
 
     protected void cloneHelper(BinaryComparisonOperator op) {

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/ExpressionOperator.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/ExpressionOperator.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/ExpressionOperator.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/ExpressionOperator.java
 Thu Oct 22 23:08:33 2009
@@ -68,8 +68,7 @@
      */
     @Override
     public ExpressionOperator clone() throws CloneNotSupportedException {
-        String s = new String("This expression operator does not " +
-            "implement clone.");
+        String s = "This expression operator does not implement clone.";
         log.error(s);
         throw new CloneNotSupportedException(s);
     }

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
 Thu Oct 22 23:08:33 2009
@@ -650,9 +650,9 @@
             Result res = in.getNext(b);
             if (res.returnStatus == POStatus.STATUS_OK && res.result != null) {
                 if (((Boolean) res.result) == true)
-                    res.result = new String("1");
+                    res.result = "1";
                 else
-                    res.result = new String("1");
+                    res.result = "0";
             }
             return res;
         }
@@ -660,7 +660,7 @@
             Integer dummyI = null;
             Result res = in.getNext(dummyI);
             if (res.returnStatus == POStatus.STATUS_OK && res.result != null) {
-                res.result = new String(((Integer) res.result).toString());
+                res.result = ((Integer) res.result).toString();
             }
             return res;
         }
@@ -670,7 +670,7 @@
             Result res = in.getNext(d);
             if (res.returnStatus == POStatus.STATUS_OK && res.result != null) {
                 // res.result = DataType.toInteger(res.result);
-                res.result = new String(((Double) res.result).toString());
+                res.result = ((Double) res.result).toString();
             }
             return res;
         }
@@ -680,7 +680,7 @@
             Long l = null;
             Result res = in.getNext(l);
             if (res.returnStatus == POStatus.STATUS_OK && res.result != null) {
-                res.result = new String(((Long) res.result).toString());
+                res.result = ((Long) res.result).toString();
             }
             return res;
         }
@@ -689,7 +689,7 @@
             Float f = null;
             Result res = in.getNext(f);
             if (res.returnStatus == POStatus.STATUS_OK && res.result != null) {
-                res.result = new String(((Float) res.result).toString());
+                res.result = ((Float) res.result).toString();
             }
             return res;
         }

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONot.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONot.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONot.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONot.java
 Thu Oct 22 23:08:33 2009
@@ -63,10 +63,10 @@
         if (trueRes == null) {
             trueRes = new Result();
             trueRes.returnStatus = POStatus.STATUS_OK;
-            trueRes.result = new Boolean(true);
+            trueRes.result = true;
             falseRes = new Result();
             falseRes.returnStatus = POStatus.STATUS_OK;
-            falseRes.result = new Boolean(false);
+            falseRes.result = Boolean.valueOf(false);
         }
         res = expr.getNext(dummyBool);
         if(res.returnStatus != POStatus.STATUS_OK || res.result == null) {

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/plans/PhysicalPlan.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/plans/PhysicalPlan.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/plans/PhysicalPlan.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/plans/PhysicalPlan.java
 Thu Oct 22 23:08:33 2009
@@ -229,16 +229,14 @@
         for (PhysicalOperator op : mFromEdges.keySet()) {
             PhysicalOperator cloneFrom = matches.get(op);
             if (cloneFrom == null) {
-                String msg = new String("Unable to find clone for op "
-                    + op.name());
+                String msg = "Unable to find clone for op " + op.name();
                 throw new CloneNotSupportedException(msg);
             }
             Collection<PhysicalOperator> toOps = mFromEdges.get(op);
             for (PhysicalOperator toOp : toOps) {
                 PhysicalOperator cloneTo = matches.get(toOp);
                 if (cloneTo == null) {
-                    String msg = new String("Unable to find clone for op "
-                        + toOp.name());
+                    String msg = "Unable to find clone for op " + toOp.name();
                     throw new CloneNotSupportedException(msg);
                 }
                 try {
@@ -259,15 +257,13 @@
                 new ArrayList<PhysicalOperator>(inputs.size());
             PhysicalOperator cloneOp = matches.get(op);
             if (cloneOp == null) {
-                String msg = new String("Unable to find clone for op "
-                    + cloneOp.name());
+                String msg = "Unable to find clone for op " + cloneOp.name();
                 throw new CloneNotSupportedException(msg);
             }
             for (PhysicalOperator iOp : inputs) {
                 PhysicalOperator cloneIOp = matches.get(iOp);
                 if (cloneIOp == null) {
-                    String msg = new String("Unable to find clone for op "
-                        + cloneIOp.name());
+                    String msg = "Unable to find clone for op " + 
cloneIOp.name();
                     throw new CloneNotSupportedException(msg);
                 }
                 newInputs.add(cloneIOp);

Modified: hadoop/pig/trunk/src/org/apache/pig/data/TimestampedTuple.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/TimestampedTuple.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/TimestampedTuple.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/TimestampedTuple.java Thu Oct 22 
23:08:33 2009
@@ -67,7 +67,7 @@
                     log.error("Could not parse timestamp " + splitString[i]);
                 }
             }else{
-                mFields.add(new String(splitString[i]));
+                mFields.add(splitString[i]);
             }
         }
     }

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/io/PigNullableWritable.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/io/PigNullableWritable.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/io/PigNullableWritable.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/io/PigNullableWritable.java Thu 
Oct 22 23:08:33 2009
@@ -158,7 +158,6 @@
 
     @Override
     public String toString() {
-        return new String("Null: " + mNull + " index: " + mIndex + " " +
-            mValue.toString());
+        return "Null: " + mNull + " index: " + mIndex + " " + 
mValue.toString();
     }
 }

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java Thu 
Oct 22 23:08:33 2009
@@ -441,7 +441,7 @@
         if(mFlatten != null) {
             forEachClone.mFlatten = new ArrayList<Boolean>();
             for (Iterator<Boolean> it = mFlatten.iterator(); it.hasNext();) {
-                forEachClone.mFlatten.add(new Boolean(it.next()));
+                forEachClone.mFlatten.add(Boolean.valueOf(it.next()));
             }
         }
         

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOGenerate.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOGenerate.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOGenerate.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOGenerate.java Thu 
Oct 22 23:08:33 2009
@@ -166,7 +166,7 @@
         if(mFlatten != null) {
             generateClone.mFlatten = new ArrayList<Boolean>();
             for (Iterator<Boolean> it = mFlatten.iterator(); it.hasNext();) {
-                generateClone.mFlatten.add(new Boolean(it.next()));
+                generateClone.mFlatten.add(Boolean.valueOf(it.next()));
             }
         }
         

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOSort.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOSort.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOSort.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOSort.java Thu Oct 
22 23:08:33 2009
@@ -193,7 +193,7 @@
         if(mAscCols != null) {
             clone.mAscCols = new ArrayList<Boolean>();
             for (Iterator<Boolean> it = mAscCols.iterator(); it.hasNext();) {
-                clone.mAscCols.add(new Boolean(it.next()));
+                clone.mAscCols.add(Boolean.valueOf(it.next()));
             }
         }
         

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LogicalPlan.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LogicalPlan.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LogicalPlan.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LogicalPlan.java Thu 
Oct 22 23:08:33 2009
@@ -126,8 +126,7 @@
         for (LogicalOperator op : mToEdges.keySet()) {
             LogicalOperator cloneTo = matches.get(op);
             if (cloneTo == null) {
-                String msg = new String("Unable to find clone for op "
-                    + op.name());
+                String msg = "Unable to find clone for op " + op.name();
                 log.error(msg);
                 throw new RuntimeException(msg);
             }
@@ -135,8 +134,7 @@
             for (LogicalOperator fromOp : fromOps) {
                 LogicalOperator cloneFrom = matches.get(fromOp);
                 if (cloneFrom == null) {
-                    String msg = new String("Unable to find clone for op "
-                        + fromOp.name());
+                    String msg = "Unable to find clone for op " + 
fromOp.name();
                     log.error(msg);
                     throw new RuntimeException(msg);
                 }

Modified: 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/RemoveRedundantOperators.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/RemoveRedundantOperators.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/RemoveRedundantOperators.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/RemoveRedundantOperators.java
 Thu Oct 22 23:08:33 2009
@@ -102,7 +102,7 @@
                         currentPlan.removeAndReconnectMultiSucc(project);
                         patchInputReference(pred, project, prSuccessors);
                     }catch (PlanException pe){
-                        String msg = new String("Error while removing 
redundant project in plan");
+                        String msg = "Error while removing redundant project 
in plan";
                         throw new VisitorException(msg,pe);
                     }
                 }

Modified: 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/optimizer/ImplicitSplitInserter.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/optimizer/ImplicitSplitInserter.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/optimizer/ImplicitSplitInserter.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/optimizer/ImplicitSplitInserter.java
 Thu Oct 22 23:08:33 2009
@@ -146,7 +146,7 @@
             for (LogicalOperator succ : succs) {
                 LogicalPlan condPlan = new LogicalPlan();
                 LOConst cnst = new LOConst(mPlan, new OperatorKey(scope, 
-                        idGen.getNextNodeId(scope)), new Boolean(true));
+                        idGen.getNextNodeId(scope)), Boolean.valueOf(true));
                 cnst.setType(DataType.BOOLEAN);
                 condPlan.add(cnst);
                 LOSplitOutput splitOutput = new LOSplitOutput(mPlan, 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java 
Thu Oct 22 23:08:33 2009
@@ -672,7 +672,7 @@
     public FieldSchema getField(String alias) throws FrontendException {
         FieldSchema fs = mAliases.get(alias);
         if(null == fs) {
-            String cocoPrefix = new String("::" + alias);
+            String cocoPrefix = "::" + alias;
             Map<String, Integer> aliasMatches = new HashMap<String, Integer>();
             //build the map of aliases that have cocoPrefix as the suffix
             for(String key: mAliases.keySet()) {
@@ -798,7 +798,7 @@
                         if (aliases != null) {
                             List<String> listAliases = new ArrayList<String>();
                             for(String alias: aliases) {
-                                listAliases.add(new String(alias));
+                                listAliases.add(alias);
                             }
                             for(String alias: listAliases) {
                                 log.debug("Removing alias " + alias + " from 
multimap");

Modified: 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java
 Thu Oct 22 23:08:33 2009
@@ -3007,7 +3007,7 @@
             // This is just cast insertion so we don't have any flatten
             ArrayList<Boolean> flattenList = new ArrayList<Boolean>() ;
             for(int i=0;i < targetSchema.size(); i++) {
-                flattenList.add(new Boolean(false)) ;
+                flattenList.add(Boolean.valueOf(false)) ;
             }
 
             // Create ForEach to be inserted

Modified: hadoop/pig/trunk/src/org/apache/pig/pen/AugmentBaseDataVisitor.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/pen/AugmentBaseDataVisitor.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/pen/AugmentBaseDataVisitor.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/pen/AugmentBaseDataVisitor.java Thu Oct 
22 23:08:33 2009
@@ -834,7 +834,7 @@
         case DataType.CHARARRAY:
             String str = (String) v;
             if (str.length() > 0)
-                return new String(str.substring(0, str.length() - 1));
+                return str.substring(0, str.length() - 1);
             else
                 return null;
         case DataType.BYTEARRAY:
@@ -866,7 +866,7 @@
 
         switch (type) {
         case DataType.CHARARRAY:
-            return new String((String) v + "0");
+            return (String) v + "0";
         case DataType.BYTEARRAY:
             String str = ((DataByteArray) v).toString();
             str = str + "0";

Modified: hadoop/pig/trunk/src/org/apache/pig/tools/cmdline/CmdLineParser.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/tools/cmdline/CmdLineParser.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/tools/cmdline/CmdLineParser.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/tools/cmdline/CmdLineParser.java Thu 
Oct 22 23:08:33 2009
@@ -140,12 +140,12 @@
                     " requires a value but you did not provide one.";
                 throw new ParseException(errMsg, mArgNum);
             }
-            mVal = new String(mArgs[++mArgNum]);
+            mVal = mArgs[++mArgNum];
             return cc.charValue();
 
         case OPTIONAL:
             if (mArgNum + 1 < mArgs.length && mArgs[mArgNum + 1].charAt(0) != 
'-') {
-                mVal = new String(mArgs[++mArgNum]);
+                mVal = mArgs[++mArgNum];
             }
             return cc.charValue();
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java 
(original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/tools/parameters/PreprocessorContext.java 
Thu Oct 22 23:08:33 2009
@@ -210,7 +210,7 @@
         int index = line.indexOf('$');
         if (index == -1)       return line;
 
-        String replaced_line = new String(line);
+        String replaced_line = line;
 
         Pattern identifier = Pattern.compile( id_regex );
         Matcher keyMatcher = identifier.matcher( line );

Modified: hadoop/pig/trunk/test/findbugsExcludeFile.xml
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/findbugsExcludeFile.xml?rev=828891&r1=828890&r2=828891&view=diff
==============================================================================
--- hadoop/pig/trunk/test/findbugsExcludeFile.xml (original)
+++ hadoop/pig/trunk/test/findbugsExcludeFile.xml Thu Oct 22 23:08:33 2009
@@ -123,5 +123,9 @@
         <Field name="nig" />
         <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
     </Match>
+    <Match>
+        <Class name="org.apache.pig.impl.util.SpillableMemoryManager" />
+        <Bug pattern="DM_GC" />
+    </Match>
 
 </FindBugsFilter>


Reply via email to