OODT-890 remove unrequired catch blocks
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/733436e8 Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/733436e8 Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/733436e8 Branch: refs/heads/master Commit: 733436e8b699b3b8e6ae2c03fe4fc671e33d848f Parents: 76dfbad Author: Tom Barber <[email protected]> Authored: Mon Oct 26 23:03:59 2015 +0000 Committer: Tom Barber <[email protected]> Committed: Mon Oct 26 23:03:59 2015 +0000 ---------------------------------------------------------------------- .../cas/filemgr/browser/model/QueryBuilder.java | 13 ++----------- .../XmlRpcCommunicationChannelClient.java | 4 +--- .../XmlRpcCommunicationChannelServer.java | 4 +--- .../system/impl/CatalogServiceLocal.java | 4 +--- .../oodt/cas/curation/util/DateUtils.java | 10 ++++------ .../catalog/solr/DefaultProductSerializer.java | 6 ++---- .../filemgr/datatransfer/S3DataTransferer.java | 2 -- .../oodt/cas/filemgr/tools/CatalogSearch.java | 13 ++----------- .../oodt/cas/filemgr/tools/QueryTool.java | 8 ++------ .../cli/action/TestIngestProductCliAction.java | 6 ------ .../apache/oodt/pcs/listing/ListingConf.java | 2 -- .../ofsn/OFSNFileHandlerConfiguration.java | 3 +-- .../apache/oodt/profile/gui/LeafListener.java | 8 -------- .../cas/protocol/sftp/TestJschSftpProtocol.java | 2 -- .../oodt/cas/pushpull/config/RemoteSpecs.java | 2 +- .../cas/resource/batchmgr/XmlRpcBatchMgr.java | 5 +---- .../resource/noderepo/XmlNodeRepository.java | 13 +++++-------- .../resource/queuerepo/XmlQueueRepository.java | 20 +++++++------------- .../engine/processor/WorkflowProcessor.java | 2 +- .../repository/XMLWorkflowRepository.java | 3 --- 20 files changed, 31 insertions(+), 99 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java ---------------------------------------------------------------------- diff --git a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java index ec8f58d..79097d4 100644 --- a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java +++ b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java @@ -62,11 +62,7 @@ public class QueryBuilder { org.apache.lucene.search.Query luceneQ) { if (luceneQ instanceof TermQuery) { Term t = ((TermQuery) luceneQ).getTerm(); - if (t.field().equals("__FREE__")) { - // if(casQuery.getCriteria().isEmpty()) casQuery.addCriterion(new - // FreeTextQueryCriteria()); - // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t.text()); - } else { + if (!t.field().equals("__FREE__")) { String element = database.getElementID(t.field()); if (!element.equals("") && !t.text().equals("")) { @@ -75,12 +71,7 @@ public class QueryBuilder { } } else if (luceneQ instanceof PhraseQuery) { Term[] t = ((PhraseQuery) luceneQ).getTerms(); - if (t[0].field().equals("__FREE__")) { - // if(casQuery.getCriteria().isEmpty()) casQuery.addCriterion(new - // FreeTextQueryCriteria()); - // for(int i=0;i<t.length;i++) - // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t[i].text()); - } else { + if (!t[0].field().equals("__FREE__")) { for (Term aT : t) { String element = database.getElementID(aT.field()); if (!element.equals("") && !aT.text().equals("")) { http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java index 2813dd2..0e2f26a 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java @@ -166,9 +166,7 @@ public class XmlRpcCommunicationChannelClient extends AbstractCommunicationChann int numBytes; while ((numBytes = is.read(buf, offset, chunkSize)) != -1) this.transferFile(new File(toURL.getPath()).getAbsolutePath(), buf, offset, numBytes); - }catch (Exception e) { - throw e; - }finally { + } finally { try { is.close(); }catch(Exception ignored) {} http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java index 77018b3..0b62850 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java @@ -144,9 +144,7 @@ public class XmlRpcCommunicationChannelServer extends fOut = new FileOutputStream(outFile, false); fOut.write(fileData, (int) offset, (int) numBytes); - }catch (Exception e) { - throw e; - }finally { + } finally { try { fOut.close(); }catch(Exception e) {} http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java index b545ce8..8cbf1f5 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java @@ -374,9 +374,7 @@ public class CatalogServiceLocal implements CatalogService { try { LOG.log(Level.INFO, "Deleting all index mappings for catalog '" + rmCatalog + "'"); this.ingestMapper.deleteAllMappingsForCatalog(catalogId); - }catch (Exception e) { - throw e; - }finally { + } finally { this.ingestMapperLock.writeLock().unlock(); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/curator/services/src/main/java/org/apache/oodt/cas/curation/util/DateUtils.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/DateUtils.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/DateUtils.java index 27cbad4..85f6d1f 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/util/DateUtils.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/util/DateUtils.java @@ -37,17 +37,15 @@ import java.util.Locale; */ public final class DateUtils { - public static SimpleDateFormat ISO8601FORMAT = new SimpleDateFormat( - "yyyy-MM-dd'T'HH:mm:ssZ"); - - public static SimpleDateFormat RFC822DATEFORMAT = new SimpleDateFormat( - "EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss' 'Z", Locale.US); - public static String getDateAsRFC822String(Date date) { + SimpleDateFormat RFC822DATEFORMAT = new SimpleDateFormat( + "EEE', 'dd' 'MMM' 'yyyy' 'HH:mm:ss' 'Z", Locale.US); return RFC822DATEFORMAT.format(date); } public static String getDateAsISO8601String(Date date) { + SimpleDateFormat ISO8601FORMAT = new SimpleDateFormat( + "yyyy-MM-dd'T'HH:mm:ssZ"); String result = ISO8601FORMAT.format(date); // convert YYYYMMDDTHH:mm:ss+HH00 into YYYYMMDDTHH:mm:ss+HH:00 // - note the added colon for the Timezone http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/solr/DefaultProductSerializer.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/solr/DefaultProductSerializer.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/solr/DefaultProductSerializer.java index f758b4f..74e070c 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/solr/DefaultProductSerializer.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/solr/DefaultProductSerializer.java @@ -489,10 +489,8 @@ public class DefaultProductSerializer implements ProductSerializer { * @param metadata : the metadata container */ protected void deserializeSingleValueField(String name, String value, Metadata metadata) { - - if (name.equals(Parameters.ID)) { - // ignore Solr internal identifier (as it is duplicate information of CAS.ProductId) - } else { + // ignore Solr internal identifier (as it is duplicate information of CAS.ProductId) + if (!name.equals(Parameters.ID)){ metadata.addMetadata(name, value); } http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java index 4af138b..1c813f1 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/datatransfer/S3DataTransferer.java @@ -115,8 +115,6 @@ public class S3DataTransferer implements DataTransfer { outStream = new FileOutputStream(new File(directory, new File( stripProtocol(ref.getDataStoreReference(), false)).getName())); IOUtils.copy(inStream, outStream); - } catch (IOException e) { - throw e; } finally { try { inStream.close(); } catch (Exception e) {} try { outStream.close(); } catch (Exception e) {} http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/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 da2fe5a..bf01039 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 @@ -244,22 +244,13 @@ public class CatalogSearch { Query luceneQuery) { if (luceneQuery instanceof TermQuery) { Term t = ((TermQuery) luceneQuery).getTerm(); - if (t.field().equals(freeTextBlock)) { - // if(casQuery.getCriteria().isEmpty()) - // casQuery.addCriterion(new FreeTextQueryCriteria()); - // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t.text()); - } else { + if (!t.field().equals(freeTextBlock)) { casQuery .addCriterion(new TermQueryCriteria(t.field(), t.text())); } } else if (luceneQuery instanceof PhraseQuery) { Term[] t = ((PhraseQuery) luceneQuery).getTerms(); - if (t[0].field().equals(freeTextBlock)) { - // if(casQuery.getCriteria().isEmpty()) - // casQuery.addCriterion(new FreeTextQueryCriteria()); - // for(int i=0;i<t.length;i++) - // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t[i].text()); - } else { + if (!t[0].field().equals(freeTextBlock)) { for (Term aT : t) { casQuery.addCriterion(new TermQueryCriteria(aT.field(), aT.text())); http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/QueryTool.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/QueryTool.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/QueryTool.java index 1a3174d..e36c262 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/QueryTool.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/tools/QueryTool.java @@ -129,17 +129,13 @@ public final class QueryTool { Query luceneQuery) { if (luceneQuery instanceof TermQuery) { Term t = ((TermQuery) luceneQuery).getTerm(); - if (t.field().equals(freeTextBlock)) { - // nothing for now - } else { + if (!t.field().equals(freeTextBlock)) { casQuery.addCriterion(new TermQueryCriteria(t.field(), t.text())); } } else if (luceneQuery instanceof PhraseQuery) { Term[] t = ((PhraseQuery) luceneQuery).getTerms(); - if (t[0].field().equals(freeTextBlock)) { - // nothing for now - } else { + if (!t[0].field().equals(freeTextBlock)) { for (Term aT : t) { casQuery.addCriterion(new TermQueryCriteria( aT.field(), aT.text())); http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/filemgr/src/test/java/org/apache/oodt/cas/filemgr/cli/action/TestIngestProductCliAction.java ---------------------------------------------------------------------- diff --git a/filemgr/src/test/java/org/apache/oodt/cas/filemgr/cli/action/TestIngestProductCliAction.java b/filemgr/src/test/java/org/apache/oodt/cas/filemgr/cli/action/TestIngestProductCliAction.java index 7655f54..ae96fd8 100644 --- a/filemgr/src/test/java/org/apache/oodt/cas/filemgr/cli/action/TestIngestProductCliAction.java +++ b/filemgr/src/test/java/org/apache/oodt/cas/filemgr/cli/action/TestIngestProductCliAction.java @@ -261,8 +261,6 @@ public class TestIngestProductCliAction extends TestCase { ps.println(" <val>" + NOMINAL_DATE_MET_VAL + "</val>"); ps.println(" </keyval>"); ps.println("</cas:metadata>"); - } catch (IOException e) { - throw e; } finally { ps.close(); } @@ -277,8 +275,6 @@ public class TestIngestProductCliAction extends TestCase { try { ps = new PrintStream(new FileOutputStream(new File(reference, subRef))); ps.println("This is a test sub-reference file"); - } catch (IOException e) { - throw e; } finally { ps.close(); } @@ -293,8 +289,6 @@ public class TestIngestProductCliAction extends TestCase { try { ps = new PrintStream(new FileOutputStream(reference)); ps.println("This is a test sub-reference file"); - } catch (IOException e) { - throw e; } finally { ps.close(); } http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/pcs/core/src/main/java/org/apache/oodt/pcs/listing/ListingConf.java ---------------------------------------------------------------------- diff --git a/pcs/core/src/main/java/org/apache/oodt/pcs/listing/ListingConf.java b/pcs/core/src/main/java/org/apache/oodt/pcs/listing/ListingConf.java index a649cde..4d86e04 100644 --- a/pcs/core/src/main/java/org/apache/oodt/pcs/listing/ListingConf.java +++ b/pcs/core/src/main/java/org/apache/oodt/pcs/listing/ListingConf.java @@ -58,8 +58,6 @@ public class ListingConf { InstantiationException { try { this.conf = new PGEConfigFileReader().read(new FileInputStream(file)); - } catch (FileNotFoundException e) { - throw e; } catch (PGEConfigFileException e) { throw new InstantiationException(e.getMessage()); } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandlerConfiguration.java ---------------------------------------------------------------------- diff --git a/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandlerConfiguration.java b/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandlerConfiguration.java index 5e8b73d..3b5ffbe 100644 --- a/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandlerConfiguration.java +++ b/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandlerConfiguration.java @@ -124,7 +124,6 @@ public class OFSNFileHandlerConfiguration { } private void cleanse(String path) { - if (path != null && !path.endsWith("/")) { - } + } } http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/profile/src/main/java/org/apache/oodt/profile/gui/LeafListener.java ---------------------------------------------------------------------- diff --git a/profile/src/main/java/org/apache/oodt/profile/gui/LeafListener.java b/profile/src/main/java/org/apache/oodt/profile/gui/LeafListener.java index 2ba8e01..83ac3af 100755 --- a/profile/src/main/java/org/apache/oodt/profile/gui/LeafListener.java +++ b/profile/src/main/java/org/apache/oodt/profile/gui/LeafListener.java @@ -241,11 +241,7 @@ public class LeafListener extends MouseAdapter{ if(e.isPopupTrigger()){ popup.show(tree,e.getX(),e.getY()); } - else{ - //System.out.println("Wasn't popup trigger!"); - } - //} } } @@ -278,11 +274,7 @@ public class LeafListener extends MouseAdapter{ if(e.isPopupTrigger()){ popup.show(tree,e.getX(),e.getY()); } - else{ - //System.out.println("Wasn't popup trigger!"); - } - //} } } http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/protocol/sftp/src/test/java/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java ---------------------------------------------------------------------- diff --git a/protocol/sftp/src/test/java/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java b/protocol/sftp/src/test/java/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java index 3bded2d..f1d6d74 100644 --- a/protocol/sftp/src/test/java/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java +++ b/protocol/sftp/src/test/java/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java @@ -279,8 +279,6 @@ public class TestJschSftpProtocol extends TestCase { ps.println(nextLine.replace("2022", Integer.toString(port))); } return publicKeyFile; - } catch (IOException e) { - throw e; } finally { try { ps.close(); } catch (Exception ingore) {} try { br.close(); } catch (Exception ingore) {} http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/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 b39eb20..add1466 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 @@ -110,7 +110,7 @@ public class RemoteSpecs implements ConfigParserMetKeys { .getAttribute(FIRSTRUN_DATETIME_ATTR); period = runInfo.getAttribute(PERIOD_ATTR); runOnReboot = (runInfo.getAttribute(RUNONREBOOT_ATTR) - .toLowerCase().equals("yes")) ? true : false; + .toLowerCase().equals("yes")); epsilon = runInfo.getAttribute(EPSILON_ATTR); if (epsilon.equals("")) epsilon = "0s"; http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/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 4f5fa4c..3c7c28b 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 @@ -177,8 +177,6 @@ public class XmlRpcBatchMgr implements Batchmgr { synchronized (this.specToProxyMap) { XmlRpcBatchMgrProxy proxy = (XmlRpcBatchMgrProxy) this.specToProxyMap .remove(spec.getJob().getId()); - if (proxy != null) { - } } try { @@ -197,8 +195,7 @@ public class XmlRpcBatchMgr implements Batchmgr { synchronized (this.specToProxyMap) { XmlRpcBatchMgrProxy proxy = (XmlRpcBatchMgrProxy) this.specToProxyMap .remove(spec.getJob().getId()); - if (proxy != null) { - } + } try { http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/resource/src/main/java/org/apache/oodt/cas/resource/noderepo/XmlNodeRepository.java ---------------------------------------------------------------------- diff --git a/resource/src/main/java/org/apache/oodt/cas/resource/noderepo/XmlNodeRepository.java b/resource/src/main/java/org/apache/oodt/cas/resource/noderepo/XmlNodeRepository.java index fd31062..e0ad30f 100644 --- a/resource/src/main/java/org/apache/oodt/cas/resource/noderepo/XmlNodeRepository.java +++ b/resource/src/main/java/org/apache/oodt/cas/resource/noderepo/XmlNodeRepository.java @@ -18,11 +18,13 @@ package org.apache.oodt.cas.resource.noderepo; //OODT imports -import org.apache.oodt.commons.xml.XMLUtils; import org.apache.oodt.cas.resource.structs.ResourceNode; import org.apache.oodt.cas.resource.util.XmlStructFactory; +import org.apache.oodt.commons.xml.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; -//JDK imports import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; @@ -34,10 +36,8 @@ import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; +//JDK imports //DOM imports -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; /** * @@ -76,9 +76,6 @@ public class XmlNodeRepository implements NodeRepository { String nodesDirStr = nodesDir.getAbsolutePath(); - if (!nodesDirStr.endsWith("/")) { - } - // get all the workflow xml files File[] nodesFiles = nodesDir.listFiles(nodesXmlFilter); http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/resource/src/main/java/org/apache/oodt/cas/resource/queuerepo/XmlQueueRepository.java ---------------------------------------------------------------------- diff --git a/resource/src/main/java/org/apache/oodt/cas/resource/queuerepo/XmlQueueRepository.java b/resource/src/main/java/org/apache/oodt/cas/resource/queuerepo/XmlQueueRepository.java index 0988f4a..b8671cc 100644 --- a/resource/src/main/java/org/apache/oodt/cas/resource/queuerepo/XmlQueueRepository.java +++ b/resource/src/main/java/org/apache/oodt/cas/resource/queuerepo/XmlQueueRepository.java @@ -18,11 +18,13 @@ package org.apache.oodt.cas.resource.queuerepo; //OODT imports -import org.apache.oodt.commons.xml.XMLUtils; import org.apache.oodt.cas.resource.scheduler.QueueManager; import org.apache.oodt.cas.resource.util.XmlStructFactory; +import org.apache.oodt.commons.xml.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; -//JDK imports import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; @@ -34,10 +36,8 @@ import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; +//JDK imports //DOM imports -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; /** * @@ -78,19 +78,13 @@ public class XmlQueueRepository implements QueueRepository { File nodesDir = new File(new URI(dirUri)); if (nodesDir.isDirectory()) { - String nodesDirStr = nodesDir.getAbsolutePath(); - - if (!nodesDirStr.endsWith("/")) { - } // get all the workflow xml files File[] nodesFiles = nodesDir.listFiles(queuesXmlFilter); for (File nodesFile : nodesFiles) { - String nodesXmlFile = nodesFile - .getAbsolutePath(); - Document nodesRoot = null; + Document nodesRoot; try { nodesRoot = XMLUtils .getDocumentRoot(new FileInputStream( @@ -109,7 +103,7 @@ public class XmlQueueRepository implements QueueRepository { String nodeId = ((Element) nodeList.item(k)) .getAttribute("id"); Vector assignments = (Vector) XmlStructFactory - .getQueueAssignment((Element) nodeList + .getQueueAssignment(onodeList .item(k)); for (Object assignment : assignments) { try { http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessor.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessor.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessor.java index 3c4b086..64031d2 100755 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessor.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/processor/WorkflowProcessor.java @@ -235,7 +235,7 @@ public abstract class WorkflowProcessor implements WorkflowProcessorListener, } } - } else if (this.isDone().getName().equals("ResultsFailure")) { + } else if (this.iusDone().getName().equals("ResultsFailure")) { // do nothing -- this workflow failed!!! } else if (this.isDone().getName().equals("ResultsBail")) { for (WorkflowProcessor subProcessor : this.getRunnableSubProcessors()) http://git-wip-us.apache.org/repos/asf/oodt/blob/733436e8/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/XMLWorkflowRepository.java ---------------------------------------------------------------------- diff --git a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/XMLWorkflowRepository.java b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/XMLWorkflowRepository.java index 361dcaf..f0eb8ee 100644 --- a/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/XMLWorkflowRepository.java +++ b/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/XMLWorkflowRepository.java @@ -531,10 +531,7 @@ public class XMLWorkflowRepository implements WorkflowRepository { try { File workflowDir = new File(new URI(dirUri)); if (workflowDir.isDirectory()) { - String workflowDirStr = workflowDir.getAbsolutePath(); - if (!workflowDirStr.endsWith("/")) { - } // get all the workflow xml files File[] workflowFiles = workflowDir
