Skip to content

Conversation

VineetReynolds
Copy link
Member

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.

…e 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, or is an Array. Transient and array field detection is required for generating the equals and hashCode methods.
@VineetReynolds
Copy link
Member Author

I've made some heavy updates to the Refactory class. Most of the changes involve supporting all primitive types, array types, and non-compatibility-breaking changes in the Java Parser API.

Modified the test suite to reflect these.

@lincolnthree
Copy link
Member

Hoooooly shit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is isPrimitive receiving a String type as an argument ?

Also added checks to prevent static fields from being used in the generated methods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be better to move this method to org.jboss.forge.parser.java.util.Strings class ?

@gastaldi
Copy link
Member

Perfect !

@VineetReynolds
Copy link
Member Author

Squashed and merged: 9b87cdb

@VineetReynolds VineetReynolds deleted the FORGE-1005 branch July 11, 2013 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants