Author: olga
Date: Tue Oct 27 00:26:48 2009
New Revision: 830034

URL: http://svn.apache.org/viewvc?rev=830034&view=rev
Log:
PIG-1050: FINDBUGS: DLS_DEAD_LOCAL_STORE: Dead store to local variable (olgan)

Modified:
    hadoop/pig/trunk/CHANGES.txt
    
hadoop/pig/trunk/lib-src/bzip2/org/apache/tools/bzip2r/CBZip2OutputStream.java
    hadoop/pig/trunk/src/org/apache/pig/Main.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapBase.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/partitioners/SkewedPartitioner.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/PhysicalOperator.java
    hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOForEach.java
    
hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/validators/TypeCheckingVisitor.java
    hadoop/pig/trunk/src/org/apache/pig/impl/util/JarManager.java
    hadoop/pig/trunk/src/org/apache/pig/tools/streams/StreamGenerator.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=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Tue Oct 27 00:26:48 2009
@@ -26,6 +26,8 @@
 
 IMPROVEMENTS
 
+PIG-1050: FINDBUGS: DLS_DEAD_LOCAL_STORE: Dead store to local variable (olgan)
+
 PIG-1043: FINDBUGS: SIC_INNER_SHOULD_BE_STATIC: Should be a static inner class
 (olgan)
 

