google / google/error-prone

false positive in OrphanedFormatString check for non-traditional URL schemes

Open
#4,609 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

**What version of Error Prone are you using?**
Latest - 2.33.0

**Does this issue reproduce with the latest release?**
Yes

**What did you do?**

``` java
public static void main(String[] args) {
StringBuilder url = new StringBuilder("https://mydomain%21com/");
url.append("path");
System.out.println(url);
url = new StringBuilder("spiffe://mydomain%21com/");
url.append("path");
System.out.println(url);
}
```
**What did you expect to see?**
No warning

**What did you see instead?**
`[9,29] [OrphanedFormatString] String literal contains format specifiers, but is not passed to a format method`
[9,29] indicates "spiffe://" case, not the "https://" one

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.