aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-13 04:53:44 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-13 04:53:44 +0100
commite8cd744d3b2d986dd847b9ff6bdf2750a8dd6764 (patch)
tree6e7e21207fb5475534d10234617dca1e071f9fd5 /src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
parentc1bf4ec3b66cf6632cfd3e554d59ad4f8ad1b3b8 (diff)
downloadlombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.tar.gz
lombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.tar.bz2
lombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.zip
[superbuilder] toBuilder + singular + javac6 was broken
superbuilder generated the node `x.pluralName(plural == null ? Collections.emptyList() : plural)`. java6 is not smart enough to infer the appropriate generics for the emptyList() call. Fixed by always specifying the needed type explicitly: Collections.<String>emptyList();
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
index 760f5282..d099cab2 100755
--- a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
+++ b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2020 The Project Lombok Authors.
+ * Copyright (C) 2015-2021 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -451,7 +451,17 @@ public class EclipseSingularsRecipes {
statements.add(0, nullCheck);
}
+ protected abstract int getTypeArgumentsCount();
+
protected abstract char[][] getEmptyMakerReceiver(String targetFqn);
protected abstract char[] getEmptyMakerSelector(String targetFqn);
+
+ public MessageSend getEmptyExpression(String targetFqn, SingularData data, EclipseNode typeNode, ASTNode source) {
+ MessageSend send = new MessageSend();
+ send.receiver = generateQualifiedNameRef(source, getEmptyMakerReceiver(targetFqn));
+ send.selector = getEmptyMakerSelector(targetFqn);
+ send.typeArguments = createTypeArgs(getTypeArgumentsCount(), false, typeNode, data.getTypeArgs());
+ return send;
+ }
}
}