} | } | ||||
} | } | ||||
private void inflate() { | private void inflate() { | ||||
try { | try { | ||||
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data)); | DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data)); | ||||
int numberOfAnnotations = dis.readUnsignedShort(); | int numberOfAnnotations = dis.readUnsignedShort(); | ||||
for (int i = 0; i < numberOfAnnotations; i++) { | |||||
annotations.add(AnnotationGen.read(dis, getConstantPool(), visible)); | |||||
if (numberOfAnnotations > 0) { | |||||
List<AnnotationGen> inflatedAnnotations = new ArrayList<AnnotationGen>(); | |||||
for (int i = 0; i < numberOfAnnotations; i++) { | |||||
inflatedAnnotations.add(AnnotationGen.read(dis, getConstantPool(), visible)); | |||||
} | |||||
annotations = inflatedAnnotations; | |||||
} | } | ||||
dis.close(); | dis.close(); | ||||
inflated = true; | inflated = true; |
try { | try { | ||||
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data)); | DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data)); | ||||
int numParameters = dis.readUnsignedByte(); | int numParameters = dis.readUnsignedByte(); | ||||
for (int i=0; i<numParameters; i++) { | |||||
int numAnnotations = dis.readUnsignedShort(); | |||||
AnnotationGen[] annotations = new AnnotationGen[numAnnotations]; | |||||
for (int j=0; j<numAnnotations; j++) { | |||||
annotations[j] = AnnotationGen.read(dis,getConstantPool(),visible); | |||||
if (numParameters > 0) { | |||||
List<AnnotationGen[]> inflatedParameterAnnotations = new ArrayList<AnnotationGen[]>(); | |||||
for (int i=0; i<numParameters; i++) { | |||||
int numAnnotations = dis.readUnsignedShort(); | |||||
if (numAnnotations == 0 ) { | |||||
inflatedParameterAnnotations.add(AnnotationGen.NO_ANNOTATIONS); | |||||
} else { | |||||
AnnotationGen[] annotations = new AnnotationGen[numAnnotations]; | |||||
for (int j=0; j<numAnnotations; j++) { | |||||
annotations[j] = AnnotationGen.read(dis,getConstantPool(),visible); | |||||
} | |||||
inflatedParameterAnnotations.add(annotations); | |||||
} | |||||
} | } | ||||
parameterAnnotations.add(annotations); | |||||
parameterAnnotations = inflatedParameterAnnotations; | |||||
} | } | ||||
inflated = true; | inflated = true; | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { |
org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[] anns = jc.getAnnotations(); | org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[] anns = jc.getAnnotations(); | ||||
bcelRepository.clear(); | bcelRepository.clear(); | ||||
if (anns == null) | if (anns == null) | ||||
return new ResolvedType[0]; | |||||
return ResolvedType.NONE; | |||||
ResolvedType[] ret = new ResolvedType[anns.length]; | ResolvedType[] ret = new ResolvedType[anns.length]; | ||||
for (int i = 0; i < ret.length; i++) { | for (int i = 0; i < ret.length; i++) { | ||||
ret[i] = inWorld.resolve(UnresolvedType.forSignature(anns[i].getTypeSignature())); | ret[i] = inWorld.resolve(UnresolvedType.forSignature(anns[i].getTypeSignature())); |