-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
In both CheckstyleValidator.getNonExcludedFiles and CheckstyleListener.addError, the code does:
final String name = file.getPath().substring(this.env.basedir().toString().length());
Problem: If the file path does not start with the base directory path, this will result in a substring that is not a valid relative path, or even an exception (if the file is outside the base directory).
Consequence: This could cause incorrect exclusion logic or even runtime exceptions.
Fix: Use a robust method to get the relative path, such as Path relativize from java.nio.file.Path.
Metadata
Metadata
Assignees
Labels
No labels