From f0343886a331f3cb2175545a062f3736610f9179 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Wed, 24 Apr 2019 14:06:15 +0300 Subject: improvements type inference of type intersections (affects ValLambda.java, ValWeirdTypes.java tests) --- test/transform/resource/after-delombok/ValLambda.java | 4 ++-- test/transform/resource/after-delombok/ValWeirdTypes.java | 10 ++++++++-- test/transform/resource/after-ecj/ValLambda.java | 4 ++-- test/transform/resource/after-ecj/ValWeirdTypes.java | 10 ++++++++-- test/transform/resource/before/ValWeirdTypes.java | 8 ++++++++ 5 files changed, 28 insertions(+), 8 deletions(-) (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 9214b490..60aeaac9 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -5,9 +5,9 @@ class ValLambda { }; } public void easyIntersectionLambda() { - final java.lang.Object foo = (Runnable & java.io.Serializable) () -> { + final java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> { }; - final java.lang.Object bar = (java.io.Serializable & Runnable) () -> { + final java.io.Serializable bar = (java.io.Serializable & Runnable) () -> { }; } public void easyLubLambda() { diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java index a6bc9bd4..8b399fe8 100644 --- a/test/transform/resource/after-delombok/ValWeirdTypes.java +++ b/test/transform/resource/after-delombok/ValWeirdTypes.java @@ -56,8 +56,14 @@ public class ValWeirdTypes { final int singleInt = copy[0]; } public void arraysAsList() { - final java.util.List> x = Arrays.asList(String.class, BigDecimal.class); - for (final java.lang.Class y : x) { + final java.util.List> x = Arrays.asList(String.class, BigDecimal.class); + for (final java.lang.Class y : x) { + } + } + @SuppressWarnings("all") + public void arraysAsList2() { + final java.util.List> x = Arrays.asList(String.class, BigDecimal.class, Comparable.class); + for (final java.lang.Class y : x) { } } } diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java index 4bf3265b..4e2b97a1 100644 --- a/test/transform/resource/after-ecj/ValLambda.java +++ b/test/transform/resource/after-ecj/ValLambda.java @@ -7,9 +7,9 @@ class ValLambda { }; } public void easyIntersectionLambda() { - final @lombok.val java.lang.Object foo = (Runnable & java.io.Serializable) () -> { + final @lombok.val java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> { }; - final @lombok.val java.lang.Object bar = (java.io.Serializable & Runnable) () -> { + final @lombok.val java.io.Serializable bar = (java.io.Serializable & Runnable) () -> { }; } public void easyLubLambda() { diff --git a/test/transform/resource/after-ecj/ValWeirdTypes.java b/test/transform/resource/after-ecj/ValWeirdTypes.java index 9f448db9..e98b9753 100644 --- a/test/transform/resource/after-ecj/ValWeirdTypes.java +++ b/test/transform/resource/after-ecj/ValWeirdTypes.java @@ -63,8 +63,14 @@ public class ValWeirdTypes { final @val int singleInt = copy[0]; } public void arraysAsList() { - final @val java.util.List> x = Arrays.asList(String.class, BigDecimal.class); - for (final @val java.lang.Class y : x) + final @val java.util.List> x = Arrays.asList(String.class, BigDecimal.class); + for (final @val java.lang.Class y : x) + { + } + } + public @SuppressWarnings("all") void arraysAsList2() { + final @val java.util.List> x = Arrays.asList(String.class, BigDecimal.class, Comparable.class); + for (final @val java.lang.Class y : x) { } } diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java index 4ea1b5d4..157ffc76 100644 --- a/test/transform/resource/before/ValWeirdTypes.java +++ b/test/transform/resource/before/ValWeirdTypes.java @@ -72,4 +72,12 @@ public class ValWeirdTypes { } } + + @SuppressWarnings("all") + public void arraysAsList2() { + val x = Arrays.asList(String.class, BigDecimal.class, Comparable.class); + for (val y : x) { + + } + } } \ No newline at end of file -- cgit From 06fb1034eac690f5775e104c4bc82df3ad929cc9 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Tue, 7 May 2019 10:49:25 +0300 Subject: #1976. naive fix of the eclipse compiler's error 'The target type of this expression must be a functional interface' in code like 'lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println;' --- .../lombok/eclipse/agent/PatchVal.java | 37 ++++++++++++++++++++-- .../resource/after-delombok/ValLambda.java | 2 +- test/transform/resource/after-ecj/ValLambda.java | 2 +- test/transform/resource/before/ValLambda.java | 2 +- 4 files changed, 37 insertions(+), 6 deletions(-) (limited to 'test/transform') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java index 12f4ad3d..832a25e3 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2019 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 * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,8 +21,11 @@ */ package lombok.eclipse.agent; +import org.eclipse.jdt.core.compiler.CategorizedProblem; +import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.Annotation; +import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.ForeachStatement; import org.eclipse.jdt.internal.compiler.ast.ImportReference; @@ -44,11 +47,13 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.eclipse.jdt.internal.compiler.lookup.TypeIds; import lombok.permit.Permit; +import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; import java.lang.reflect.Field; import static lombok.eclipse.Eclipse.poss; import static lombok.eclipse.handlers.EclipseHandlerUtil.makeType; +import static org.eclipse.jdt.core.compiler.CategorizedProblem.CAT_TYPE; public class PatchVal { @@ -358,6 +363,32 @@ public class PatchVal { } catch (ArrayIndexOutOfBoundsException e) { // Known cause of issues; for example: val e = mth("X"), where mth takes 2 arguments. return null; + } catch (AbortCompilation e) { + if (collection instanceof ConditionalExpression) { + ConditionalExpression cexp = (ConditionalExpression) collection; + Expression ifTrue = cexp.valueIfTrue; + Expression ifFalse = cexp.valueIfFalse; + TypeBinding ifTrueResolvedType = ifTrue.resolvedType; + CategorizedProblem problem = e.problem; + if (ifTrueResolvedType != null && ifFalse.resolvedType == null && problem.getCategoryID() == CAT_TYPE) { + CompilationResult compilationResult = e.compilationResult; + CategorizedProblem[] problems = compilationResult.problems; + int problemCount = compilationResult.problemCount; + for (int i = 0; i < problemCount; ++i) { + if (problems[i] == problem) { + problems[i] = null; + if (i + 1 < problemCount) { + System.arraycopy(problems, i + 1, problems, i, problemCount - i + 1); + } + break; + } + } + compilationResult.removeProblem(problem); + + return ifTrueResolvedType; + } + } + throw e; } } } diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 60aeaac9..772db9a5 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -12,7 +12,7 @@ class ValLambda { } public void easyLubLambda() { final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { - } : (Runnable) System.out::println; + } : System.out::println; } // public void castLubLambda() { // Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java index 4e2b97a1..53258b3e 100644 --- a/test/transform/resource/after-ecj/ValLambda.java +++ b/test/transform/resource/after-ecj/ValLambda.java @@ -14,6 +14,6 @@ class ValLambda { } public void easyLubLambda() { final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { -} : (Runnable) System.out::println); +} : System.out::println); } } \ No newline at end of file diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index 51c4fba1..4ec73b82 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -10,7 +10,7 @@ class ValLambda { } public void easyLubLambda() { - lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : (Runnable)System.out::println; + lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; } // public void castLubLambda() { -- cgit From 1fec035aa546b7a033acb67cf4f7c1afb8a79f52 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Wed, 8 May 2019 23:34:37 +0300 Subject: #1976. [@val] improved raw generic type inference by eclipse compiler. --- src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 3 ++- test/transform/resource/after-delombok/ValLambda.java | 5 ++++- test/transform/resource/after-ecj/ValLambda.java | 3 +++ test/transform/resource/before/ValLambda.java | 3 +++ test/transform/resource/messages-ecj/ValLambda.java.messages | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 test/transform/resource/messages-ecj/ValLambda.java.messages (limited to 'test/transform') diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 1e791341..257f5cec 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -114,6 +114,7 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.lookup.Binding; import org.eclipse.jdt.internal.compiler.lookup.CaptureBinding; import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; +import org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; @@ -965,7 +966,7 @@ public class EclipseHandlerUtil { // Finally, add however many nullTypeArgument[] arrays as that are missing, inverse the list, toArray it, and use that as PTR's typeArgument argument. List params = new ArrayList(); - /* Calculate generics */ { + /* Calculate generics */ if(!(binding instanceof RawTypeBinding)) { TypeBinding b = binding; while (true) { boolean isFinalStop = b.isLocalType() || !b.isMemberType() || b.enclosingType() == null; diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 772db9a5..7e745e81 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -13,9 +13,12 @@ class ValLambda { public void easyLubLambda() { final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { } : System.out::println; + final java.util.function.Function foo2 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); + java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); + final java.util.function.Function foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); } // public void castLubLambda() { // Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); // lombok.val foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); // } -} +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java index 53258b3e..e7cbb28e 100644 --- a/test/transform/resource/after-ecj/ValLambda.java +++ b/test/transform/resource/after-ecj/ValLambda.java @@ -15,5 +15,8 @@ class ValLambda { public void easyLubLambda() { final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { } : System.out::println); + final @lombok.val java.util.function.Function foo2 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> System.currentTimeMillis()); + java.util.function.Function foo3 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> System.currentTimeMillis()); + final @lombok.val java.util.function.Function foo4 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> String.valueOf(System.currentTimeMillis())); } } \ No newline at end of file diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index 4ec73b82..d13221fd 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -11,6 +11,9 @@ class ValLambda { public void easyLubLambda() { lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; + lombok.val foo2 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); + java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); + lombok.val foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); } // public void castLubLambda() { diff --git a/test/transform/resource/messages-ecj/ValLambda.java.messages b/test/transform/resource/messages-ecj/ValLambda.java.messages new file mode 100644 index 00000000..21c831c3 --- /dev/null +++ b/test/transform/resource/messages-ecj/ValLambda.java.messages @@ -0,0 +1,2 @@ +14 Function is a raw type. References to generic type Function should be parameterized +15 Function is a raw type. References to generic type Function should be parameterized \ No newline at end of file -- cgit From cd49188aff9ffece51ce8831c961e0faab33fbc8 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Mon, 20 May 2019 13:44:29 +0300 Subject: #1976. one more test case --- test/transform/resource/after-delombok/ValLambda.java | 1 + test/transform/resource/after-ecj/ValLambda.java | 1 + test/transform/resource/before/ValLambda.java | 1 + 3 files changed, 3 insertions(+) (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index 7e745e81..b993028e 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -13,6 +13,7 @@ class ValLambda { public void easyLubLambda() { final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> { } : System.out::println; + final java.lang.Runnable foo1 = (System.currentTimeMillis() > 0) ? (Runnable) System.out::println : System.out::println; final java.util.function.Function foo2 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); final java.util.function.Function foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); diff --git a/test/transform/resource/after-ecj/ValLambda.java b/test/transform/resource/after-ecj/ValLambda.java index e7cbb28e..fcb855b3 100644 --- a/test/transform/resource/after-ecj/ValLambda.java +++ b/test/transform/resource/after-ecj/ValLambda.java @@ -15,6 +15,7 @@ class ValLambda { public void easyLubLambda() { final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> { } : System.out::println); + final @lombok.val java.lang.Runnable foo1 = ((System.currentTimeMillis() > 0) ? (Runnable) System.out::println : System.out::println); final @lombok.val java.util.function.Function foo2 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> System.currentTimeMillis()); java.util.function.Function foo3 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> System.currentTimeMillis()); final @lombok.val java.util.function.Function foo4 = ((System.currentTimeMillis() < 0) ? (java.util.function.Function) ( r) -> "" : ( r) -> String.valueOf(System.currentTimeMillis())); diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index d13221fd..5d40f220 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -11,6 +11,7 @@ class ValLambda { public void easyLubLambda() { lombok.val foo = (System.currentTimeMillis() > 0) ? (Runnable)()-> {} : System.out::println; + lombok.val foo1 = (System.currentTimeMillis() > 0) ? (Runnable)System.out::println : System.out::println; lombok.val foo2 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); lombok.val foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); -- cgit From 2704f073aad6deb362707e0311b6275cde7c5e1a Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 21 May 2019 23:20:00 +0200 Subject: Code review + mention in changelog for the improvement to val handling vs. lambdas and conditional (ternary) expressions. --- doc/changelog.markdown | 2 +- src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 4 ++-- src/eclipseAgent/lombok/eclipse/agent/PatchVal.java | 6 +++--- test/transform/resource/after-delombok/ValLambda.java | 4 ---- test/transform/resource/before/ValLambda.java | 5 ----- 5 files changed, 6 insertions(+), 15 deletions(-) (limited to 'test/transform') diff --git a/doc/changelog.markdown b/doc/changelog.markdown index e0e3d49a..1d927e62 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -2,7 +2,7 @@ Lombok Changelog ---------------- ### v1.18.9 "Edgy Guinea Pig" -* Nothing yet. +* ENHANCEMENT: `val` is now capable of decoding the type of convoluted expressions (particularly if the right hand side involves lambdas and conditional (ternary) expressions). [Pull Request #2109](https://github.com/rzwitserloot/lombok/pull/2109) with thanks to Alexander Bulgakov. ### v1.18.8 (May 7th, 2019) * FEATURE: You can now configure `@FieldNameConstants` to `CONSTANT_CASE` the generated constants, using a `lombok.config` option. See the [FieldNameConstants documentation](https://projectlombok.org/features/experimental/FieldNameConstants). [Issue #2092](https://github.com/rzwitserloot/lombok/issues/2092). diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 257f5cec..463990d1 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -845,7 +845,6 @@ public class EclipseHandlerUtil { } public static TypeReference makeType(TypeBinding binding, ASTNode pos, boolean allowCompound) { - if (binding.getClass() == EclipseReflectiveMembers.INTERSECTION_BINDING) { Object[] arr = (Object[]) EclipseReflectiveMembers.reflect(EclipseReflectiveMembers.INTERSECTION_BINDING_TYPES, binding); binding = (TypeBinding) arr[0]; @@ -966,7 +965,8 @@ public class EclipseHandlerUtil { // Finally, add however many nullTypeArgument[] arrays as that are missing, inverse the list, toArray it, and use that as PTR's typeArgument argument. List params = new ArrayList(); - /* Calculate generics */ if(!(binding instanceof RawTypeBinding)) { + /* Calculate generics */ + if (!(binding instanceof RawTypeBinding)) { TypeBinding b = binding; while (true) { boolean isFinalStop = b.isLocalType() || !b.isMemberType() || b.enclosingType() == null; diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java index 832a25e3..c0c2cea6 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2019 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 * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/test/transform/resource/after-delombok/ValLambda.java b/test/transform/resource/after-delombok/ValLambda.java index b993028e..00ff27ad 100644 --- a/test/transform/resource/after-delombok/ValLambda.java +++ b/test/transform/resource/after-delombok/ValLambda.java @@ -18,8 +18,4 @@ class ValLambda { java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); final java.util.function.Function foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); } -// public void castLubLambda() { -// Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); -// lombok.val foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); -// } } \ No newline at end of file diff --git a/test/transform/resource/before/ValLambda.java b/test/transform/resource/before/ValLambda.java index 5d40f220..35f83c3c 100644 --- a/test/transform/resource/before/ValLambda.java +++ b/test/transform/resource/before/ValLambda.java @@ -16,9 +16,4 @@ class ValLambda { java.util.function.Function foo3 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> System.currentTimeMillis(); lombok.val foo4 = (System.currentTimeMillis() < 0) ? (java.util.function.Function) r -> "" : r -> String.valueOf(System.currentTimeMillis()); } - -// public void castLubLambda() { -// Runnable foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); -// lombok.val foo = (Runnable) ((System.currentTimeMillis() > 0) ? () -> {} : System.out::println); -// } } -- cgit