One of the Noncompliant code examples in the RSPEC-3039 doesn't raise any issue.
String speech = "Now is the time for all good people to come to the aid of their country.";
String substr1 = speech.substring(-1, speech.length()); // Noncompliant => issue OK
String substr2 = speech.substring(speech.length(), 0); // Noncompliant => no issue
char ch = speech.charAt(speech.length()); // Noncompliant => issue OK
RSPEC-3039"String" calls should not go beyond their bounds