diff options
author | aclement <aclement> | 2008-05-30 17:17:33 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-05-30 17:17:33 +0000 |
commit | 505afcd27a23ec54b9e29b012c8f2f32f235a0d5 (patch) | |
tree | b69c11d7f3a5b9073a9d13cc27f807e23a23aed5 /org.aspectj.ajdt.core | |
parent | f60b873b16f0123cbe5143b1092d1ff512bfa157 (diff) | |
download | aspectj-505afcd27a23ec54b9e29b012c8f2f32f235a0d5.tar.gz aspectj-505afcd27a23ec54b9e29b012c8f2f32f235a0d5.zip |
231396: Pass the classname, reduces bytecode parses to discover it later
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java index 415a1456b..ea2e3ccb9 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java @@ -10,8 +10,11 @@ *******************************************************************************/ package org.aspectj.ajdt.internal.compiler; +import java.util.Iterator; + import org.aspectj.weaver.bcel.UnwovenClassFile; import org.aspectj.weaver.bcel.UnwovenClassFileWithThirdPartyManagedBytecode; +import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile; import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; @@ -38,11 +41,15 @@ public class ClassFileBasedByteCodeProvider public static UnwovenClassFile[] unwovenClassFilesFor(CompilationResult result, IOutputClassFileNameProvider nameProvider) { ClassFile[] cfs = result.getClassFiles(); - UnwovenClassFile[] ret = new UnwovenClassFile[cfs.length]; - for (int i = 0; i < ret.length; i++) { - ClassFileBasedByteCodeProvider p = new ClassFileBasedByteCodeProvider(cfs[i]); - String fileName = nameProvider.getOutputClassFileName(cfs[i].fileName(), result); - ret[i] = new UnwovenClassFileWithThirdPartyManagedBytecode(fileName,p); + UnwovenClassFile[] ret = new UnwovenClassFile[result.compiledTypes.size()]; + int i=0; + for (Iterator iterator = result.compiledTypes.keySet().iterator(); iterator.hasNext();) { + char[] className = (char[])iterator.next(); + ClassFile cf = (ClassFile)result.compiledTypes.get(className); + // OPTIMIZE use char[] for classname + ClassFileBasedByteCodeProvider p = new ClassFileBasedByteCodeProvider(cf); + String fileName = nameProvider.getOutputClassFileName(cf.fileName(), result); + ret[i++] = new UnwovenClassFileWithThirdPartyManagedBytecode(fileName,new String(className).replace('/','.'),p); } return ret; } |