manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1603136 - /manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java
Date Tue, 17 Jun 2014 11:54:14 GMT
Author: kwright
Date: Tue Jun 17 11:54:14 2014
New Revision: 1603136

URL: http://svn.apache.org/r1603136
Log:
Fix more bugs

Modified:
    manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java

Modified: manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java?rev=1603136&r1=1603135&r2=1603136&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java
(original)
+++ manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/PipelineManager.java
Tue Jun 17 11:54:14 2014
@@ -172,24 +172,14 @@ public class PipelineManager extends org
     StringBuilder query = new StringBuilder("SELECT ");
     query.append(transformationNameField).append(" FROM ").append(getTableName()).append("
WHERE ");
     query.append(buildConjunctionClause(newList,new ClauseDescription[]{
-      new UnitaryClause(ownerIDField,ownerID)}));
+      new UnitaryClause(ownerIDField,ownerID),
+      new NullCheckClause(transformationNameField,false)}));
     IResultSet set = performQuery(query.toString(),newList,null,null);
-    int count = 0;
+    String[] rval = new String[set.getRowCount()];
     for (int i = 0; i < set.getRowCount(); i++)
     {
       IResultRow row = set.getRow(i);
-      String value = (String)row.getValue(transformationNameField);
-      if (value != null && value.length() > 0)
-        count++;
-    }
-    String[] rval = new String[count];
-    count = 0;
-    for (int i = 0; i < set.getRowCount(); i++)
-    {
-      IResultRow row = set.getRow(i);
-      String value = (String)row.getValue(transformationNameField);
-      if (value != null && value.length() > 0)
-        rval[count++] = value;
+      rval[i] = (String)row.getValue(transformationNameField);
     }
     return rval;
   }
@@ -203,26 +193,16 @@ public class PipelineManager extends org
   {
     ArrayList newList = new ArrayList();
     StringBuilder query = new StringBuilder("SELECT ");
-    query.append(transformationNameField).append(" FROM ").append(getTableName()).append("
WHERE ");
+    query.append(outputNameField).append(" FROM ").append(getTableName()).append(" WHERE
");
     query.append(buildConjunctionClause(newList,new ClauseDescription[]{
-      new UnitaryClause(ownerIDField,ownerID)}));
+      new UnitaryClause(ownerIDField,ownerID),
+      new NullCheckClause(outputNameField,false)}));
     IResultSet set = performQuery(query.toString(),newList,null,null);
-    int count = 0;
-    for (int i = 0; i < set.getRowCount(); i++)
-    {
-      IResultRow row = set.getRow(i);
-      String value = (String)row.getValue(outputNameField);
-      if (value != null && value.length() > 0)
-        count++;
-    }
-    String[] rval = new String[count];
-    count = 0;
+    String[] rval = new String[set.getRowCount()];
     for (int i = 0; i < set.getRowCount(); i++)
     {
       IResultRow row = set.getRow(i);
-      String value = (String)row.getValue(outputNameField);
-      if (value != null && value.length() > 0)
-        rval[count++] = value;
+      rval[i] = (String)row.getValue(outputNameField);
     }
     return rval;
   }



Mime
View raw message