commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nutty...@apache.org
Subject svn commit: r442595 - /jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java
Date Tue, 12 Sep 2006 14:38:18 GMT
Author: nuttycom
Date: Tue Sep 12 07:38:18 2006
New Revision: 442595

URL: http://svn.apache.org/viewvc?view=rev&rev=442595
Log:
Added IllegalStateException for missing branch pipeline and accessor method for parent. Patch
provided by Steve Christensen.

Modified:
    jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java

Modified: jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java?view=diff&rev=442595&r1=442594&r2=442595
==============================================================================
--- jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java
(original)
+++ jakarta/commons/sandbox/pipeline/trunk/src/main/java/org/apache/commons/pipeline/Pipeline.java
Tue Sep 12 07:38:18 2006
@@ -159,6 +159,10 @@
      * @return the feeder for the specified branch
      */
     public Feeder getBranchFeeder(String branch) {
+        if (!getBranches().containsKey(branch)) {
+            throw new IllegalStateException("Unable to find branch in pipeline: '" + branch
+ "'");
+        }
+
         return branches.get(branch).getSourceFeeder();
     }
     
@@ -359,4 +363,12 @@
     public void setValidator(PipelineValidator validator) {
         this.validator = validator;
     }
-}
\ No newline at end of file
+
+    /**
+     * Returns the parent of this pipeline, if it is a branch
+     * @return parent Pipeline, or null if this is the main pipeline
+     */
+    public Pipeline getParent() {
+        return parent;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message