Closed godspeedyou closed 9 years ago
i will implement it.
you will get a checkBox in Preferences which behave like is checked then use Java7 java.util.Objects if unchecked then use guava
by default it will be unchecked
feature is implemented and as snapshot available under https://sourceforge.net/projects/guavaeclipse/files/SNAPSHOTS/UpdateSite/LATEST/
for a full release a i will add some more integration tests
Thanks for implementing this.
I have 2 notes:
hi,
As default "Use java.util.Objects..." is ticked in the settings. But guava is used. To use java.util.Objects I had to untick and retick it.
Looks like you found a bug in the way i handle preferences... can you tell me what eclipse version you use? I open a separate issue #37
When using java.util.Objects the guava methods (equals, hash) are used instead of the java.util.Objects methods (equal, hashCode).
Sorry but I don't get the point. the generated code should call this method: java.util.Objects.equals(Object, Object) there is no equal Method in java.util.Objects and for hashCode this method should be used java.util.Objects.hash(Object...) maybe you want to use java.util.Objects.hashCode(Object) when you only have one field. this would be a new feature request. would you open one feature request if this what you want.
1.I'm using Version: Oxygen.1 (4.7.1) Build id: M20170906-1700
2.You are correct. There's no equal-method in java.util.Objects. I mixed the method names up. I meant: When using java.util.Objects the guava methods (equal, hashCode) are used instead of the java.util.Objects methods (equals, hash).
Nevermind, I just tried it again, and it works for me now. I must have had problems with existing Guava objects methods within the class I wanted to generate a new equals method. The existing import wasn't removed and interferred with the generated code. So I guess both issues I mentioned are my faux pas.
It would be great, if you could offer an option to choose java.util.Objects methods for equals- and hashCode-generation.