diff options
author | acolyer <acolyer> | 2004-03-18 14:40:20 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-03-18 14:40:20 +0000 |
commit | bd589bc1fad5a97182de39ec47310aef1a288d8b (patch) | |
tree | acf11883f30585b0b17d85211ff58c3522e894a5 /weaver | |
parent | 7d6b500be325633c3057abaf973b8c56464d6706 (diff) | |
download | aspectj-bd589bc1fad5a97182de39ec47310aef1a288d8b.tar.gz aspectj-bd589bc1fad5a97182de39ec47310aef1a288d8b.zip |
fix for Bugzilla Bug 54621
Incremental support ignores binary source
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index d900c2035..465bbcb27 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -167,27 +167,7 @@ public class BcelWeaver implements IWeaver { // For each file, add it either as a real .class file or as a resource for (int i = 0; i < files.length; i++) { - - FileInputStream fis = new FileInputStream(files[i]); - byte[] bytes = FileUtil.readAsByteArray(fis); - // String relativePath = files[i].getPath(); - - // ASSERT: files[i].getAbsolutePath().startsWith(inFile.getAbsolutePath() - // or we are in trouble... - String filename = files[i].getAbsolutePath().substring( - inFile.getAbsolutePath().length()+1); - UnwovenClassFile classFile = new UnwovenClassFile(new File(outDir,filename).getAbsolutePath(),bytes); - if (filename.endsWith(".class")) { - // System.err.println("BCELWeaver: processing class from input directory "+classFile); - this.addClassFile(classFile); - addedClassFiles.add(classFile); -// } else { -// if (CopyResourcesFromInpathDirectoriesToOutput) { -// // System.err.println("BCELWeaver: processing resource from input directory "+filename); -// addResource(filename,classFile); -// } - } - fis.close(); + addedClassFiles.add(addClassFile(files[i],inFile,outDir)); } return addedClassFiles; @@ -289,6 +269,24 @@ public class BcelWeaver implements IWeaver { // } world.addSourceObjectType(classFile.getJavaClass()); } + + public UnwovenClassFile addClassFile(File classFile, File inPathDir, File outDir) throws IOException { + FileInputStream fis = new FileInputStream(classFile); + byte[] bytes = FileUtil.readAsByteArray(fis); + // String relativePath = files[i].getPath(); + + // ASSERT: files[i].getAbsolutePath().startsWith(inFile.getAbsolutePath() + // or we are in trouble... + String filename = classFile.getAbsolutePath().substring( + inPathDir.getAbsolutePath().length()+1); + UnwovenClassFile ucf = new UnwovenClassFile(new File(outDir,filename).getAbsolutePath(),bytes); + if (filename.endsWith(".class")) { + // System.err.println("BCELWeaver: processing class from input directory "+classFile); + this.addClassFile(ucf); + } + fis.close(); + return ucf; + } public void deleteClassFile(String typename) { |