error-prone
error-prone copied to clipboard
StringSplitter Pattern not Consistently Detected
Expected: Code snippet that uses String.split(String)
, e.g. "me:you".split(":")
, should consistently trigger StringSplitter pattern.
Actual: When passed as parameter into certain other methods List.of(T...)
, Stream.of(T...)
, Arrays.asList(T...)
and Assertions.assertThat(T[])
(from AssertJ), the above snippet does not trigger StringSplitter (please see minimal example project at https://github.com/iadcode/sample-string-splitter).
JDK: 11.0.16.1 (also observed on 17.0.4.1) Maven: 2.8.6 Errorprone Maven Plugin: 2.15.0
Screenshots of Compiling Example Project
Test Case 1 - StringSplitter is triggered
Test Case 2 - StringSplitter not triggered
Hi all. Can I ask if we have had any luck with this issue?
Since this issue was raised, we have observed StringSplitter
is not being triggered in more cases:
- When passed in as a parameter to a method (not just a selective number of methods as originally stated in the issue).
- When being assigned to a field on the class instead of a local variable.
Thank you very much for your time.