Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.openrewrite.java.migrate.table;

import lombok.Builder;
import lombok.Value;
import org.openrewrite.Column;
import org.openrewrite.DataTable;
Expand All @@ -31,7 +30,7 @@ public JavaVersionMigrationPlan(Recipe recipe) {
);
}

@Builder
@lombok.Builder
@Value
public static class Row {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,47 @@ void bar() {
);
}

@Test
void removeValInsideNestedLambda() {
//language=java
rewriteRun(
version(
java(
"""
import java.util.function.Function;
import lombok.val;

class A {
private String apiMetricKey = "helloKey";

public Function<String, String[]> bar(Function<String, String> keySelector) {
return apiMetricKey -> {
val key = keySelector.apply(apiMetricKey);
return new String[] { "aaa", "bbb" };
};
}
}
""",
"""
import java.util.function.Function;

class A {
private String apiMetricKey = "helloKey";

public Function<String, String[]> bar(Function<String, String> keySelector) {
return apiMetricKey -> {
final var key = keySelector.apply(apiMetricKey);
return new String[] { "aaa", "bbb" };
};
}
}
"""
),
17
)
);
}

@Test
void preserveStarImport() {
//language=java
Expand Down
Loading