Skip to content

ArrayIndexOutOfBoundsException with external script

If I use an external script, I get an ArrayIndexOutOfBoundsException "Index 2 out of bounds for length 2".

minimalTestScript.groovy script-external-groovy.dsl

I can trace it down to: InterceptParserAspect.java

When an external script is included the joinPoint wraps a com.structurizr.dsl.ExternalScriptDslContext instead of an com.structurizr.dsl.InlineScriptDslContext with a different number of args.

As I cannot figure out what is panned with this joinPoint, I'm not able to provide a first draft of fix. But I hope this details help to fix it.