aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2009-12-26 04:32:24 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2009-12-29 22:01:17 +0100
commit64e8eb8e46e8ec164cad221460b753898a429828 (patch)
treecc5aaaed524d8087ed064090ac49fb3f15da8aba
parent1f7bddd688191857c8a089a810c251cf4c1a8407 (diff)
downloadlombok-64e8eb8e46e8ec164cad221460b753898a429828.tar.gz
lombok-64e8eb8e46e8ec164cad221460b753898a429828.tar.bz2
lombok-64e8eb8e46e8ec164cad221460b753898a429828.zip
Fix for issue #93: Naming your class GetFoo prevents lombok from making a getFoo method in eclipse.
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index e6d700f8..51f5ab4c 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -44,6 +44,7 @@ import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.IfStatement;
import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
+import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.NullLiteral;
import org.eclipse.jdt.internal.compiler.ast.OperatorIds;
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
@@ -160,13 +161,15 @@ public class EclipseHandlerUtil {
if (node != null && node.get() instanceof TypeDeclaration) {
TypeDeclaration typeDecl = (TypeDeclaration)node.get();
if (typeDecl.methods != null) for (AbstractMethodDeclaration def : typeDecl.methods) {
- char[] mName = def.selector;
- if (mName == null) continue;
- boolean nameEquals = caseSensitive ? methodName.equals(new String(mName)) : methodName.equalsIgnoreCase(new String(mName));
- if (nameEquals) {
- EclipseNode existing = node.getNodeFor(def);
- if (existing == null || !existing.isHandled()) return MemberExistsResult.EXISTS_BY_USER;
- return MemberExistsResult.EXISTS_BY_LOMBOK;
+ if (def instanceof MethodDeclaration) {
+ char[] mName = def.selector;
+ if (mName == null) continue;
+ boolean nameEquals = caseSensitive ? methodName.equals(new String(mName)) : methodName.equalsIgnoreCase(new String(mName));
+ if (nameEquals) {
+ EclipseNode existing = node.getNodeFor(def);
+ if (existing == null || !existing.isHandled()) return MemberExistsResult.EXISTS_BY_USER;
+ return MemberExistsResult.EXISTS_BY_LOMBOK;
+ }
}
}
}