GuavaEclipsePlugin / GuavaEclipsePluginParent

"Guava Eclipse Plugin" is an eclipse plugin which will generate following methods using Google guava utility classes or jdk utility classes toString() [STRG + SHIFT + 4] - equals(Object object) & hashCode() [STRG + SHIFT + 5] - compareTo(...) [STRG + SHIFT + 6]
https://guavaeclipseplugin.github.io/
10 stars 4 forks source link

provide setting to optionally use getters #1

Closed arolfes closed 9 years ago

arolfes commented 9 years ago

A well known pattern says to not use direct member access in equals/hashCode if you are using Hibernate with lazy loading, as proxy members may not be directly available. Instead, an option to use the field getters in hashCode and equals would make this plug-in more versatile

arolfes commented 9 years ago

Fixed in latest snapshot (1.2.0.201412272210)

When you select the getter option in the preferencePage it uses getter methods when existing, otherwise it uses the field directly...

see testcase results https://sourceforge.net/p/guavaeclipse/GuavaEclipseHelper/ci/master/tree/GuavaEclipseSwtBotTest/src/main/resources/equalsHashCodeResults/Expected_EqualsHashCode_Getter.txt