You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2015/10/30 12:34:15 UTC

[1/3] oodt git commit: remove dead vars

Repository: oodt
Updated Branches:
  refs/heads/master 20370f8bd -> a720c48b0


remove dead vars


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

Branch: refs/heads/master
Commit: 2d6a7f5e13488b9be8d2a45cf998d10a6d741829
Parents: 20370f8
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 30 09:59:46 2015 +0000
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 30 09:59:46 2015 +0000

----------------------------------------------------------------------
 .../database/DatabaseConnectionBuilder.java     | 14 +++-------
 .../apache/oodt/commons/util/DateConvert.java   |  1 -
 .../cas/curation/service/MetadataResource.java  | 11 ++++----
 .../oodt/cas/filemgr/tools/CatalogSearch.java   |  4 ---
 .../apache/oodt/opendapps/DatasetCrawler.java   |  2 +-
 .../oodt/cas/pushpull/config/RemoteSpecs.java   | 11 +++-----
 .../cas/resource/batchmgr/XmlRpcBatchMgr.java   |  4 +--
 .../ganglia/GangliaResourceMonitorFactory.java  |  2 --
 .../resource/system/XmlRpcResourceManager.java  |  2 +-
 .../filemgr/browser/types/TypeBrowser.java      | 25 ++++++++---------
 ...SourceWorkflowInstanceRepositoryFactory.java | 14 +---------
 .../workflow/system/XmlRpcWorkflowManager.java  | 28 +++++++++-----------
 .../cas/workflow/util/XmlRpcStructFactory.java  |  7 ++---
 13 files changed, 44 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/commons/src/main/java/org/apache/oodt/commons/database/DatabaseConnectionBuilder.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/oodt/commons/database/DatabaseConnectionBuilder.java b/commons/src/main/java/org/apache/oodt/commons/database/DatabaseConnectionBuilder.java
index e997812..da55db8 100644
--- a/commons/src/main/java/org/apache/oodt/commons/database/DatabaseConnectionBuilder.java
+++ b/commons/src/main/java/org/apache/oodt/commons/database/DatabaseConnectionBuilder.java
@@ -19,14 +19,12 @@
 package org.apache.oodt.commons.database;
 
 //JDK imports
+import org.apache.commons.dbcp.PoolingDataSource;
+import org.apache.commons.pool.impl.GenericObjectPool;
+
 import javax.sql.DataSource;
 
 //APACHE imports
-import org.apache.commons.dbcp.ConnectionFactory;
-import org.apache.commons.dbcp.DriverManagerConnectionFactory;
-import org.apache.commons.dbcp.PoolableConnectionFactory;
-import org.apache.commons.dbcp.PoolingDataSource;
-import org.apache.commons.pool.impl.GenericObjectPool;
 
 /**
  * @author mattmann
@@ -49,12 +47,8 @@ public final class DatabaseConnectionBuilder {
         }
 
         GenericObjectPool connectionPool = new GenericObjectPool(null);
-        ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
-                url, user, pass);
-        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(
-                connectionFactory, connectionPool, null, null, false, true);
 
-        ds = new PoolingDataSource(connectionPool);
+      ds = new PoolingDataSource(connectionPool);
 
         return ds;
     }

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java b/commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
index 2a8d1d8..f328d1c 100644
--- a/commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
+++ b/commons/src/main/java/org/apache/oodt/commons/util/DateConvert.java
@@ -184,7 +184,6 @@ public class DateConvert {
 
 			// Validate the given offset.
 			offsetFormat.setLenient(false);
-			Date offsetDate = offsetFormat.parse(offsetString.substring(1));
 
 			// Set the time zone with the validated offset.
 			dateFormat.setTimeZone(TimeZone.getTimeZone("GMT" + offsetString));

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
----------------------------------------------------------------------
diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
index 045edcb..df43653 100644
--- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
+++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
@@ -19,10 +19,6 @@
 package org.apache.oodt.cas.curation.service;
 
 //JDK imports
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-import net.sf.json.JSONSerializer;
-
 import org.apache.oodt.cas.curation.structs.ExtractorConfig;
 import org.apache.oodt.cas.curation.util.CurationXmlStructFactory;
 import org.apache.oodt.cas.curation.util.ExtractorConfigReader;
@@ -44,6 +40,11 @@ import org.apache.oodt.cas.metadata.Metadata;
 import org.apache.oodt.cas.metadata.SerializableMetadata;
 import org.apache.oodt.cas.metadata.exceptions.MetExtractionException;
 import org.apache.oodt.cas.metadata.util.GenericMetadataObjectFactory;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+import net.sf.json.JSONSerializer;
+
 import org.springframework.util.StringUtils;
 
 import java.io.File;
@@ -523,7 +524,7 @@ public class MetadataResource extends CurationService {
     XmlRpcFileManagerClient fmClient = CurationService.config.getFileManagerClient();
  
     // empty metadata
-    Metadata metadata = new Metadata();
+    Metadata metadata;
     
     try {
     

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
index bf01039..6dbfbfd 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/CatalogSearch.java
@@ -17,7 +17,6 @@
 
 package org.apache.oodt.cas.filemgr.tools;
 
-//OODT imports
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.queryParser.QueryParser;
@@ -44,9 +43,6 @@ import java.net.URL;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
-//JDK imports
-//Lucene imports
-
 /**
  * 
  * @author woollard

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/opendapps/src/main/java/org/apache/oodt/opendapps/DatasetCrawler.java
----------------------------------------------------------------------
diff --git a/opendapps/src/main/java/org/apache/oodt/opendapps/DatasetCrawler.java b/opendapps/src/main/java/org/apache/oodt/opendapps/DatasetCrawler.java
index 0758690..89f06ef 100644
--- a/opendapps/src/main/java/org/apache/oodt/opendapps/DatasetCrawler.java
+++ b/opendapps/src/main/java/org/apache/oodt/opendapps/DatasetCrawler.java
@@ -72,7 +72,7 @@ public class DatasetCrawler implements CatalogCrawler.Listener {
    */
   public void getDataset(InvDataset dd, Object context) {
   	String url = this.datasetURL + dd.getCatalogUrl().split("#")[1];
-    String id = dd.getID();    
+
     LOG.log(Level.FINE, url + " is the computed access URL for this dataset");
     // look for an OpenDAP access URL, only extract metadata if it is found
     List<InvAccess> datasets = dd.getAccess();

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
index add1466..aa72487 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
@@ -16,9 +16,6 @@
  */
 package org.apache.oodt.cas.pushpull.config;
 
-//OODT imports
-import com.google.common.base.Strings;
-
 import org.apache.oodt.cas.metadata.util.PathUtils;
 import org.apache.oodt.cas.pushpull.exceptions.ConfigException;
 import org.apache.oodt.cas.pushpull.filerestrictions.Parser;
@@ -26,6 +23,9 @@ import org.apache.oodt.cas.pushpull.filerestrictions.renamingconventions.Renamin
 import org.apache.oodt.cas.pushpull.objectfactory.PushPullObjectFactory;
 import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
 import org.apache.oodt.commons.xml.XMLUtils;
+
+import com.google.common.base.Strings;
+
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -36,9 +36,6 @@ import java.net.URL;
 import java.util.HashMap;
 import java.util.LinkedList;
 
-//JDK imports
-//DOM imports
-//Google imports
 
 /**
  * Remote Site Crawling specifications.
@@ -120,7 +117,7 @@ public class RemoteSpecs implements ConfigParserMetKeys {
         NodeList propInfoList = ((Element) daemonNode)
             .getElementsByTagName(PROP_INFO_TAG);
         LinkedList<PropFilesInfo> pfiList = new LinkedList<PropFilesInfo>();
-        PropFilesInfo pfi = null;
+        PropFilesInfo pfi;
         if (propInfoList.getLength() > 0) {
           Node propInfoNode = propInfoList.item(0);
 

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgr.java
----------------------------------------------------------------------
diff --git a/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgr.java b/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgr.java
index 7b34708..d925b8e 100644
--- a/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgr.java
+++ b/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgr.java
@@ -175,7 +175,7 @@ public class XmlRpcBatchMgr implements Batchmgr {
             this.nodeToJobMap.remove(spec.getJob().getId());
         }
         synchronized (this.specToProxyMap) {
-            XmlRpcBatchMgrProxy proxy = (XmlRpcBatchMgrProxy) this.specToProxyMap
+            this.specToProxyMap
                     .remove(spec.getJob().getId());
         }
 
@@ -193,7 +193,7 @@ public class XmlRpcBatchMgr implements Batchmgr {
             this.nodeToJobMap.remove(spec.getJob().getId());
         }
         synchronized (this.specToProxyMap) {
-            XmlRpcBatchMgrProxy proxy = (XmlRpcBatchMgrProxy) this.specToProxyMap
+            this.specToProxyMap
                     .remove(spec.getJob().getId());
 
         }

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitorFactory.java
----------------------------------------------------------------------
diff --git a/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitorFactory.java b/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitorFactory.java
index 9b62b2b..9923620 100644
--- a/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitorFactory.java
+++ b/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaResourceMonitorFactory.java
@@ -44,8 +44,6 @@ public class GangliaResourceMonitorFactory implements MonitorFactory {
 		try {
 			String loadCalculatorFactoryStr = System
 					.getProperty("org.apache.oodt.cas.resource.monitor.loadcalc.factory");
-			String nodeRepoFactoryStr = System
-					.getProperty("org.apache.oodt.cas.resource.nodes.repo.factory");
 			
 			String gmetadHost = System
                      .getProperty("org.apache.oodt.cas.resource.monitor.ganglia.gemtad.host.address");

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/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 3aee637..e35d1d5 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
@@ -439,7 +439,7 @@ public class XmlRpcResourceManager {
             System.exit(1);
         }
 
-        XmlRpcResourceManager manager = new XmlRpcResourceManager(portNum);
+        new XmlRpcResourceManager(portNum);
 
         for (;;)
             try {

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/TypeBrowser.java
----------------------------------------------------------------------
diff --git a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/TypeBrowser.java b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/TypeBrowser.java
index 0c33641..fc45a97 100644
--- a/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/TypeBrowser.java
+++ b/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/browser/types/TypeBrowser.java
@@ -18,15 +18,6 @@
 package org.apache.oodt.cas.webcomponents.filemgr.browser.types;
 
 //JDK imports
-import java.io.Serializable;
-import java.text.NumberFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-//OODT imports
 import org.apache.oodt.cas.filemgr.structs.Element;
 import org.apache.oodt.cas.filemgr.structs.Product;
 import org.apache.oodt.cas.filemgr.structs.ProductPage;
@@ -35,13 +26,10 @@ import org.apache.oodt.cas.filemgr.structs.Query;
 import org.apache.oodt.cas.filemgr.structs.TermQueryCriteria;
 import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
 import org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException;
-import org.apache.oodt.cas.metadata.SerializableMetadata;
 import org.apache.oodt.cas.webcomponents.filemgr.FMBrowserSession;
 import org.apache.oodt.cas.webcomponents.filemgr.FileManagerConn;
 import org.apache.oodt.cas.webcomponents.filemgr.browser.pagination.ProductPaginator;
 import org.apache.oodt.cas.webcomponents.filemgr.model.ProductModel;
-
-//Wicket imports
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
@@ -60,6 +48,17 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.util.ListModel;
 
+import java.io.Serializable;
+import java.text.NumberFormat;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+//Wicket imports
+
 /**
  * 
  * This page is mounted to:
@@ -189,8 +188,6 @@ public class TypeBrowser extends Panel {
         refLink.setPopupSettings(refSettings);
         prodItem.add(refLink);
 
-        SerializableMetadata met = new SerializableMetadata(fm
-            .getMetadata(prodItem.getModelObject()));
         Link<String> metLink = new Link<String>("met_page_link", new Model(
             prodItem.getModelObject().getProductId())) {
 

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
----------------------------------------------------------------------
diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
index caf68ad..3b87a6c 100644
--- a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
+++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
@@ -18,11 +18,6 @@
 
 package org.apache.oodt.cas.workflow.instrepo;
 
-//OODT imports
-
-import org.apache.commons.dbcp.ConnectionFactory;
-import org.apache.commons.dbcp.DriverManagerConnectionFactory;
-import org.apache.commons.dbcp.PoolableConnectionFactory;
 import org.apache.commons.dbcp.PoolingDataSource;
 import org.apache.commons.pool.impl.GenericObjectPool;
 import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -30,9 +25,6 @@ import org.apache.oodt.cas.workflow.exceptions.WorkflowException;
 
 import javax.sql.DataSource;
 
-//APACHE imports
-//JDK imports
-
 /**
  * @author mattmann
  * @version $Revision$
@@ -83,12 +75,8 @@ public class DataSourceWorkflowInstanceRepositoryFactory implements
         }
 
         GenericObjectPool connectionPool = new GenericObjectPool(null);
-        ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
-                jdbcUrl, user, pass);
-        PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(
-                connectionFactory, connectionPool, null, null, false, true);
 
-        dataSource = new PoolingDataSource(connectionPool);
+        dataSource = new PoolingDataSource(connectionPool);o
         quoteFields = Boolean
                 .getBoolean("org.apache.oodt.cas.workflow.instanceRep.datasource.quoteFields");
         pageSize = Integer.getInteger(

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java
----------------------------------------------------------------------
diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java
index 33bb5b5..dc54a70 100644
--- a/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java
+++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java
@@ -16,21 +16,24 @@
  */
 package org.apache.oodt.cas.workflow.system;
 
-//OODT static imports
-import com.google.common.base.Preconditions;
-
 import org.apache.oodt.cas.metadata.Metadata;
 import org.apache.oodt.cas.workflow.engine.ThreadPoolWorkflowEngineFactory;
 import org.apache.oodt.cas.workflow.engine.WorkflowEngine;
 import org.apache.oodt.cas.workflow.repository.DataSourceWorkflowRepositoryFactory;
 import org.apache.oodt.cas.workflow.repository.WorkflowRepository;
-import org.apache.oodt.cas.workflow.structs.*;
+import org.apache.oodt.cas.workflow.structs.Workflow;
+import org.apache.oodt.cas.workflow.structs.WorkflowCondition;
+import org.apache.oodt.cas.workflow.structs.WorkflowInstance;
+import org.apache.oodt.cas.workflow.structs.WorkflowInstancePage;
+import org.apache.oodt.cas.workflow.structs.WorkflowTask;
 import org.apache.oodt.cas.workflow.structs.exceptions.EngineException;
 import org.apache.oodt.cas.workflow.structs.exceptions.InstanceRepositoryException;
 import org.apache.oodt.cas.workflow.structs.exceptions.RepositoryException;
 import org.apache.oodt.cas.workflow.util.XmlRpcStructFactory;
 import org.apache.xmlrpc.WebServer;
 
+import com.google.common.base.Preconditions;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -47,11 +50,6 @@ import java.util.logging.Logger;
 import static org.apache.oodt.cas.workflow.util.GenericWorkflowObjectFactory.getWorkflowEngineFromClassName;
 import static org.apache.oodt.cas.workflow.util.GenericWorkflowObjectFactory.getWorkflowRepositoryFromClassName;
 
-//Apache imports
-//OODT imports
-//JDK imports
-//Google imports
-
 /**
  * An XML RPC-based Workflow manager.
  *
@@ -70,8 +68,7 @@ public class XmlRpcWorkflowManager {
    public static final String ENGINE_RUNNER_FACTORY_PROPERTY = "workflow.engine.runner.factory";
    public static final String WORKFLOW_REPOSITORY_FACTORY_PROPERTY = "workflow.repo.factory";
 
-   private final int webServerPort;
-   private WebServer webServer;
+  private WebServer webServer;
    private final WorkflowEngine engine;
    private WorkflowRepository repo;
 
@@ -81,15 +78,14 @@ public class XmlRpcWorkflowManager {
 
    public XmlRpcWorkflowManager(int port) {
       Preconditions.checkArgument(port > 0, "Must specify a port greater than 0");
-      webServerPort = port;
 
-      engine = getWorkflowEngineFromProperty();
+     engine = getWorkflowEngineFromProperty();
       engine.setWorkflowManagerUrl(safeGetUrlFromString("http://"
-            + getHostname() + ":" + this.webServerPort));
+            + getHostname() + ":" + port));
       repo = getWorkflowRepositoryFromProperty();
 
       // start up the web server
-      webServer = new WebServer(webServerPort);
+      webServer = new WebServer(port);
       webServer.addHandler(XML_RPC_HANDLER_NAME, this);
       webServer.start();
 
@@ -607,7 +603,7 @@ public class XmlRpcWorkflowManager {
         }
 
         loadProperties();
-        XmlRpcWorkflowManager manager = new XmlRpcWorkflowManager(portNum);
+        new XmlRpcWorkflowManager(portNum);
 
         for (;;)
             try {

http://git-wip-us.apache.org/repos/asf/oodt/blob/2d6a7f5e/workflow/src/main/java/org/apache/oodt/cas/workflow/util/XmlRpcStructFactory.java
----------------------------------------------------------------------
diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/XmlRpcStructFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/XmlRpcStructFactory.java
index 9a7808c..00245d1 100644
--- a/workflow/src/main/java/org/apache/oodt/cas/workflow/util/XmlRpcStructFactory.java
+++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/util/XmlRpcStructFactory.java
@@ -154,14 +154,11 @@ public final class XmlRpcStructFactory {
       Metadata met = new Metadata();
       met.addMetadata((Hashtable) workflowInstance.get("sharedContext"));
       wInst.setSharedContext(met);
-    } else
+    } else {
       wInst.setSharedContext(new Metadata());
-
-    if (workflowInstance.get("priority") != null) {
-      Priority p = Priority.getPriority(Double
-          .valueOf((String) workflowInstance.get("priority")));
     }
 
+
     return wInst;
   }
 


[2/3] oodt git commit: close some input/output streams

Posted by ma...@apache.org.
close some input/output streams


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

Branch: refs/heads/master
Commit: c2ac62586ff2844021b8a7b0fbf8500e92dcc8fb
Parents: 2d6a7f5
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 30 10:09:42 2015 +0000
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 30 10:09:42 2015 +0000

----------------------------------------------------------------------
 .../cas/curation/service/MetadataResource.java   | 10 ++++++++--
 .../cas/curation/util/ExtractorConfigReader.java | 12 +++++++++---
 .../cas/curation/util/ExtractorConfigWriter.java | 12 +++++++++---
 .../catalog/MappedDataSourceCatalogFactory.java  |  9 ++++++++-
 .../oodt/cas/filemgr/ingest/CachedIngester.java  | 19 +++++++++++++++----
 5 files changed, 49 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/c2ac6258/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
----------------------------------------------------------------------
diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
index df43653..1335240 100644
--- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
+++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
@@ -52,6 +52,7 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
@@ -594,8 +595,13 @@ public class MetadataResource extends CurationService {
    */
   public void updateCatalogMetadata(Product product, Metadata newMetadata)
       throws CatalogException, IOException {
-    System.getProperties().load(
-        new FileInputStream(CurationService.config.getFileMgrProps()));
+    InputStream is = new FileInputStream(CurationService.config.getFileMgrProps());
+    try {
+      System.getProperties().load(is);
+    }
+    finally{
+      is.close();
+    }
     Catalog catalog = this.getCatalog();
     
     Metadata oldMetadata = catalog.getMetadata(product);

http://git-wip-us.apache.org/repos/asf/oodt/blob/c2ac6258/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigReader.java
----------------------------------------------------------------------
diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigReader.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigReader.java
index 54c341c..9f7f9e2 100644
--- a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigReader.java
+++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigReader.java
@@ -24,6 +24,7 @@ import org.apache.oodt.cas.metadata.util.PathUtils;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
@@ -33,9 +34,14 @@ public class ExtractorConfigReader {
       String configId) throws IOException {
     File propsFileDir = new File(directory, configId);
     Properties props = new Properties();
-    props
-        .load(new FileInputStream(new File(propsFileDir,
-        "config.properties")));
+    InputStream is = new FileInputStream(new File(propsFileDir,
+        "config.properties"));
+    try {
+      props.load(is);
+    }
+    finally{
+      is.close();
+    }
 
     String className = props.getProperty(ExtractorConfig.PROP_CLASS_NAME);
     List<File> files = new ArrayList<File>();

http://git-wip-us.apache.org/repos/asf/oodt/blob/c2ac6258/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigWriter.java
----------------------------------------------------------------------
diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigWriter.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigWriter.java
index 82b19fc..3ca26a5 100644
--- a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigWriter.java
+++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/ExtractorConfigWriter.java
@@ -23,6 +23,7 @@ import org.apache.oodt.cas.curation.structs.ExtractorConfig;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Properties;
 import java.util.Iterator;
 
@@ -42,9 +43,14 @@ public class ExtractorConfigWriter {
         files.append(",");
     }
     props.setProperty(ExtractorConfig.PROP_CONFIG_FILES, files.toString());
-    props
-        .store(new FileOutputStream(new File(configDir, "config.properties")),
-        "");
+    OutputStream os = new FileOutputStream(new File(configDir, "config.properties"));
+    try {
+      props
+          .store(os, "");
+    }
+    finally{
+      os.close();
+    }
   }
 
 }

http://git-wip-us.apache.org/repos/asf/oodt/blob/c2ac6258/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/MappedDataSourceCatalogFactory.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/MappedDataSourceCatalogFactory.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/MappedDataSourceCatalogFactory.java
index 75dcf3c..a31e49f 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/MappedDataSourceCatalogFactory.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/MappedDataSourceCatalogFactory.java
@@ -23,6 +23,7 @@ import org.apache.oodt.cas.metadata.util.PathUtils;
 //JDK imports
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Properties;
 
 
@@ -52,7 +53,13 @@ public class MappedDataSourceCatalogFactory extends DataSourceCatalogFactory {
         String mapFilePath = PathUtils.replaceEnvVariables(System
                 .getProperty(TYPE_MAP_KEY));
         Properties props = new Properties();
-        props.load(new FileInputStream(mapFilePath));
+        InputStream is = new FileInputStream(mapFilePath);
+        try {
+            props.load(is);
+        }
+        finally{
+            is.close();
+        }
         this.typeMap = props;
     }
 

http://git-wip-us.apache.org/repos/asf/oodt/blob/c2ac6258/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
index efb6a40..8e96be1 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
@@ -18,17 +18,20 @@
 package org.apache.oodt.cas.filemgr.ingest;
 
 //JDK imports
+
+import org.apache.oodt.cas.filemgr.structs.exceptions.CacheException;
+import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
+import org.apache.oodt.cas.filemgr.util.GenericFileManagerObjectFactory;
+
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.InputStream;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 //OODT imports
-import org.apache.oodt.cas.filemgr.structs.exceptions.CacheException;
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.util.GenericFileManagerObjectFactory;
 
 /**
  * @author mattmann
@@ -66,13 +69,21 @@ public class CachedIngester extends StdIngester {
     public CachedIngester(String transferService, String cacheServiceFactory,
             String cachePropFile) throws InstantiationException {
         super(transferService);
+
         try {
-            System.getProperties().load(new FileInputStream(cachePropFile));
+            InputStream is = new FileInputStream(cachePropFile);
+          try {
+            System.getProperties().load(is);
+          }
+          finally{
+            is.close();
+          }
         } catch (Exception e) {
             throw new InstantiationException(
                     "Unable to load cache properties from file: ["
                             + cachePropFile + "]");
         }
+
         this.cache = GenericFileManagerObjectFactory
                 .getCacheFromFactory(cacheServiceFactory);
         init(this.cache);


[3/3] oodt git commit: fix broken build

Posted by ma...@apache.org.
fix broken build


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

Branch: refs/heads/master
Commit: a720c48b0c6dad80bc0bc9d5ccb10cd63c5ac275
Parents: c2ac625
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 30 11:34:01 2015 +0000
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 30 11:34:01 2015 +0000

----------------------------------------------------------------------
 .../org/apache/oodt/pcs/input/PGEXMLFileUtils.java     | 13 +++++++------
 .../DataSourceWorkflowInstanceRepositoryFactory.java   |  2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/a720c48b/pcs/input/src/main/java/org/apache/oodt/pcs/input/PGEXMLFileUtils.java
----------------------------------------------------------------------
diff --git a/pcs/input/src/main/java/org/apache/oodt/pcs/input/PGEXMLFileUtils.java b/pcs/input/src/main/java/org/apache/oodt/pcs/input/PGEXMLFileUtils.java
index 0168d93..5839544 100644
--- a/pcs/input/src/main/java/org/apache/oodt/pcs/input/PGEXMLFileUtils.java
+++ b/pcs/input/src/main/java/org/apache/oodt/pcs/input/PGEXMLFileUtils.java
@@ -25,6 +25,7 @@ import org.xml.sax.InputSource;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -59,7 +60,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (matrixs.getLength()==0) {
-      return null;
+      return Collections.emptyMap();
     }
 
     Map matrixMap = new HashMap(matrixs.getLength());
@@ -123,7 +124,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (matrixs.getLength()==0) {
-      return null;
+      return Collections.emptyList();
     }
 
     List matrixList = new Vector(matrixs.getLength());
@@ -188,7 +189,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (scalars.getLength()==0) {
-      return null;
+      return Collections.emptyMap();
     }
 
     Map scalarMap = new HashMap(scalars.getLength());
@@ -216,7 +217,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (scalars.getLength()==0) {
-      return null;
+      return Collections.emptyList();
     }
 
     List scalarList = new Vector(scalars.getLength());
@@ -245,7 +246,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (vectors.getLength()==0) {
-      return null;
+      return Collections.emptyMap();
     }
 
     Map vectorMap = new HashMap(vectors.getLength());
@@ -289,7 +290,7 @@ public final class PGEXMLFileUtils {
 
     // if it's null, return null
     if (vectors.getLength()==0) {
-      return null;
+      return Collections.emptyList();
     }
 
     List vectorList = new Vector(vectors.getLength());

http://git-wip-us.apache.org/repos/asf/oodt/blob/a720c48b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
----------------------------------------------------------------------
diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
index 3b87a6c..be665c4 100644
--- a/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
+++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/instrepo/DataSourceWorkflowInstanceRepositoryFactory.java
@@ -76,7 +76,7 @@ public class DataSourceWorkflowInstanceRepositoryFactory implements
 
         GenericObjectPool connectionPool = new GenericObjectPool(null);
 
-        dataSource = new PoolingDataSource(connectionPool);o
+        dataSource = new PoolingDataSource(connectionPool);
         quoteFields = Boolean
                 .getBoolean("org.apache.oodt.cas.workflow.instanceRep.datasource.quoteFields");
         pageSize = Integer.getInteger(