Modified: 
hadoop/pig/trunk/lib-src/bzip2/org/apache/tools/bzip2r/CBZip2OutputStream.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/lib-src/bzip2/org/apache/tools/bzip2r/CBZip2OutputStream.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/lib-src/bzip2/org/apache/tools/bzip2r/CBZip2OutputStream.java 
(original)
+++ 
hadoop/pig/trunk/lib-src/bzip2/org/apache/tools/bzip2r/CBZip2OutputStream.java 
Tue Oct 27 00:26:48 2009
@@ -1050,9 +1050,7 @@
             b = t;
         }
         if (b > c) {
-            t = b;
             b = c;
-            c = t;
         }
         if (a > b) {
             b = a;

Modified: hadoop/pig/trunk/src/org/apache/pig/Main.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/Main.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/Main.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/Main.java Tue Oct 27 00:26:48 2009
@@ -532,7 +532,6 @@
 private static String getVersionString() {
        String findContainingJar = JarManager.findContainingJar(Main.class);
          try { 
-                 StringBuffer buffer = new  StringBuffer();
           JarFile jar = new JarFile(findContainingJar); 
           final Manifest manifest = jar.getManifest(); 
           final Map <String,Attributes> attrs = manifest.getEntries(); 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java
 Tue Oct 27 00:26:48 2009
@@ -117,8 +117,6 @@
                 keyType = 
((byte[])ObjectSerializer.deserialize(jConf.get("pig.map.keytype")))[0];
                 // till here
                 
-                long sleepTime = jConf.getLong("pig.reporter.sleep.time", 
10000);
-
                 pigReporter = new ProgressableReporter();
                 if(!(cp.isEmpty())) {
                     roots = cp.getRoots().toArray(new PhysicalOperator[1]);

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapBase.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapBase.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapBase.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapBase.java
 Tue Oct 27 00:26:48 2009
@@ -164,9 +164,6 @@
                 log.debug(baos.toString());
             }
             keyType = 
((byte[])ObjectSerializer.deserialize(job.get("pig.map.keytype")))[0];
-            // till here
-            
-            long sleepTime = job.getLong("pig.reporter.sleep.time", 10000);
             
             pigReporter = new ProgressableReporter();
             if(!(mp.isEmpty())) {

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
 Tue Oct 27 00:26:48 2009
@@ -295,9 +295,6 @@
                     rp.explain(baos);
                     log.debug(baos.toString());
                 }
-                // till here
-                
-                long sleepTime = jConf.getLong("pig.reporter.sleep.time", 
10000);
 
                 pigReporter = new ProgressableReporter();
                 if(!(rp.isEmpty())) {

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/partitioners/SkewedPartitioner.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/partitioners/SkewedPartitioner.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/partitioners/SkewedPartitioner.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/partitioners/SkewedPartitioner.java
 Tue Oct 27 00:26:48 2009
@@ -106,7 +106,7 @@
                if (curIndex >= (indexes.first + indexes.second) || curIndex == 
-1) {
                        curIndex = indexes.first;
                } else {
-                       curIndex++;
+                       curIndex = curIndex + 1;
                }
                
                // set it in the map

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/PhysicalOperator.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/PhysicalOperator.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/PhysicalOperator.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/PhysicalOperator.java
 Tue Oct 27 00:26:48 2009
@@ -276,7 +276,7 @@
     }
 
     public Result getNext(DataBag db) throws ExecException {
-        Result ret = new Result();
+        Result ret = null;
         DataBag tmpBag = BagFactory.getInstance().newDefaultBag();
         for(ret = 
getNext(dummyTuple);ret.returnStatus!=POStatus.STATUS_EOP;ret=getNext(dummyTuple)){
             if(ret.returnStatus == POStatus.STATUS_ERR) return ret;

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=830034&r1=830033&r2=830034&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 Tue 
Oct 27 00:26:48 2009
@@ -140,7 +140,7 @@
                if(null == count) {
                        aliases.put(alias, 1);
                } else {
-                       aliases.put(alias, ++count);
+                       aliases.put(alias, count + 1);
                }
     }
 

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=830034&r1=830033&r2=830034&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
 Tue Oct 27 00:26:48 2009
@@ -284,7 +284,6 @@
 
         byte lhsType = lhs.getType() ;
         byte rhsType = rhs.getType() ;
-        Schema.FieldSchema fs = new Schema.FieldSchema(null, DataType.BOOLEAN);
 
         if (  (lhsType != DataType.BOOLEAN)  ||
               (rhsType != DataType.BOOLEAN)  ) {
@@ -319,7 +318,6 @@
 
         byte lhsType = lhs.getType() ;
         byte rhsType = rhs.getType() ;
-        Schema.FieldSchema fs = new Schema.FieldSchema(null, DataType.BOOLEAN);
 
         if (  (lhsType != DataType.BOOLEAN)  ||
               (rhsType != DataType.BOOLEAN)  ) {
@@ -1627,7 +1625,6 @@
         List<FieldSchema> fsLst = fromSch.getFields();
         List<FieldSchema> tsLst = toSch.getFields();
         List<ExpressionOperator> args = udf.getArguments();
-        List<ExpressionOperator> newArgs = new 
ArrayList<ExpressionOperator>(args.size());
         int i=-1;
         for (FieldSchema fFSch : fsLst) {
             ++i;
@@ -1839,7 +1836,7 @@
         // There is no point to union only one operand
         // it should be a problem in the parser
         if (inputs.size() < 2) {
-            AssertionError err =  new AssertionError("Union with 
Count(Operand) < 2") ;
+            throw new AssertionError("Union with Count(Operand) < 2") ;
         }
 
         Schema schema = null ;
@@ -1914,7 +1911,6 @@
             throw new TypeCheckerException(msg, errCode, PigException.BUG) ;
         }
 
-        LogicalOperator input = list.get(0);
         LogicalPlan condPlan = op.getConditionPlan() ;
 
         // Check that the inner plan has only 1 output port
@@ -1958,8 +1954,6 @@
     @Override
     protected void visit(LODistinct op) throws VisitorException {
         op.unsetSchema();
-        LogicalPlan currentPlan = mCurrentWalker.getPlan() ;
-        List<LogicalOperator> list = currentPlan.getPredecessors(op) ;
 
         try {
             // Compute the schema
@@ -1998,8 +1992,6 @@
      */
     protected void visit(LOCross cs) throws VisitorException {
         cs.unsetSchema();
-        List<LogicalOperator> inputs = cs.getInputs() ;
-        List<FieldSchema> fsList = new ArrayList<FieldSchema>() ;
 
         try {
             // Compute the schema
@@ -2063,7 +2055,6 @@
     @Override
     protected void visit(LOFilter filter) throws VisitorException {
         filter.unsetSchema();
-        LogicalOperator input = filter.getInput() ;
         LogicalPlan comparisonPlan = filter.getComparisonPlan() ;
         
         // Check that the inner plan has only 1 output port
@@ -2111,8 +2102,6 @@
             throw new TypeCheckerException(msg, errCode, PigException.BUG) ;
         }
         
-        LogicalOperator input = inputList.get(0) ;
-        
         try {
             // Compute the schema
             split.regenerateSchema() ;
@@ -2720,7 +2709,6 @@
 
     protected void visit(LOForEach f) throws VisitorException {
         List<LogicalPlan> plans = f.getForEachPlans() ;
-        List<Boolean> flattens = f.getFlatten() ;
 
         f.unsetSchema();
         try {
@@ -2934,9 +2922,6 @@
             throw new TypeCheckerException(msg, errCode, PigException.INPUT);
         }
 
-        // Compose the new inner plan to be used in ForEach
-        LogicalPlan foreachPlan = new LogicalPlan() ;
-
         // Plans inside Generate. Fields that do not need casting will only
         // have Project. Fields that need casting will have Project + Cast
         ArrayList<LogicalPlan> generatePlans = new ArrayList<LogicalPlan>() ;
@@ -2998,7 +2983,6 @@
             }
 
             generatePlans.add(genPlan) ;
-
         }
 
         // if we really need casting

Modified: hadoop/pig/trunk/src/org/apache/pig/impl/util/JarManager.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/util/JarManager.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/impl/util/JarManager.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/impl/util/JarManager.java Tue Oct 27 
00:26:48 2009
@@ -101,14 +101,10 @@
         for(String toSend: pigPackagesToSend) {
             addContainingJar(jarList, PigMapReduce.class, toSend, pigContext);
         }
-        ClassLoader pigClassLoader = PigMapReduce.class.getClassLoader();
         
         for (String func: funcs) {
             Class clazz = pigContext.getClassForAlias(func);
             if (clazz != null) {
-                /*if (pigClassLoader == clazz.getClassLoader()) {
-                    continue;
-                }*/
                 addContainingJar(jarList, clazz, null, pigContext);
             }
         }

Modified: hadoop/pig/trunk/src/org/apache/pig/tools/streams/StreamGenerator.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/tools/streams/StreamGenerator.java?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/tools/streams/StreamGenerator.java 
(original)
+++ hadoop/pig/trunk/src/org/apache/pig/tools/streams/StreamGenerator.java Tue 
Oct 27 00:26:48 2009
@@ -146,8 +146,6 @@
     private static void createAndShowGUI() {
         //Make sure we have nice window decorations.
         JFrame.setDefaultLookAndFeelDecorated(true);
-
-        StreamGenerator converter = new StreamGenerator();
     }
 
     public static void main(String[] args) {

Modified: hadoop/pig/trunk/test/findbugsExcludeFile.xml
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/findbugsExcludeFile.xml?rev=830034&r1=830033&r2=830034&view=diff
==============================================================================
--- hadoop/pig/trunk/test/findbugsExcludeFile.xml (original)
+++ hadoop/pig/trunk/test/findbugsExcludeFile.xml Tue Oct 27 00:26:48 2009
@@ -131,5 +131,4 @@
         <Class 
name="org.apache.pig.data.DistinctDataBag$DistinctDataBagIterator$TContainer" />
         <Bug pattern="SIC_INNER_SHOULD_BE_STATIC" />
     </Match>
-
 </FindBugsFilter>


Reply via email to