Skip to content

Commit 796ecc1

Browse files
committed
create failing case and breadcrumb for picking up later
1 parent 62e6bdc commit 796ecc1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core-codemods/src/main/java/io/codemodder/codemods/CreateConstantForLiteral.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ protected void defineConstant(final String constantName) {
7575
* Adds a {@link FieldDeclaration} as the first member of the provided {@link
7676
* ClassOrInterfaceDeclaration}
7777
*/
78-
protected void addConstantFieldToClass(final FieldDeclaration constantField) {
78+
private void addConstantFieldToClass(final FieldDeclaration constantField) {
7979

80+
// TODO: Add the constant field to the end, and get better indent?
8081
final NodeList<BodyDeclaration<?>> members = classOrInterfaceDeclaration.getMembers();
8182

8283
members.addFirst(constantField);

core-codemods/src/test/resources/define-constant-for-duplicate-literal-s1192/case-2/Test.java.after

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
3838
@AssignmentHints({"idor.hints.idor_login"})
3939
public class IDORLogin extends AssignmentEndpoint {
4040

41-
private static final String password1 = "password";
41+
private static final String password1 = "password";
4242

4343
private Map<String, Map<String, String>> idorUserInfo = new HashMap<>();
4444

0 commit comments

Comments
 (0)