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 @@ -105,7 +105,7 @@ private boolean isAtViolationLocation(J.VariableDeclarations.NamedVariable liter
return violations.stream().anyMatch(violation -> {
return violation.getLine() == line
&& violation.getColumn() == column
&& Path.of(violation.getFileName()).equals(sourcePath);
&& Path.of(violation.getFileName()).endsWith(sourcePath);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/checkstyle/autofix/recipe/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private String extractCurrentHeader(JavaSourceFile sourceFile) {

private boolean hasViolation(Path filePath) {
return violations.removeIf(violation -> {
return filePath.equals(Path.of(violation.getFileName()).toAbsolutePath());
return Path.of(violation.getFileName()).endsWith(filePath);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private boolean isAtViolationLocation(J.Import literal) {
final Path absolutePath = Path.of(violation.getFileName()).toAbsolutePath();
return violation.getLine() == line
&& violation.getColumn() == column
&& absolutePath.equals(sourcePath);
&& absolutePath.endsWith(sourcePath);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/checkstyle/autofix/recipe/UpperEll.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private boolean isAtViolationLocation(J.Literal literal) {
final Path absolutePath = Path.of(violation.getFileName()).toAbsolutePath();
return violation.getLine() == line
&& violation.getColumn() == column
&& absolutePath.equals(sourcePath);
&& absolutePath.endsWith(sourcePath);
});
}
}
Expand Down
Loading