diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-20 22:17:18 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-20 22:17:18 +0100 |
commit | f071339508af4f233c579224a5e2028f2ba46489 (patch) | |
tree | d26b09642efcc89d7192c6bdbd70d77dcd72f19f /src/core/lombok/javac | |
parent | 5b4ab9dae8940973ce8b87c8c2a0388b768dac89 (diff) | |
download | lombok-f071339508af4f233c579224a5e2028f2ba46489.tar.gz lombok-f071339508af4f233c579224a5e2028f2ba46489.tar.bz2 lombok-f071339508af4f233c579224a5e2028f2ba46489.zip |
added the lombok.singular.auto config option.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleBuilder.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 7bb0619f..e251e0ce 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -466,10 +466,15 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { deleteAnnotationIfNeccessary(child, Singular.class); String explicitSingular = ann.getInstance().value(); if (explicitSingular.isEmpty()) { - explicitSingular = autoSingularize(node.getName()); - if (explicitSingular == null) { - node.addError("Can't singularize this name; please specify the singular explicitly (i.e. @Singular(\"sheep\"))"); + if (Boolean.FALSE.equals(node.getAst().readConfiguration(ConfigurationKeys.SINGULAR_AUTO))) { + node.addError("The singular must be specified explicitly (e.g. @Singular(\"task\")) because auto singularization is disabled."); explicitSingular = pluralName.toString(); + } else { + explicitSingular = autoSingularize(node.getName()); + if (explicitSingular == null) { + node.addError("Can't singularize this name; please specify the singular explicitly (i.e. @Singular(\"sheep\"))"); + explicitSingular = pluralName.toString(); + } } } Name singularName = node.toName(explicitSingular); |