Repository: oodt
Updated Branches:
  refs/heads/master 64b200a0c -> 96c0ce65c


http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitor.java
----------------------------------------------------------------------
diff --git 
a/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitor.java
 
b/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitor.java
index 4a83d58..34434c9 100644
--- 
a/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitor.java
+++ 
b/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitor.java
@@ -82,7 +82,7 @@ public class GangliaResourceMonitor implements Monitor {
 
        @Override
        public int getLoad(ResourceNode node) throws MonitorException {
-               Map<String, String> nodeProperties = null;
+               Map<String, String> nodeProperties;
                String nodeId = node.getNodeId();
                nodeProperties = this.locateNode(nodeId);
                if (nodeProperties == null) {
@@ -94,7 +94,7 @@ public class GangliaResourceMonitor implements Monitor {
                // calculate load
                double calcLoad = 
this.loadCalculator.calculateLoad(nodeProperties);
                System.out.println(calcLoad);
-               int load = new Long(Math.round(calcLoad)).intValue();
+               int load = Long.valueOf(Math.round(calcLoad)).intValue();
                System.out.println("LOAD is: "+load);
                return load;
        }

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java
----------------------------------------------------------------------
diff --git 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java
 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java
index cd34fda..1258c93 100644
--- 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java
+++ 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java
@@ -33,11 +33,8 @@ import 
org.apache.oodt.cas.resource.structs.exceptions.SchedulerException;
 import org.apache.oodt.cas.resource.util.GenericResourceManagerObjectFactory;
 import org.apache.oodt.cas.resource.util.ResourceNodeComparator;
 import org.apache.oodt.cas.resource.util.XmlRpcStructFactory;
-
-//APACHE imports
 import org.apache.xmlrpc.WebServer;
 
-//JDK imports
 import java.io.File;
 import java.io.FileInputStream;
 import java.net.MalformedURLException;
@@ -45,12 +42,14 @@ import java.net.URL;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+//APACHE imports
+//JDK imports
+
 /**
  * @author woollard
  * @version $Revision$
@@ -169,12 +168,12 @@ public class XmlRpcResourceManager {
 
     public String handleJob(Hashtable jobHash, int jobIn)
             throws SchedulerException {
-        return genericHandleJob(jobHash, new Integer(jobIn));
+        return genericHandleJob(jobHash, jobIn);
     }
 
     public String handleJob(Hashtable jobHash, boolean jobIn)
             throws SchedulerException {
-        return genericHandleJob(jobHash, new Boolean(jobIn));
+        return genericHandleJob(jobHash, jobIn);
     }
 
     public String handleJob(Hashtable jobHash, String jobIn)
@@ -184,7 +183,7 @@ public class XmlRpcResourceManager {
 
     public String handleJob(Hashtable jobHash, double jobIn)
             throws SchedulerException {
-        return genericHandleJob(jobHash, new Double(jobIn));
+        return genericHandleJob(jobHash, jobIn);
     }
 
     public String handleJob(Hashtable jobHash, Date jobIn)
@@ -209,12 +208,12 @@ public class XmlRpcResourceManager {
 
     public boolean handleJob(Hashtable jobHash, int jobIn, String urlStr)
             throws JobExecutionException {
-        return genericHandleJob(jobHash, new Integer(jobIn), urlStr);
+        return genericHandleJob(jobHash, jobIn, urlStr);
     }
 
     public boolean handleJob(Hashtable jobHash, boolean jobIn, String urlStr)
             throws JobExecutionException {
-        return genericHandleJob(jobHash, new Boolean(jobIn), urlStr);
+        return genericHandleJob(jobHash, jobIn, urlStr);
     }
 
     public boolean handleJob(Hashtable jobHash, String jobIn, String urlStr)
@@ -224,7 +223,7 @@ public class XmlRpcResourceManager {
 
     public boolean handleJob(Hashtable jobHash, double jobIn, String urlStr)
             throws JobExecutionException {
-        return genericHandleJob(jobHash, new Double(jobIn), urlStr);
+        return genericHandleJob(jobHash, jobIn, urlStr);
     }
 
     public boolean handleJob(Hashtable jobHash, Date jobIn, String urlStr)
@@ -346,17 +345,17 @@ public class XmlRpcResourceManager {
        List jobSpecs = this.scheduler.getJobQueue().getQueuedJobs();
        
        if(jobSpecs != null && jobSpecs.size() > 0){
-               for(Iterator i = jobSpecs.iterator(); i.hasNext();){
-                       Job job = ((JobSpec)i.next()).getJob();
-                       jobs.add(job);
-               }
+            for (Object jobSpec : jobSpecs) {
+                Job job = ((JobSpec) jobSpec).getJob();
+                jobs.add(job);
+            }
        }
        
        return XmlRpcStructFactory.getXmlRpcJobList(jobs);
     }
     
     public String getNodeReport() throws MonitorException{
-       String report = new String();
+       String report = "";
        
        try{
                
@@ -365,20 +364,20 @@ public class XmlRpcResourceManager {
                Collections.sort(nodes, new ResourceNodeComparator());
                
                // formulate the report string
-               for(Iterator i = nodes.iterator(); i.hasNext(); ){
-                       ResourceNode node = (ResourceNode)i.next();
-                       String nodeId = node.getNodeId();
-                       report += nodeId;
-                       report += " (" + getNodeLoad(nodeId) + "/" + 
node.getCapacity() + ")";
-                       List<String> nodeQueues = getQueuesWithNode(nodeId);
-                       if(nodeQueues != null && nodeQueues.size() > 0){
-                               report += " -- " + nodeQueues.get(0);
-                               for(int j = 1; j < nodeQueues.size(); j++){
-                                       report += ", " + nodeQueues.get(j);
-                               }
-                       }
-                       report += "\n";
-               }
+            for (Object node1 : nodes) {
+                ResourceNode node = (ResourceNode) node1;
+                String nodeId = node.getNodeId();
+                report += nodeId;
+                report += " (" + getNodeLoad(nodeId) + "/" + 
node.getCapacity() + ")";
+                List<String> nodeQueues = getQueuesWithNode(nodeId);
+                if (nodeQueues != null && nodeQueues.size() > 0) {
+                    report += " -- " + nodeQueues.get(0);
+                    for (int j = 1; j < nodeQueues.size(); j++) {
+                        report += ", " + nodeQueues.get(j);
+                    }
+                }
+                report += "\n";
+            }
        
        }catch(Exception e){
                throw new MonitorException(e.getMessage(), e);
@@ -388,7 +387,7 @@ public class XmlRpcResourceManager {
     }
     
     public String getExecutionReport() throws JobRepositoryException{
-       String report = new String();
+       String report = "";
        
        try{
        
@@ -400,24 +399,24 @@ public class XmlRpcResourceManager {
                                        "No jobs can be executing, as there are 
no nodes in the Monitor");
                }
                Vector<String> nodeIds = new Vector<String>();
-               for(Iterator i = resNodes.iterator(); i.hasNext(); ){
-                       nodeIds.add(((ResourceNode)i.next()).getNodeId());
-               }
+            for (Object resNode : resNodes) {
+                nodeIds.add(((ResourceNode) resNode).getNodeId());
+            }
                Collections.sort(nodeIds);
                
                // generate the report string
                for(String nodeId: nodeIds){
                        List execJobIds = 
this.scheduler.getBatchmgr().getJobsOnNode(nodeId);
                        if(execJobIds != null && execJobIds.size() > 0){
-                               for(Iterator i = execJobIds.iterator(); 
i.hasNext(); ){
-                                       String jobId = (String)i.next();
-                                       Job job = 
scheduler.getJobQueue().getJobRepository()
-                                                       
.getJobById(jobId).getJob();
-                                       report += "job id=" + jobId;
-                                       report += ", load=" + 
job.getLoadValue();
-                                       report += ", node=" + nodeId;
-                                       report += ", queue=" + 
job.getQueueName() + "\n";
-                               }
+                    for (Object execJobId : execJobIds) {
+                        String jobId = (String) execJobId;
+                        Job job = scheduler.getJobQueue().getJobRepository()
+                                           .getJobById(jobId).getJob();
+                        report += "job id=" + jobId;
+                        report += ", load=" + job.getLoadValue();
+                        report += ", node=" + nodeId;
+                        report += ", queue=" + job.getQueueName() + "\n";
+                    }
                        }
                }
        
@@ -469,12 +468,14 @@ public class XmlRpcResourceManager {
         Job exec = XmlRpcStructFactory.getJobFromXmlRpc(jobHash);
         JobInput in = GenericResourceManagerObjectFactory
                 .getJobInputFromClassName(exec.getJobInputClassName());
-        in.read(jobIn);
+        if (in != null) {
+            in.read(jobIn);
+        }
 
         JobSpec spec = new JobSpec(in, exec);
 
         // queue the job up
-        String jobId = null;
+        String jobId;
 
         try {
             jobId = scheduler.getJobQueue().addJob(spec);
@@ -490,8 +491,10 @@ public class XmlRpcResourceManager {
             String urlStr) throws JobExecutionException {
         Job exec = XmlRpcStructFactory.getJobFromXmlRpc(jobHash);
         JobInput in = GenericResourceManagerObjectFactory
-                .getJobInputFromClassName(exec.getJobInputClassName());
-        in.read(jobIn);
+            .getJobInputFromClassName(exec.getJobInputClassName());
+        if (in != null) {
+            in.read(jobIn);
+        }
 
         JobSpec spec = new JobSpec(in, exec);
 
@@ -500,13 +503,10 @@ public class XmlRpcResourceManager {
 
         try {
             remoteNode = scheduler.getMonitor().getNodeByURL(remoteUrl);
-        } catch (MonitorException e) {
+        } catch (MonitorException ignored) {
         }
 
-        if (remoteNode != null) {
-            return scheduler.getBatchmgr().executeRemotely(spec, remoteNode);
-        } else
-            return false;
+        return remoteNode != null && 
scheduler.getBatchmgr().executeRemotely(spec, remoteNode);
     }
 
     private URL safeGetUrlFromString(String urlStr) {

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
----------------------------------------------------------------------
diff --git 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
index 5f4db15..aa9181e 100644
--- 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
+++ 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
@@ -97,14 +97,14 @@ public class XmlRpcResourceManagerClient {
         CommonsXmlRpcTransportFactory transportFactory = new 
CommonsXmlRpcTransportFactory(
                 url);
         int connectionTimeoutMins = Integer
-                .getInteger(
-                        
"org.apache.oodt.cas.resource.system.xmlrpc.connectionTimeout.minutes",
-                        20).intValue();
+            .getInteger(
+                
"org.apache.oodt.cas.resource.system.xmlrpc.connectionTimeout.minutes",
+                20);
         int connectionTimeout = connectionTimeoutMins * 60 * 1000;
         int requestTimeoutMins = Integer
-                .getInteger(
-                        
"org.apache.oodt.cas.resource.system.xmlrpc.requestTimeout.minutes",
-                        60).intValue();
+            .getInteger(
+                
"org.apache.oodt.cas.resource.system.xmlrpc.requestTimeout.minutes",
+                60);
         int requestTimeout = requestTimeoutMins * 60 * 1000;
         transportFactory.setConnectionTimeout(connectionTimeout);
         transportFactory.setTimeout(requestTimeout);
@@ -121,11 +121,11 @@ public class XmlRpcResourceManagerClient {
         Vector argList = new Vector();
         argList.add(jobId);
 
-        boolean complete = false;
+        boolean complete;
 
         try {
-            complete = ((Boolean) client.execute("resourcemgr.isJobComplete",
-                    argList)).booleanValue();
+            complete = (Boolean) client.execute("resourcemgr.isJobComplete",
+                argList);
         } catch (XmlRpcException e) {
             throw new JobRepositoryException(e.getMessage(), e);
         } catch (IOException e) {
@@ -139,7 +139,7 @@ public class XmlRpcResourceManagerClient {
         Vector argList = new Vector();
         argList.add(jobId);
 
-        Hashtable jobHash = null;
+        Hashtable jobHash;
 
         try {
             jobHash = (Hashtable) client.execute("resourcemgr.getJobInfo",
@@ -157,8 +157,7 @@ public class XmlRpcResourceManagerClient {
         Vector argList = new Vector();
 
         try {
-            return ((Boolean) client.execute("resourcemgr.isAlive", argList))
-                    .booleanValue();
+            return (Boolean) client.execute("resourcemgr.isAlive", argList);
         } catch (XmlRpcException e) {
             return false;
         } catch (IOException e) {
@@ -200,8 +199,7 @@ public class XmlRpcResourceManagerClient {
         argList.add(jobId);
 
         try {
-            return ((Boolean) client.execute("resourcemgr.killJob", argList))
-                    .booleanValue();
+            return (Boolean) client.execute("resourcemgr.killJob", argList);
         } catch (XmlRpcException e) {
             return false;
         } catch (IOException e) {
@@ -229,7 +227,7 @@ public class XmlRpcResourceManagerClient {
 
         LOG.log(Level.FINEST, argList.toString());
 
-        String jobId = null;
+        String jobId;
 
         try {
             jobId = (String) client.execute("resourcemgr.handleJob", argList);
@@ -250,11 +248,11 @@ public class XmlRpcResourceManagerClient {
         argList.add(in.write());
         argList.add(hostUrl.toString());
 
-        boolean success = false;
+        boolean success;
 
         try {
-            success = ((Boolean) client.execute("resourcemgr.handleJob",
-                    argList)).booleanValue();
+            success = (Boolean) client.execute("resourcemgr.handleJob",
+                argList);
         } catch (XmlRpcException e) {
             throw new JobExecutionException(e.getMessage(), e);
         } catch (IOException e) {
@@ -268,7 +266,7 @@ public class XmlRpcResourceManagerClient {
     public List getNodes() throws MonitorException {
         Vector argList = new Vector();
 
-        Vector nodeVector = null;
+        Vector nodeVector;
 
         try {
             nodeVector = (Vector) client.execute("resourcemgr.getNodes",
@@ -287,7 +285,7 @@ public class XmlRpcResourceManagerClient {
         Vector argList = new Vector();
         argList.add(nodeId);
 
-        Hashtable resNodeHash = null;
+        Hashtable resNodeHash;
 
         try {
             resNodeHash = (Hashtable) client.execute("resourcemgr.getNodeById",
@@ -381,7 +379,7 @@ public class XmlRpcResourceManagerClient {
        try{
                Vector<Object> argList = new Vector<Object>();
             argList.add(nodeId);
-            argList.add(new Integer(capacity));
+            argList.add(capacity);
             client.execute("resourcemgr.setNodeCapacity", argList);
        }catch (Exception e){
                throw new MonitorException(e.getMessage(), e);
@@ -485,7 +483,7 @@ public class XmlRpcResourceManagerClient {
     }
 
    public List getQueuedJobs() throws JobQueueException{
-        Vector queuedJobs = null;
+        Vector queuedJobs;
            
         try{
           queuedJobs = (Vector)client.execute("resourcemgr.getQueuedJobs", new 
Vector<Object>());
@@ -497,7 +495,7 @@ public class XmlRpcResourceManagerClient {
   }  
 
     public String getNodeReport() throws MonitorException{
-       String report = null;
+       String report;
        
        try{
            report = (String)client.execute("resourcemgr.getNodeReport", new 
Vector<Object>());
@@ -510,7 +508,7 @@ public class XmlRpcResourceManagerClient {
 
 
     public String getExecReport() throws JobRepositoryException{
-       String report = null;
+       String report;
        
        try{
            report = (String)client.execute("resourcemgr.getExecutionReport", 
new Vector<Object>());

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java
----------------------------------------------------------------------
diff --git 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java
 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java
index 6643951..529aaf0 100644
--- 
a/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java
+++ 
b/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java
@@ -19,6 +19,15 @@
 package org.apache.oodt.cas.resource.system.extern;
 
 //JDK imports
+import org.apache.oodt.cas.resource.structs.Job;
+import org.apache.oodt.cas.resource.structs.JobInput;
+import org.apache.oodt.cas.resource.structs.JobInstance;
+import org.apache.oodt.cas.resource.structs.exceptions.JobException;
+import org.apache.oodt.cas.resource.structs.exceptions.JobInputException;
+import org.apache.oodt.cas.resource.util.GenericResourceManagerObjectFactory;
+import org.apache.oodt.cas.resource.util.XmlRpcStructFactory;
+import org.apache.xmlrpc.WebServer;
+
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -28,16 +37,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 //OODT imports
-import org.apache.oodt.cas.resource.structs.Job;
-import org.apache.oodt.cas.resource.structs.JobInput;
-import org.apache.oodt.cas.resource.structs.JobInstance;
-import org.apache.oodt.cas.resource.structs.exceptions.JobException;
-import org.apache.oodt.cas.resource.structs.exceptions.JobInputException;
-import org.apache.oodt.cas.resource.util.GenericResourceManagerObjectFactory;
-import org.apache.oodt.cas.resource.util.XmlRpcStructFactory;
-
 //APACHE imports
-import org.apache.xmlrpc.WebServer;
 
 /**
  * @author woollard
@@ -92,17 +92,17 @@ public class XmlRpcBatchStub {
 
     public boolean executeJob(Hashtable jobHash, double jobInput)
             throws JobException {
-        return genericExecuteJob(jobHash, new Double(jobInput));
+        return genericExecuteJob(jobHash, jobInput);
     }
 
     public boolean executeJob(Hashtable jobHash, int jobInput)
             throws JobException {
-        return genericExecuteJob(jobHash, new Integer(jobInput));
+        return genericExecuteJob(jobHash, jobInput);
     }
 
     public boolean executeJob(Hashtable jobHash, boolean jobInput)
             throws JobException {
-        return genericExecuteJob(jobHash, new Boolean(jobInput));
+        return genericExecuteJob(jobHash, jobInput);
     }
 
     public boolean executeJob(Hashtable jobHash, Vector jobInput)
@@ -131,8 +131,8 @@ public class XmlRpcBatchStub {
 
     private boolean genericExecuteJob(Hashtable jobHash, Object jobInput)
             throws JobException {
-        JobInstance exec = null;
-        JobInput in = null;
+        JobInstance exec;
+        JobInput in;
         try {
             Job job = XmlRpcStructFactory.getJobFromXmlRpc(jobHash);
 
@@ -145,7 +145,9 @@ public class XmlRpcBatchStub {
                     .getJobInputFromClassName(job.getJobInputClassName());
 
             // load the input obj
-            in.read(jobInput);
+            if (in != null) {
+                in.read(jobInput);
+            }
 
             // create threaded job
             // so that it can be interrupted
@@ -171,7 +173,6 @@ public class XmlRpcBatchStub {
             synchronized (jobThreadMap) {
                 Thread endThread = (Thread) jobThreadMap.get(job.getId());
                 if (endThread != null)
-                    endThread = null;
             }
 
             return runner.wasSuccessful();
@@ -196,8 +197,6 @@ public class XmlRpcBatchStub {
             System.exit(1);
         }
 
-        XmlRpcBatchStub stub = new XmlRpcBatchStub(portNum);
-
         for (;;)
             try {
                 Thread.currentThread().join();

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java
----------------------------------------------------------------------
diff --git 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java
 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java
index 7385d40..3776e01 100644
--- 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java
+++ 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/IterativeWorkflowProcessorThread.java
@@ -126,12 +126,10 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
      * satisfaction
      */
     waitForConditionSatisfy = Long.getLong(
-        "org.apache.oodt.cas.workflow.engine.preConditionWaitTime", 10)
-        .longValue();
+        "org.apache.oodt.cas.workflow.engine.preConditionWaitTime", 10);
 
     pollingWaitTime = Long.getLong(
-        "org.apache.oodt.cas.workflow.engine.resourcemgr.pollingWaitTime", 10)
-        .longValue();
+        "org.apache.oodt.cas.workflow.engine.resourcemgr.pollingWaitTime", 10);
 
     wmgrParentUrl = wParentUrl;
   }
