From 66469e04fe35e5ceb3723cb563379a03e4883101 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 6 Feb 2018 22:12:42 +0100 Subject: [var] various upgrades to var: * var is promoted to the main package. * It is no longer an opt-in thing. * bug: var (unlike val) is allowed in old-style for loops, but if you multi-init: for (var i = 0, j="Foo";;), you now get an error that you can't do that. * tests both for the multi-for situation and the new main package variant. --- src/eclipseAgent/lombok/eclipse/agent/PatchVal.java | 2 +- src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/eclipseAgent/lombok/eclipse/agent') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java index e4dd7b26..632dd865 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java @@ -212,7 +212,7 @@ public class PatchVal { } private static boolean isVar(LocalDeclaration local, BlockScope scope) { - return is(local.type, scope, "lombok.experimental.var"); + return is(local.type, scope, "lombok.experimental.var") || is(local.type, scope, "lombok.var"); } private static boolean isVal(LocalDeclaration local, BlockScope scope) { diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java b/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java index 505eb767..839fce6e 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java @@ -103,7 +103,7 @@ public class PatchValEclipse { } private static boolean couldBeVar(TypeReference type) { - return PatchVal.couldBe("lombok.experimental.var", type); + return PatchVal.couldBe("lombok.experimental.var", type) || PatchVal.couldBe("lombok.var", type); } public static void addFinalAndValAnnotationToSingleVariableDeclaration(Object converter, SingleVariableDeclaration out, LocalDeclaration in) { -- cgit