Hardcoded file separator
Reports the forward (/
) or backward (\
) slash in a string or character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded.
The inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '<' character or immediately preceding the '>' character, as those often indicate XML or HTML tags rather than file names. Strings representing a java.util.TimeZone
ID, strings that are valid regular expressions, or strings that equal IANA-registered MIME media types will not be reported either.
Example:
new File("C:\\Users\\Name");
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
HardcodedFileSeparator
Use the option to include example/*
in the set of recognized media types. Normally, usage of the example/*
MIME media type outside of an example (e.g. in a Content-Type
header) is an error.
Here you can find the description of settings available for the Hardcoded file separator inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!