diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-06 20:37:21 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-06 20:37:21 +0200 |
commit | 87f763a94c87b03da269d110c44e7e750ddf5211 (patch) | |
tree | 05d59604320510e4bb7d5014917ba275e9061e5a /src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | |
parent | eb4cbcd8bbd7bf7784aa229e9b6c5fe0670fa7a5 (diff) | |
parent | 34055fcdff786c9b809ce1a08c1c9218968ebc7d (diff) | |
download | lombok-87f763a94c87b03da269d110c44e7e750ddf5211.tar.gz lombok-87f763a94c87b03da269d110c44e7e750ddf5211.tar.bz2 lombok-87f763a94c87b03da269d110c44e7e750ddf5211.zip |
Merge branch 'master' into wither
Conflicts:
src/core/lombok/javac/handlers/JavacHandlerUtil.java
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 8b330816..ed18dd45 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -798,18 +798,19 @@ public class EclipseHandlerUtil { } } - private static final Map<FieldDeclaration, GetterMethod> generatedLazyGetters = new WeakHashMap<FieldDeclaration, GetterMethod>(); + private static final Map<FieldDeclaration, Object> generatedLazyGettersWithPrimitiveBoolean = new WeakHashMap<FieldDeclaration, Object>(); + private static final Object MARKER = new Object(); static void registerCreatedLazyGetter(FieldDeclaration field, char[] methodName, TypeReference returnType) { - generatedLazyGetters.put(field, new GetterMethod(methodName, returnType)); + if (!nameEquals(returnType.getTypeName(), "boolean") || returnType.dimensions() > 0) return; + generatedLazyGettersWithPrimitiveBoolean.put(field, MARKER); } private static GetterMethod findGetter(EclipseNode field) { FieldDeclaration fieldDeclaration = (FieldDeclaration) field.get(); - GetterMethod gm = generatedLazyGetters.get(fieldDeclaration); - if (gm != null) return gm; + boolean forceBool = generatedLazyGettersWithPrimitiveBoolean.containsKey(fieldDeclaration); TypeReference fieldType = fieldDeclaration.type; - boolean isBoolean = nameEquals(fieldType.getTypeName(), "boolean") && fieldType.dimensions() == 0; + boolean isBoolean = forceBool || (nameEquals(fieldType.getTypeName(), "boolean") && fieldType.dimensions() == 0); EclipseNode typeNode = field.up(); for (String potentialGetterName : toAllGetterNames(field, isBoolean)) { |