diff options
Diffstat (limited to 'src/lombok/javac/handlers')
-rw-r--r-- | src/lombok/javac/handlers/HandleEqualsAndHashCode.java | 5 | ||||
-rw-r--r-- | src/lombok/javac/handlers/HandleToString.java | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lombok/javac/handlers/HandleEqualsAndHashCode.java b/src/lombok/javac/handlers/HandleEqualsAndHashCode.java index 16a04da7..21966be2 100644 --- a/src/lombok/javac/handlers/HandleEqualsAndHashCode.java +++ b/src/lombok/javac/handlers/HandleEqualsAndHashCode.java @@ -84,6 +84,11 @@ public class HandleEqualsAndHashCode implements JavacAnnotationHandler<EqualsAnd 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."); + } + return generateMethods(typeNode, annotationNode, excludes, includes, callSuper, true); } diff --git a/src/lombok/javac/handlers/HandleToString.java b/src/lombok/javac/handlers/HandleToString.java index 7cdbb6e1..eb2013c7 100644 --- a/src/lombok/javac/handlers/HandleToString.java +++ b/src/lombok/javac/handlers/HandleToString.java @@ -81,6 +81,11 @@ public class HandleToString implements JavacAnnotationHandler<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."); + } + return generateToString(typeNode, annotationNode, excludes, includes, ann.includeFieldNames(), callSuper, true); } |