diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-07-10 02:48:35 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-07-10 02:57:45 +0200 |
commit | 32e7cd18571200c41736e70daa4815893e9ea8c3 (patch) | |
tree | 95c996025db65e12b2bb67670f03eb62cb92b8f0 | |
parent | 857a57cb1601773a9544d4eaed2f9fecc0741d46 (diff) | |
download | lombok-32e7cd18571200c41736e70daa4815893e9ea8c3.tar.gz lombok-32e7cd18571200c41736e70daa4815893e9ea8c3.tar.bz2 lombok-32e7cd18571200c41736e70daa4815893e9ea8c3.zip |
[bugfix] eclipse version differences in constants for registering operator type
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleNonNull.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleNonNull.java b/src/core/lombok/eclipse/handlers/HandleNonNull.java index c4d42c2e..903d098b 100644 --- a/src/core/lombok/eclipse/handlers/HandleNonNull.java +++ b/src/core/lombok/eclipse/handlers/HandleNonNull.java @@ -40,7 +40,6 @@ import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.IfStatement; import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.NullLiteral; -import org.eclipse.jdt.internal.compiler.ast.OperatorIds; import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; import org.eclipse.jdt.internal.compiler.ast.Statement; import org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement; @@ -232,11 +231,11 @@ public class HandleNonNull extends EclipseAnnotationHandler<NonNull> { Expression cond = isIf ? ((IfStatement) stat).condition : ((AssertStatement) stat).assertExpression; if (!(cond instanceof EqualExpression)) return null; EqualExpression bin = (EqualExpression) cond; - int operatorId = ((bin.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT); + String op = bin.operatorToString(); if (isIf) { - if (operatorId != OperatorIds.EQUAL_EQUAL) return null; + if (!"==".equals(op)) return null; } else { - if (operatorId != OperatorIds.NOT_EQUAL) return null; + if (!"!=".equals(op)) return null; } if (!(bin.left instanceof SingleNameReference)) return null; if (!(bin.right instanceof NullLiteral)) return null; |