Right now none of the pluto descriptor objects override equals and hashCode. This makes doing comparison of the value of the objects difficult. Would the pluto developers be open to me submitting a patch that adds the methods to all DD objects to do value equality checking based on the properties of each object? There are several places that I have to compare DD objects and currently have all of the logic to compare the entire tree. It would also greatly simplify the descriptor parsing unit tests.

-Eric


Example:

public class CustomPortletModeDD {

   private List descriptions = new ArrayList();

   private String portletMode;

   /* (non-Javadoc)
    * @see java.lang.Object#equals(java.lang.Object)
    */
   public boolean equals(Object obj) {
       if (this == obj) {
           return true;
       }
       if (!(obj instanceof CustomPortletModeDD)) {
           return false;
       }
final CustomPortletModeDD other = (CustomPortletModeDD)obj; return (this.portletMode == null ? other.portletMode == null : this.portletMode.equals(other.portletMode)) && (this.descriptions == null ? other.descriptions == null : this.descriptions.equals(other.descriptions));
   }

   /* (non-Javadoc)
    * @see java.lang.Object#hashCode()
    */
   public int hashCode() {
       int result = 17;
result = 37 * result + (this.portletMode == null ? 0 : this.portletMode.hashCode()); result = 37 * result + (this.descriptions == null ? 0 : this.descriptions.hashCode());
       return result;
   }
}

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to