bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r999707 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java
Date Wed, 22 Sep 2010 01:04:26 GMT
Author: mbenson
Date: Wed Sep 22 01:04:25 2010
New Revision: 999707

URL: http://svn.apache.org/viewvc?rev=999707&view=rev
Log:
simplify Group.equals(Object) implementation

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java?rev=999707&r1=999706&r2=999707&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java
Wed Sep 22 01:04:25 2010
@@ -20,10 +20,12 @@ package org.apache.bval.jsr303.groups;
 
 import javax.validation.groups.Default;
 
+import org.apache.commons.lang3.ObjectUtils;
+
 /**
  * Immutable object that wraps an interface representing a single group.
  */
-public class Group {
+public final class Group {
     /**
      * the Default Group
      */
@@ -69,11 +71,8 @@ public class Group {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        Group group1 = (Group) o;
-
-        return !(group != null ? !group.equals(group1.group) : group1.group != null);
+        if (o instanceof Group == false) return false;
+        return ObjectUtils.equals(group, ((Group) o).group);
     }
 
     /**



Mime
View raw message