Fix ArrayIndexOutOfBoundsException when running Confluence Data Center Plugin Validator

Kha Nguyen
1 min readMar 14, 2021

--

If you encounter this error when running Atlassian’s Confluence Data Center Plugin Validator:

[findbugs] java.lang.ArrayIndexOutOfBoundsException
[findbugs] at org.objectweb.asm.ClassReader.readClass(Unknown Source)
[findbugs] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[findbugs] at edu.umd.cs.findbugs.asm.FBClassReader.accept(FBClassReader.java:44)
[findbugs] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[findbugs] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:110)
[findbugs] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:587)
[findbugs] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:76)
[findbugs] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:38)
[findbugs] at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getClassAnalysis(AnalysisCache.java:268)
[findbugs] at edu.umd.cs.findbugs.ba.npe.TypeQualifierNullnessAnnotationDatabase.getXMethod(TypeQualifierNullnessAnnotationDatabase.java:363)
[findbugs] at edu.umd.cs.findbugs.ba.npe.TypeQualifierNullnessAnnotationDatabase.addMethodParameterAnnotation(TypeQualifierNullnessAnnotationDatabase.java:425)
[findbugs] at edu.umd.cs.findbugs.ba.DefaultNullnessAnnotations.addDefaultNullnessAnnotations(DefaultNullnessAnnotations.java:69)
[findbugs] at edu.umd.cs.findbugs.ba.npe.TypeQualifierNullnessAnnotationDatabase.loadAuxiliaryAnnotations(TypeQualifierNullnessAnnotationDatabase.java:460)
[findbugs] at edu.umd.cs.findbugs.ba.AnalysisContext.updateDatabases(AnalysisContext.java:962)
[findbugs] at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1154)
[findbugs] at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:282)
[findbugs] at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:393)
[findbugs] at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1317)
[findbugs] Java Result: 4

… and you’re on Java 8, then read on for the explanation and how to fix.

The root cause is that our Plugin Validator is using findbugs@2.0.3 and this version doesn’t work with Java 8, we will need at least findbugs@3.0.0 to support Java 8 (see this comment). So now, we just need to tell the Validator to use findbugs@3.x instead.

Here’s how the Validator works:

  • It will download findbugs-2.0.3 into the current directory
  • It will copy Atlassian’s Findbug plugin (findbugs-atlassian-plugin-0.2.jar) into findbugs-2.0.3/plugin folder
  • It will run Findbug

So based on this knowledge, we can easily make the Validator use findbugs@3.x

  • Run the Validator first and copy findbugs-2.0.3/plugin/findbugs-atlassian-plugin-0.2.jar to somewhere
  • Delete the folder findbugs-2.0.3
  • Download findbugs@3.x, unzip it into the current directory, then rename to findbugs-2.0.3
  • Copy findbugs-atlassian-plugin-0.2.jar to plugin folder
  • Run the Validator

--

--

Kha Nguyen
0 Followers

Polyglot software engineer, noise maker at work, LEGO AFOL at home