File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
src/main/java/org/checkstyle/autofix/recipe Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ private boolean isAtViolationLocation(J.VariableDeclarations.NamedVariable liter
105105 return violations .stream ().anyMatch (violation -> {
106106 return violation .getLine () == line
107107 && violation .getColumn () == column
108- && Path .of (violation .getFileName ()).equals (sourcePath );
108+ && Path .of (violation .getFileName ()).endsWith (sourcePath );
109109 });
110110 }
111111 }
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ private String extractCurrentHeader(JavaSourceFile sourceFile) {
129129
130130 private boolean hasViolation (Path filePath ) {
131131 return violations .removeIf (violation -> {
132- return filePath . equals ( Path .of (violation .getFileName ()).toAbsolutePath () );
132+ return Path .of (violation .getFileName ()).endsWith ( filePath );
133133 });
134134 }
135135 }
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ private boolean isAtViolationLocation(J.Import literal) {
118118 final Path absolutePath = Path .of (violation .getFileName ()).toAbsolutePath ();
119119 return violation .getLine () == line
120120 && violation .getColumn () == column
121- && absolutePath .equals (sourcePath );
121+ && absolutePath .endsWith (sourcePath );
122122 });
123123 }
124124
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ private boolean isAtViolationLocation(J.Literal literal) {
9797 final Path absolutePath = Path .of (violation .getFileName ()).toAbsolutePath ();
9898 return violation .getLine () == line
9999 && violation .getColumn () == column
100- && absolutePath .equals (sourcePath );
100+ && absolutePath .endsWith (sourcePath );
101101 });
102102 }
103103 }
You can’t perform that action at this time.
0 commit comments