aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-01-20 22:17:18 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-01-20 22:17:18 +0100
commitf071339508af4f233c579224a5e2028f2ba46489 (patch)
treed26b09642efcc89d7192c6bdbd70d77dcd72f19f /src/core/lombok/eclipse/handlers
parent5b4ab9dae8940973ce8b87c8c2a0388b768dac89 (diff)
downloadlombok-f071339508af4f233c579224a5e2028f2ba46489.tar.gz
lombok-f071339508af4f233c579224a5e2028f2ba46489.tar.bz2
lombok-f071339508af4f233c579224a5e2028f2ba46489.zip
added the lombok.singular.auto config option.
Diffstat (limited to 'src/core/lombok/eclipse/handlers')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleBuilder.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java
index 91aa3f93..498808bc 100644
--- a/src/core/lombok/eclipse/handlers/HandleBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java
@@ -516,10 +516,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
AnnotationValues<Singular> ann = createAnnotation(Singular.class, child);
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\"))");
- explicitSingular = pluralName.toString();
+ 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 = new String(pluralName);
+ } 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 = new String(pluralName);
+ }
}
}
char[] singularName = explicitSingular.toCharArray();