diff options
author | aclement <aclement> | 2008-09-29 23:22:48 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-29 23:22:48 +0000 |
commit | 5542c2e3afd491f9754444e295adfb7c208ef5df (patch) | |
tree | cb268150a202cd63e146aac49ab744db6d0373a3 | |
parent | 0bf359315c3f18d0c08d3f2562285131aa9936ac (diff) | |
download | aspectj-5542c2e3afd491f9754444e295adfb7c208ef5df.tar.gz aspectj-5542c2e3afd491f9754444e295adfb7c208ef5df.zip |
cope with someone asking the wrong question
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParameterAnnotations.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParameterAnnotations.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParameterAnnotations.java index 1b93f6a86..6f378351c 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParameterAnnotations.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParameterAnnotations.java @@ -52,6 +52,14 @@ public abstract class RuntimeParameterAnnotations extends Attribute { public AnnotationGen[] getAnnotationsOnParameter(int parameterIndex) { if (!inflated) inflate(); + // This may happen. In a ctor for a non static inner type the compiler + // may have added an extra parameter to the generated ctor (the parameter + // contains the instance of the outer class) - in this case + // it may appear that there are more parameters than there are entries + // in the parameter annotations array + if (parameterIndex>=parameterAnnotations.size()) { + return AnnotationGen.NO_ANNOTATIONS; + } return (AnnotationGen[])parameterAnnotations.get(parameterIndex); } |