Community
Participate
Working Groups
There is no reason why a class without instance variables cannot have an equals and hashcode. Here's what my class looks like: package com.thoughtworks.twist.core.resolver; public class BooleanResolver { public boolean canResolve(String type) { return "true".equalsIgnoreCase(type) || "false".equalsIgnoreCase(type); } } I'd expect the hashcode and equals generator to generate the following for me instead of telling me that eclipse cannot create the methods because my class does not have fields in this class. // can be shortened to "return 31" instead public int hashCode() { final int prime = 31; int result = 1; result = prime * result; return result; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; return true; }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Still an issue in 4.12 M1.