aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/singulars
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-07-15 22:15:15 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-07-15 22:15:21 +0200
commitb3824c9dc1861c0ce6acdf48049e6552d808e448 (patch)
tree5f7ba10261ce5702af2d04b3c30e59ac5066ff9d /src/core/lombok/eclipse/handlers/singulars
parent206e306615fadeea7e9a1fc6ec3fa40bfd560a19 (diff)
downloadlombok-b3824c9dc1861c0ce6acdf48049e6552d808e448.tar.gz
lombok-b3824c9dc1861c0ce6acdf48049e6552d808e448.tar.bz2
lombok-b3824c9dc1861c0ce6acdf48049e6552d808e448.zip
[fixes #2169] Eclipse 2019-06 + JDK12 + `@Singular` caused a cavalcade of error popups
Diffstat (limited to 'src/core/lombok/eclipse/handlers/singulars')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSingularizer.java7
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilSingularizer.java8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSingularizer.java
index 7ea04821..bf50aef6 100755
--- a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSingularizer.java
+++ b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSingularizer.java
@@ -35,7 +35,6 @@ import lombok.eclipse.handlers.EclipseSingularsRecipes.SingularData;
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
import org.eclipse.jdt.internal.compiler.ast.Assignment;
import org.eclipse.jdt.internal.compiler.ast.BreakStatement;
-import org.eclipse.jdt.internal.compiler.ast.CaseStatement;
import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldReference;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
@@ -74,7 +73,7 @@ public class EclipseJavaUtilListSingularizer extends EclipseJavaUtilListSetSingu
List<Statement> switchContents = new ArrayList<Statement>();
/* case 0: (empty) break; */ {
- switchContents.add(new CaseStatement(makeIntLiteral(new char[] {'0'}, null), 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(makeIntLiteral(new char[] {'0'}, null)));
MessageSend invoke = new MessageSend();
invoke.receiver = new QualifiedNameReference(JAVA_UTIL_COLLECTIONS, NULL_POSS, 0, 0);
invoke.selector = "emptyList".toCharArray();
@@ -83,7 +82,7 @@ public class EclipseJavaUtilListSingularizer extends EclipseJavaUtilListSetSingu
}
/* case 1: (singleton) break; */ {
- switchContents.add(new CaseStatement(makeIntLiteral(new char[] {'1'}, null), 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(makeIntLiteral(new char[] {'1'}, null)));
FieldReference thisDotField = new FieldReference(data.getPluralName(), 0L);
thisDotField.receiver = getBuilderReference(builderVariable);
MessageSend thisDotFieldGet0 = new MessageSend();
@@ -101,7 +100,7 @@ public class EclipseJavaUtilListSingularizer extends EclipseJavaUtilListSetSingu
}
/* default: Create by passing builder field to constructor. */ {
- switchContents.add(new CaseStatement(null, 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(null));
Expression argToUnmodifiable;
/* new j.u.ArrayList<Generics>(this.pluralName); */ {
diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilSingularizer.java
index 8aeffc48..4a143a06 100755
--- a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilSingularizer.java
+++ b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilSingularizer.java
@@ -34,7 +34,6 @@ import org.eclipse.jdt.internal.compiler.ast.Assignment;
import org.eclipse.jdt.internal.compiler.ast.BinaryExpression;
import org.eclipse.jdt.internal.compiler.ast.Block;
import org.eclipse.jdt.internal.compiler.ast.BreakStatement;
-import org.eclipse.jdt.internal.compiler.ast.CaseStatement;
import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
import org.eclipse.jdt.internal.compiler.ast.EqualExpression;
import org.eclipse.jdt.internal.compiler.ast.Expression;
@@ -58,6 +57,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import lombok.ConfigurationKeys;
+import lombok.eclipse.Eclipse;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.handlers.EclipseSingularsRecipes.EclipseSingularizer;
import lombok.eclipse.handlers.EclipseSingularsRecipes.SingularData;
@@ -95,7 +95,7 @@ abstract class EclipseJavaUtilSingularizer extends EclipseSingularizer {
char[] keyName = mapMode ? (new String(data.getPluralName()) + "$key").toCharArray() : data.getPluralName();
if (emptyCollectionMethod != null) { // case 0: (empty); break;
- switchContents.add(new CaseStatement(makeIntLiteral(new char[] {'0'}, null), 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(makeIntLiteral(new char[] {'0'}, null)));
/* pluralName = java.util.Collections.emptyCollectionMethod(); */ {
MessageSend invoke = new MessageSend();
@@ -108,7 +108,7 @@ abstract class EclipseJavaUtilSingularizer extends EclipseSingularizer {
}
if (singletonCollectionMethod != null) { // case 1: (singleton); break;
- switchContents.add(new CaseStatement(makeIntLiteral(new char[] {'1'}, null), 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(makeIntLiteral(new char[] {'1'}, null)));
/* !mapMode: pluralName = java.util.Collections.singletonCollectionMethod(this.pluralName.get(0));
mapMode: pluralName = java.util.Collections.singletonCollectionMethod(this.pluralName$key.get(0), this.pluralName$value.get(0)); */ {
FieldReference thisDotKey = new FieldReference(keyName, 0L);
@@ -142,7 +142,7 @@ abstract class EclipseJavaUtilSingularizer extends EclipseSingularizer {
}
{ // default:
- switchContents.add(new CaseStatement(null, 0, 0));
+ switchContents.add(Eclipse.createCaseStatement(null));
switchContents.addAll(createJavaUtilSimpleCreationAndFillStatements(data, builderType, mapMode, false, true, emptyCollectionMethod == null, targetType, builderVariable));
}