It think it's this something like this signature from my class. There is no other usage of a collection or enum other than this inside the class.
enum AnEnum { A, B, C }
public void someMethod(final Collection<AnEnum> collection) {
Stack trace below.
Exception analyzing com.example.MyClass using detector com.mebigfatguy.fbcontrib.detect.UseEnumCollections
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at com.mebigfatguy.fbcontrib.utils.TernaryPatcher.post(TernaryPatcher.java:87)
at com.mebigfatguy.fbcontrib.detect.UseEnumCollections.sawOpcode(UseEnumCollections.java:207)
at edu.umd.cs.findbugs.visitclass.DismantleBytecode.visit(DismantleBytecode.java:878)
at edu.umd.cs.findbugs.visitclass.BetterVisitor.visitCode(BetterVisitor.java:218)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitCode(PreorderVisitor.java:243)
at com.mebigfatguy.fbcontrib.detect.UseEnumCollections.visitCode(UseEnumCollections.java:113)
at org.apache.bcel.classfile.Code.accept(Code.java:131)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.doVisitMethod(PreorderVisitor.java:315)
at edu.umd.cs.findbugs.visitclass.PreorderVisitor.visitJavaClass(PreorderVisitor.java:397)
at org.apache.bcel.classfile.JavaClass.accept(JavaClass.java:213)
at edu.umd.cs.findbugs.BytecodeScanningDetector.visitClassContext(BytecodeScanningDetector.java:38)
at com.mebigfatguy.fbcontrib.detect.UseEnumCollections.visitClassContext(UseEnumCollections.java:88)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
at edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)
at java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:247)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
at de.tobject.findbugs.builder.FindBugsWorker.runFindBugs(FindBugsWorker.java:314)
at de.tobject.findbugs.builder.FindBugsWorker.work(FindBugsWorker.java:220)
at de.tobject.findbugs.actions.FindBugsAction$StartedFromViewJob.runWithProgress(FindBugsAction.java:275)
at de.tobject.findbugs.FindBugsJob.run(FindBugsJob.java:142)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
It think it's this something like this signature from my class. There is no other usage of a collection or enum other than this inside the class.
Stack trace below.