[forge-commits] [forge/java-parser] 9b87cd: FORGE-1005 Modified equals/hashcode generators to ...

Vineet Reynolds Vineet.Reynolds at gmail.com
Thu Jul 11 14:27:04 EDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/forge/java-parser
  Commit: 9b87cdb3a537faa49a65b84e2c2456df01d16bee
      https://github.com/forge/java-parser/commit/9b87cdb3a537faa49a65b84e2c2456df01d16bee
  Author: Vineet Reynolds <Vineet.Reynolds at gmail.com>
  Date:   2013-07-11 (Thu, 11 Jul 2013)

  Changed paths:
    M api/src/main/java/org/jboss/forge/parser/java/Field.java
    M api/src/main/java/org/jboss/forge/parser/java/util/Refactory.java
    M api/src/main/java/org/jboss/forge/parser/java/util/Strings.java
    M impl/src/main/java/org/jboss/forge/parser/java/impl/FieldImpl.java
    M impl/src/test/java/org/jboss/forge/test/parser/java/FieldTest.java
    M impl/src/test/java/org/jboss/forge/test/parser/java/util/RefactoryTest.java

  Log Message:
  -----------
  FORGE-1005 Modified equals/hashcode generators to consider inheritance hierarchies.

The generator now includes a delegation to super.hashCode() and super.equals() when a super class not of type Object is detected for the provided class.

Additionally, bugs in the earlier equals generator were fixed. The equals method no longer returns immediately when the first field is equal. Additionally, instanceof is used to verify that the Class instances are equal to account for subclasses, thereby ensuring that proxied instances are also equal.

Changes were also done to incorporate new methods in the Field API. Methods are now available to detect if a field is transient or volatile.





More information about the forge-commits mailing list