SonarQube 6.7.6
SonarJava 5.11
String’s split method has an optimization that doesn’t create a regex if the parameter is a one character string. RegexPatternsNeedlesslyCheck tries to detect this case, but fails for “\n”.
The following code triggers S4248, when it shouldn’t.
String str = "abc";
str.split("\n");