@@ -244,7 +242,7 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
         taskJob
             
.setJobInputClassName("org.apache.oodt.cas.workflow.structs.TaskJobInput");
         taskJob.setLoadValue(task.getTaskConfig().getProperty(TASK_LOAD) != 
null ? 
-            Integer.parseInt(task.getTaskConfig().getProperty(TASK_LOAD)):new 
Integer(2));
+            Integer.parseInt(task.getTaskConfig().getProperty(TASK_LOAD)): 2);
         taskJob
             .setQueueName(task.getTaskConfig().getProperty(QUEUE_NAME) != null 
? task
                 .getTaskConfig().getProperty(QUEUE_NAME) : DEFAULT_QUEUE_NAME);
@@ -287,7 +285,7 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
             break;
           }
 
-          WorkflowInstance updatedInst = null;
+          WorkflowInstance updatedInst;
           try {
             updatedInst = instanceRepository
                 .getWorkflowInstanceById(workflowInst.getId());
@@ -379,7 +377,7 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
    * @return True if the WorkflowInstance managed by this processor is paused.
    */
   public boolean isPaused() {
-    return pause == true;
+    return pause;
   }
 
   public boolean isStopped() {
@@ -467,20 +465,19 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
 
   private boolean checkTaskRequiredMetadata(WorkflowTask task,
       Metadata dynMetadata) {
-    if (task.getRequiredMetFields() == null
-        || (task.getRequiredMetFields() != null && task.getRequiredMetFields()
-            .size() == 0)) {
+    if (task.getRequiredMetFields() == null || (task.getRequiredMetFields()
+                                                    .size() == 0)) {
       LOG.log(Level.INFO, "Task: [" + task.getTaskName()
           + "] has no required metadata fields");
       return true; /* no required metadata, so we're fine */
     }
 
-    for (Iterator i = task.getRequiredMetFields().iterator(); i.hasNext();) {
-      String reqField = (String) i.next();
+    for (Object o : task.getRequiredMetFields()) {
+      String reqField = (String) o;
       if (!dynMetadata.containsKey(reqField)) {
         LOG.log(Level.SEVERE, "Checking metadata key: [" + reqField
-            + "] for task: [" + task.getTaskName()
-            + "]: failed: aborting workflow");
+                              + "] for task: [" + task.getTaskName()
+                              + "]: failed: aborting workflow");
         return false;
       }
     }
@@ -492,9 +489,7 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
   }
 
   private String getTaskNameById(String taskId) {
-    for (Iterator i = workflowInst.getWorkflow().getTasks().iterator(); i
-        .hasNext();) {
-      WorkflowTask task = (WorkflowTask) i.next();
+    for (WorkflowTask task : workflowInst.getWorkflow().getTasks()) {
       if (task.getTaskId().equals(taskId)) {
         return task.getTaskName();
       }
@@ -504,8 +499,8 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
   }
 
   private boolean satisfied(List conditionList, String taskId) {
-    for (Iterator i = conditionList.iterator(); i.hasNext();) {
-      WorkflowCondition c = (WorkflowCondition) i.next();
+    for (Object aConditionList : conditionList) {
+      WorkflowCondition c = (WorkflowCondition) aConditionList;
       WorkflowConditionInstance cInst = null;
 
       // see if we've already cached this condition instance
@@ -551,9 +546,8 @@ public class IterativeWorkflowProcessorThread implements 
WorkflowStatus,
       // Get hostname by textual representation of IP address
       InetAddress addr = InetAddress.getLocalHost();
       // Get the host name
-      String hostname = addr.getHostName();
-      return hostname;
-    } catch (UnknownHostException e) {
+      return addr.getHostName();
+    } catch (UnknownHostException ignored) {
     }
     return null;
   }

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/ResourceRunner.java
----------------------------------------------------------------------
diff --git 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/ResourceRunner.java
 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/ResourceRunner.java
index 708eed4..4366d2d 100644
--- 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/ResourceRunner.java
+++ 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/runner/ResourceRunner.java
@@ -18,11 +18,6 @@
 package org.apache.oodt.cas.workflow.engine.runner;
 
 //JDK imports
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-//OODT imports
 import org.apache.oodt.cas.resource.structs.Job;
 import org.apache.oodt.cas.resource.structs.exceptions.JobExecutionException;
 import org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient;
@@ -33,6 +28,12 @@ import org.apache.oodt.cas.workflow.structs.TaskJobInput;
 import org.apache.oodt.cas.workflow.structs.WorkflowStatus;
 import org.apache.oodt.cas.workflow.structs.WorkflowTask;
 
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+
 /**
  * 
  * Submits a {@link WorkflowTask} to the Resource Manager.
@@ -70,7 +71,7 @@ public class ResourceRunner extends AbstractEngineRunnerBase 
implements CoreMetK
         
.setJobInstanceClassName("org.apache.oodt.cas.workflow.structs.TaskJob");
     workflowTaskJob
         
.setJobInputClassName("org.apache.oodt.cas.workflow.structs.TaskJobInput");
-    workflowTaskJob.setLoadValue(new Integer(2));
+    workflowTaskJob.setLoadValue(2);
     workflowTaskJob.setQueueName(workflowTask.getTaskConfig().getProperty(
         QUEUE_NAME) != null ? workflowTask.getTaskConfig().getProperty(
         QUEUE_NAME) : DEFAULT_QUEUE_NAME);

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleStage.java
----------------------------------------------------------------------
diff --git 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleStage.java
 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleStage.java
index 1f00b97..56c4d2a 100644
--- 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleStage.java
+++ 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleStage.java
@@ -116,7 +116,7 @@ public class WorkflowLifecycleStage {
    * @see java.lang.Object#hashCode()
    */
   public int hashCode() {
-    return this.name.hashCode() + new Integer(this.order).hashCode();
+    return this.name.hashCode() + Integer.valueOf(othis.order).hashCode();
   }
 
   /*

http://git-wip-us.apache.org/repos/asf/oodt/blob/d5dfd9f1/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java
----------------------------------------------------------------------
diff --git 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java
 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java
index 34bab8a..375b058 100644
--- 
a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java
+++ 
b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/DataSourceWorkflowRepository.java
@@ -17,7 +17,6 @@
 
 package org.apache.oodt.cas.workflow.repository;
 
-//OODT imports
 import org.apache.oodt.cas.workflow.examples.NoOpTask;
 import org.apache.oodt.cas.workflow.structs.*;
 import org.apache.oodt.cas.workflow.structs.exceptions.RepositoryException;
@@ -34,8 +33,6 @@ import java.util.logging.Logger;
 
 import javax.sql.DataSource;
 
-//JDK imports
-
 /**
  * 
  * A {@link DataSource}-based implementation of a workflow repository.
@@ -1485,7 +1482,7 @@ public class DataSourceWorkflowRepository implements 
WorkflowRepository {
       }
 
       synchronized (taskId) {
-        taskId = String.valueOf(new Integer(taskId) + 1);
+        taskId = String.valueOf(Integer.valueOf(taskId) + 1);
       }
 
       task.setTaskId(taskId);

Reply via email to