You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sa...@apache.org on 2007/04/21 06:48:31 UTC

svn commit: r530983 - in /webservices/commons/trunk/modules/neethi: RELEASE-NOTE.txt src/main/java/org/apache/neethi/PolicyComponent.java src/main/java/org/apache/neethi/util/PolicyComparator.java

Author: sanka
Date: Fri Apr 20 21:48:30 2007
New Revision: 530983

URL: http://svn.apache.org/viewvc?view=rev&rev=530983
Log:
Fixed PolicyComparator.compare(Policy,Policy) method to check the Name 
and the Id of the arguments when comparing.

Fixed a typo in the PolicyComparator class.


Modified:
    webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt
    webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyComponent.java
    webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java

Modified: webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt?view=diff&rev=530983&r1=530982&r2=530983
==============================================================================
--- webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt (original)
+++ webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt Fri Apr 20 21:48:30 2007
@@ -1,5 +1,7 @@
 
-Apache Commons Neethi-2.0 Release Note:
+Apache Commons Neethi-2.0.1 Release Note:
+
+Contains the fix for WSCOMMONS-178.
 
 Feature List:
 
@@ -16,11 +18,4 @@
 the generic framework
 
 Provides more control to the assertion authors to control behavior of the 
-assertions they implement
-
-
-
-
-
-
-
+assertions they implement.

Modified: webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyComponent.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyComponent.java?view=diff&rev=530983&r1=530982&r2=530983
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyComponent.java (original)
+++ webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyComponent.java Fri Apr 20 21:48:30 2007
@@ -38,7 +38,7 @@
      *
      * @return Constants.POLICY for Policy type PolicyComponent
      *         Constants.EXACTLYONE for ExactlyOne type PolicyComponent
-     *         Constants.All for All type PolicyComponent
+     *         Constants.ALL for All type PolicyComponent
      *         Constants.ASSERTION for Assertion type PolicyComponent
      */
     public short getType();

Modified: webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java?view=diff&rev=530983&r1=530982&r2=530983
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java (original)
+++ webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java Fri Apr 20 21:48:30 2007
@@ -41,6 +41,42 @@
      * @return <tt>true</tt> if both policies have the same semantics
      */
     public static boolean compare(Policy arg1, Policy arg2) {
+        
+        // check Name attributes of each policies
+        if (arg1.getName() != null) {
+            
+            if (arg2.getName() != null) {
+                arg1.getName().equals(arg2.getName());
+                
+            } else {
+                return false;
+            }
+            
+        } else {
+            
+            if (arg2.getName() != null) {
+                return false;                
+            }
+        }
+        
+        
+        // check Id attributes of each policies
+        if (arg1.getId() != null) {
+            
+            if (arg2.getId() != null) {
+                arg1.getId().equals(arg2.getId());
+                
+            } else {
+                return false;
+            }
+            
+        } else {
+            
+            if (arg2.getId() != null) {
+                return false;
+            }
+        }
+        
         return compare(arg1.getPolicyComponents(), arg2.getPolicyComponents());
     }
 



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