-
Notifications
You must be signed in to change notification settings - Fork 80
IDETECT-4738: Make detect.binary.scan.file.name.patterns case insensitive #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/java/com/blackduck/integration/detect/configuration/DetectProperties.java
Outdated
Show resolved
Hide resolved
src/main/java/com/blackduck/integration/detect/util/finder/DetectDirectoryFileFilter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/blackduck/integration/detect/lifecycle/autonomous/ScanTypeDecider.java
Outdated
Show resolved
Hide resolved
import org.apache.commons.io.filefilter.WildcardFileFilter; | ||
|
||
public class DetectDirectoryFileFilter implements Predicate<File> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but I feel like the original class name was more fitting. Now it's named CaseSensitive yet it can do both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean... but the reason for changing it was the hope that this would prevent this class from being used without its default behaviour being clear in the future -- It is case sensitive by default but reason for IDETECT-4738 was because this was overlooked/assumed wrong at time of implementing detect.binary.scan.file.name.patterns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I understand the intention I can offer a couple of options for your consideration:
- split this into 2 subclasses:
DetectDirectoryFileFilterCaseSensitive
andDetectDirectoryFileFilterCaseInsensitive
, while having a parent abstract class contain most of the filtering - make the constructor private and have the instantiation done by two different static methods:
createCaseSensitiveFileFilter()
andcreateCaseInsensitiveFIleFilter()
This is optional, especially since the PR is already merged.
Resolves IDETECT-4738
Scope of this PR is limited to detect.binary.scan.file.name.patterns, for which the official docs say: