@FieldDefaults was causing template suggestions to not appear sometimes.

See issue 411.
This commit is contained in:
Reinier Zwitserloot committed 2012-09-03 21:34:51 +02:00
1 parent 70256754c2
commit 9bc421ecdc
1 file changed
+9 -1
@@ -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;
}