CAMEL-8052 Improve comments and javadoc related to RemoveProperties

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

Branch: refs/heads/master
Commit: 78a3f601b48b3bf1205b0094b0d10703072cdd9c
Parents: 29ba4c3
Author: ancosen <anco...@gmail.com>
Authored: Sat Nov 15 17:15:22 2014 +0100
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Mon Nov 17 12:06:38 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/Exchange.java    | 35 ++++++++++----------
 .../apache/camel/model/ProcessorDefinition.java |  4 +--
 .../RemovePropertiesWithExclusionTest.java      |  2 +-
 .../RemovePropertiesWithoutExclusionTest.java   |  2 +-
 4 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/78a3f601/camel-core/src/main/java/org/apache/camel/Exchange.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/Exchange.java 
b/camel-core/src/main/java/org/apache/camel/Exchange.java
index d8e5a4c..317cbfc 100644
--- a/camel-core/src/main/java/org/apache/camel/Exchange.java
+++ b/camel-core/src/main/java/org/apache/camel/Exchange.java
@@ -292,6 +292,24 @@ public interface Exchange {
     Object removeProperty(String name);
 
     /**
+     * Remove all of the properties associated with the exchange matching a 
specific pattern
+     *
+     * @param pattern pattern of names
+     * @return boolean whether any properties matched
+     */
+    boolean removeProperties(String pattern);
+    
+    /**
+     * Removes the properties from this exchange that match the given 
<tt>pattern</tt>, 
+     * except for the ones matching one ore more <tt>excludePatterns</tt>
+     * 
+     * @param pattern pattern of names that should be removed
+     * @param excludePatterns one or more pattern of properties names that 
should be excluded (= preserved)
+     * @return boolean whether any properties matched
+     */ 
+    boolean removeProperties(String pattern, String... excludePatterns);
+    
+    /**
      * Returns all of the properties associated with the exchange
      *
      * @return all the headers in a Map
@@ -533,22 +551,5 @@ public interface Exchange {
      */
     List<Synchronization> handoverCompletions();
     
-    /**
-     * Remove all of the properties associated with the exchange matching a 
specific pattern
-     *
-     * @param pattern pattern of names
-     * @return boolean whether any properties matched
-     */
-    boolean removeProperties(String pattern);
-    
-    /**
-     * Removes the properties from this exchange that match the given 
<tt>pattern</tt>, 
-     * except for the ones matching one ore more <tt>excludePatterns</tt>
-     * 
-     * @param pattern pattern of names that should be removed
-     * @param excludePatterns one or more pattern of properties names that 
should be excluded (= preserved)
-     * @return boolean whether any properties matched
-     */ 
-    boolean removeProperties(String pattern, String... excludePatterns);
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/78a3f601/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java 
b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
index cf37350..32d815c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
@@ -2877,7 +2877,7 @@ public abstract class ProcessorDefinition<Type extends 
ProcessorDefinition<Type>
     /**
      * Adds a processor which removes the properties in the exchange
      *
-     * @param pattern  a pattern to match properties names to be removed
+     * @param pattern a pattern to match properties names to be removed
      * @return the builder
      */
     @SuppressWarnings("unchecked")
@@ -2890,7 +2890,7 @@ public abstract class ProcessorDefinition<Type extends 
ProcessorDefinition<Type>
     /**
      * Adds a processor which removes the properties in the exchange
      *
-     * @param pattern  a pattern to match properties names to be removed
+     * @param pattern a pattern to match properties names to be removed
      * @param excludePatterns one or more pattern of properties names that 
should be excluded (= preserved)
      * @return the builder
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/78a3f601/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithExclusionTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithExclusionTest.java
 
b/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithExclusionTest.java
index 058681c..7e255dc 100644
--- 
a/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithExclusionTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithExclusionTest.java
@@ -58,7 +58,7 @@ public class RemovePropertiesWithExclusionTest extends 
ContextTestSupport {
         List<Exchange> endExchanges = end.getExchanges();
         Exchange endExchange = endExchanges.get(0);
         
-        // property should be removed
+        // properties should be removed but the last still have to be in the 
exchange
         assertNull(endExchange.getProperty(propertyName, String.class));
         assertNull(endExchange.getProperty(propertyName1, String.class));
         assertEquals(expectedPropertyValue2, 
endExchange.getProperty(propertyName2, String.class));

http://git-wip-us.apache.org/repos/asf/camel/blob/78a3f601/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithoutExclusionTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithoutExclusionTest.java
 
b/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithoutExclusionTest.java
index 698d7b1..4f6749e 100644
--- 
a/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithoutExclusionTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/processor/RemovePropertiesWithoutExclusionTest.java
@@ -53,7 +53,7 @@ public class RemovePropertiesWithoutExclusionTest extends 
ContextTestSupport {
         List<Exchange> endExchanges = end.getExchanges();
         Exchange endExchange = endExchanges.get(0);
         
-        // property should be removed
+        // properties should be removed
         assertNull(endExchange.getProperty(propertyName, String.class));
         assertNull(endExchange.getProperty(propertyName1, String.class));
     }

Reply via email to