Skip to content

Commit

Permalink
Introduce finalize private field recipe (#2663)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 authored and sambsnyd committed Jan 19, 2023
1 parent 546d16b commit a19ab0d
Show file tree
Hide file tree
Showing 3 changed files with 729 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,37 @@ void test() {
)
);
}

@Disabled
@Test
void localVariableInInitializerBlockMadeFinal() {
rewriteRun(
java(
"""
class Person {
{
int n = 10;
name = "N1";
age = n;
}
private String name;
private int age;
}
""",
"""
class Person {
{
final int n = 10;
name = "N1";
age = n;
}
private String name;
private int age;
}
"""
)
);
}
}
Loading

0 comments on commit a19ab0d

Please sign in to comment.