diff options
author | aclement <aclement> | 2005-11-02 10:36:05 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-02 10:36:05 +0000 |
commit | 62d16d52c25f7b5ff389ee2de603bbb3dc186c8e (patch) | |
tree | bf1aa96d7ebec9050accf2cf086b4095d923786f /loadtime | |
parent | abaf7e1b8f043d3ae08ac6ce1c64cda6d5aa212c (diff) | |
download | aspectj-62d16d52c25f7b5ff389ee2de603bbb3dc186c8e.tar.gz aspectj-62d16d52c25f7b5ff389ee2de603bbb3dc186c8e.zip |
Matthews patch for 113510
Diffstat (limited to 'loadtime')
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index 3d3df20dd..b160e4960 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -283,11 +283,10 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { ); } //generate key for SC - String aspectCode = readAspect(aspectClassName, loader); if(namespace==null){ - namespace=new StringBuffer(aspectCode); + namespace=new StringBuffer(aspectClassName); }else{ - namespace = namespace.append(";"+aspectCode); + namespace = namespace.append(";"+aspectClassName); } } } @@ -312,12 +311,12 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { gen.getBytes() ); ResolvedType aspect = weaver.addLibraryAspect(concreteAspect.name); + //generate key for SC - String aspectCode = readAspect(concreteAspect.name, loader); if(namespace==null){ - namespace=new StringBuffer(aspectCode); + namespace=new StringBuffer(concreteAspect.name); }else{ - namespace = namespace.append(";"+aspectCode); + namespace = namespace.append(";"+concreteAspect.name); } } } @@ -537,38 +536,4 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { generatedClasses = new HashMap(); } - - /** - * Read in an aspect from the disk and return its bytecode as a String - * @param name the name of the aspect to read in - * @return the bytecode representation of the aspect - */ - private String readAspect(String name, ClassLoader loader){ - if (true) return name+"@"+(loader==null?"0":Integer.toString(loader.hashCode())); - // FIXME AV - ?? can someone tell me why we read the whole bytecode - // especially one byte by one byte - // also it does some NPE sometime (see AtAjLTW "LTW Decp2") - InputStream is = null; - try { - String result = ""; - is = loader.getResourceAsStream(name.replace('.','/')+".class"); - int b = is.read(); - while(b!=-1){ - result = result + b; - b=is.read(); - } - is.close(); - return result; - } catch (IOException e) { - e.printStackTrace(); - return ""; - } catch (NullPointerException e) { - //probably tried to read in a "non aspect @missing@" aspect - System.err.println("ClassLoaderWeavingAdaptor.readAspect() name: "+name+" Exception: "+e); - return ""; - } finally { - try {is.close();} catch (Throwable t) {;} - } - } - } |