Then tell us:
- What language is this for? → JAVA
- Which rule? → java:S1075
- Why do you believe it’s a false-positive/false-negative? → It is hard coded but not used as part of a uri, it is more like a default or fallback
- Are you using
- SonarCloud? → Yes
- SonarLint - which IDE/version? → IntelliJ 2024.1.3, Sonar Plugin 10.11.1.79663
- in connected mode with SonarQube or SonarCloud? → Connect with Sonar Cloud
- How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
public static final String DEFAULT_EXAMPLE_PATH = "/a-great/path/for-this-example";
@Value("${url.example-app.path.the-great-one:" + DEFAULT_EXAMPLE_PATH + "}")
private String greatExamplePath;
In my Opinion when a URI-Constant is just used as part of @Value
default then this should not be raised.