diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-09-03 21:34:51 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-09-03 21:34:51 +0200 |
commit | 9bc421ecdc6c23884b731543737c10458cbf016a (patch) | |
tree | 4b196506bda9a8cb3f5f18a9015caae4f04ad56b | |
parent | 70256754c2587361c9f70287f62c1e3fd2dede10 (diff) | |
download | lombok-9bc421ecdc6c23884b731543737c10458cbf016a.tar.gz lombok-9bc421ecdc6c23884b731543737c10458cbf016a.tar.bz2 lombok-9bc421ecdc6c23884b731543737c10458cbf016a.zip |
@FieldDefaults was causing template suggestions to not appear sometimes.
See issue 411.
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleFieldDefaults.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java index 0cce0f62..0d21fc08 100644 --- a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java +++ b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java @@ -69,7 +69,15 @@ public class HandleFieldDefaults extends EclipseAnnotationHandler<FieldDefaults> FieldDeclaration fieldDecl = (FieldDeclaration) field.get(); if (!filterField(fieldDecl, false)) continue; - setFieldDefaultsForField(field, pos.get(), level, makeFinal); + Class<?> t = field.get().getClass(); + if (t == FieldDeclaration.class) { + // There are various other things that extend FieldDeclaration that really + // aren't field declarations. Typing 'ma' in an otherwise blank class is a + // CompletionOnFieldType object (extends FieldDeclaration). If we mess with the + // modifiers of such a thing, you take away template suggestions such as + // 'main method'. See issue 411. + setFieldDefaultsForField(field, pos.get(), level, makeFinal); + } } return true; } |