diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-03 02:25:51 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-03 02:25:51 +0200 |
commit | 0b30a5695022649c0e9288b167fe15893e06887b (patch) | |
tree | 0fdbf015db81cd86d2e01cd1c739a092cf07f74b /src/lombok/eclipse/handlers/HandleToString.java | |
parent | cfa9bef58d15bea474b83b3ce80c06f5af814711 (diff) | |
download | lombok-0b30a5695022649c0e9288b167fe15893e06887b.tar.gz lombok-0b30a5695022649c0e9288b167fe15893e06887b.tar.bz2 lombok-0b30a5695022649c0e9288b167fe15893e06887b.zip |
Fixed a problem in AnnotationValues where 'isExplicit' always returned true.
Diffstat (limited to 'src/lombok/eclipse/handlers/HandleToString.java')
-rw-r--r-- | src/lombok/eclipse/handlers/HandleToString.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lombok/eclipse/handlers/HandleToString.java b/src/lombok/eclipse/handlers/HandleToString.java index d639e3fd..5b88b568 100644 --- a/src/lombok/eclipse/handlers/HandleToString.java +++ b/src/lombok/eclipse/handlers/HandleToString.java @@ -108,6 +108,11 @@ public class HandleToString implements EclipseAnnotationHandler<ToString> { if ( !annotation.isExplicit("exclude") ) excludes = null; if ( !annotation.isExplicit("of") ) includes = null; + if ( excludes != null && includes != null ) { + excludes = null; + annotation.setWarning("exclude", "exclude and of are mutually exclusive; the 'exclude' parameter will be ignored."); + } + checkForBogusFieldNames(typeNode, annotation); return generateToString(typeNode, annotationNode, excludes, includes, ann.includeFieldNames(), callSuper, true); @@ -147,7 +152,7 @@ public class HandleToString implements EclipseAnnotationHandler<ToString> { //Skip static fields. if ( (fieldDecl.modifiers & ClassFileConstants.AccStatic) != 0 ) continue; //Skip excluded fields. - if ( excludes.contains(new String(fieldDecl.name)) ) continue; + if ( excludes != null && excludes.contains(new String(fieldDecl.name)) ) continue; //Skip fields that start with $ if ( fieldDecl.name.length > 0 && fieldDecl.name[0] == '$' ) continue; nodesForToString.add(child); |