aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
index 7c0980c8..2c636916 100644
--- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
+++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
@@ -204,32 +204,32 @@ public class HandleEqualsAndHashCode implements EclipseAnnotationHandler<EqualsA
}
}
- switch (methodExists("hashCode", typeNode)) {
+ switch (methodExists("equals", typeNode)) {
case NOT_EXISTS:
- MethodDeclaration hashCode = createHashCode(typeNode, nodesForEquality, callSuper, errorNode.get());
- injectMethod(typeNode, hashCode);
+ MethodDeclaration equals = createEquals(typeNode, nodesForEquality, callSuper, errorNode.get());
+ injectMethod(typeNode, equals);
break;
case EXISTS_BY_LOMBOK:
break;
default:
case EXISTS_BY_USER:
if (whineIfExists) {
- errorNode.addWarning("Not generating hashCode(): A method with that name already exists");
+ errorNode.addWarning("Not generating equals(Object other): A method with that name already exists");
}
break;
}
- switch (methodExists("equals", typeNode)) {
+ switch (methodExists("hashCode", typeNode)) {
case NOT_EXISTS:
- MethodDeclaration equals = createEquals(typeNode, nodesForEquality, callSuper, errorNode.get());
- injectMethod(typeNode, equals);
+ MethodDeclaration hashCode = createHashCode(typeNode, nodesForEquality, callSuper, errorNode.get());
+ injectMethod(typeNode, hashCode);
break;
case EXISTS_BY_LOMBOK:
break;
default:
case EXISTS_BY_USER:
if (whineIfExists) {
- errorNode.addWarning("Not generating equals(Object other): A method with that name already exists");
+ errorNode.addWarning("Not generating hashCode(): A method with that name already exists");
}
break;
}