From 91109eab15f47311489b5028aea3f1fc056b1d41 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 28 May 2008 23:54:05 +0000 Subject: [PATCH] 231396: Comment #4: Big Refactoring --- .../weaver/reflect/Java15AnnotationFinder.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java index c5f0b62f3..47f70c366 100644 --- a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java +++ b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java @@ -112,7 +112,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { // memory. try { JavaClass jc = bcelRepository.loadClass(onMember.getDeclaringClass()); - org.aspectj.apache.bcel.classfile.annotation.Annotation[] anns = new org.aspectj.apache.bcel.classfile.annotation.Annotation[0]; + org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[] anns = new org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[0]; if (onMember instanceof Method) { org.aspectj.apache.bcel.classfile.Method bcelMethod = jc.getMethod((Method)onMember); if (bcelMethod == null) { @@ -130,7 +130,8 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { } // the answer is cached and we don't want to hold on to memory bcelRepository.clear(); - if (anns == null) anns = new org.aspectj.apache.bcel.classfile.annotation.Annotation[0]; + // OPTIMIZE make constant 0 size array for sharing + if (anns == null) anns = new org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[0]; // convert to our Annotation type for (int i=0;i annSet = new HashSet(); for (int i = 0; i < anns.length; i++) { @@ -225,7 +227,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { // memory. try { JavaClass jc = bcelRepository.loadClass(forClass); - org.aspectj.apache.bcel.classfile.annotation.Annotation[] anns =jc.getAnnotations(); + org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[] anns =jc.getAnnotations(); bcelRepository.clear(); if (anns == null) return new ResolvedType[0]; ResolvedType[] ret = new ResolvedType[anns.length]; @@ -293,7 +295,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { // memory. try { JavaClass jc = bcelRepository.loadClass(onMember.getDeclaringClass()); - org.aspectj.apache.bcel.classfile.annotation.Annotation[][] anns = null; + org.aspectj.apache.bcel.classfile.annotation.AnnotationGen[][] anns = null; if (onMember instanceof Method) { org.aspectj.apache.bcel.classfile.Method bcelMethod = jc.getMethod((Method)onMember); if (bcelMethod == null) { -- 2.39.5