Fix ArrayIndexOutOfBoundsException when running Confluence Data Center Plugin Validator

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:

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

--

--

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kha Nguyen

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