Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid a possible
IndexOutOfBoundsException
in MemberName
.
Ordinarily we shouldn't see an empty class name but it appears that sometimes we do: [] ``` Sep 26, 2024 10:29:02 AM com.google.devtools.staticanalysis.pipeline.java.errorprone.ErrorProneFindingsJavacAnalyzer$1 handleError WARNING: crash in Error Prone analyzer MemberName [CONTEXT ratelimit_period="5 SECONDS" analyzer="JavaStyle" ] java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55) at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) at java.base/java.lang.String.checkIndex(String.java:4881) at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:46) at java.base/java.lang.String.charAt(String.java:1582) at com.google.errorprone.bugpatterns.MemberName.isConformantUpperCamelName(MemberName.java:290) at com.google.errorprone.bugpatterns.MemberName.matchClass(MemberName.java:111) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:460) at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:558) at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:157) ``` PiperOrigin-RevId: 679249176
- Loading branch information