From 49e81e381f27df70e6d9000c56ac05155777f9d2 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 6 Apr 2009 15:38:50 +0000 Subject: [PATCH] 271201: inpath handle: can determine if class is from inpath in add method now --- weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index 5fee7ed95..1d285acc3 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -371,7 +371,7 @@ public class BcelWeaver { UnwovenClassFile classFile = new UnwovenClassFile(new File(outDir, filename).getAbsolutePath(), bytes); if (filename.endsWith(".class")) { - this.addClassFile(classFile); + this.addClassFile(classFile,false); addedClassFiles.add(classFile); } // else if (!entry.isDirectory()) { @@ -436,13 +436,16 @@ public class BcelWeaver { /** * Should be addOrReplace */ - public void addClassFile(UnwovenClassFile classFile) { + public void addClassFile(UnwovenClassFile classFile, boolean fromInpath) { addedClasses.add(classFile); // if (null != sourceJavaClasses.put(classFile.getClassName(), // classFile)) { // // throw new RuntimeException(classFile.getClassName()); // } - world.addSourceObjectType(classFile.getJavaClass()); + ReferenceType type = world.addSourceObjectType(classFile.getJavaClass()).getResolvedTypeX(); + if (fromInpath) { + type.setBinaryPath(classFile.getFilename()); + } } public UnwovenClassFile addClassFile(File classFile, File inPathDir, File outDir) throws IOException { @@ -458,7 +461,7 @@ public class BcelWeaver { if (filename.endsWith(".class")) { // System.err.println( // "BCELWeaver: processing class from input directory "+classFile); - this.addClassFile(ucf); + this.addClassFile(ucf,true); } fis.close(); return ucf; -- 2.39.5