Browse Source

353457

tags/V1_6_12M2
aclement 12 years ago
parent
commit
0f506abfab
1 changed files with 21 additions and 6 deletions
  1. 21
    6
      org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java

+ 21
- 6
org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java View File

} }


/** /**
* Returns the File with pathname to the class file, for example either C:\temp
* \ajcSandbox\workspace\ajcTest16957.tmp\simple.jar!pkg\BinaryAspect.class if the class file is in a jar file, or
* Returns the File with pathname to the class file, for example either:<br>
* C:\temp \ajcSandbox\workspace\ajcTest16957.tmp\simple.jar!pkg\BinaryAspect.class if the class file is in a jar file, or <br>
* C:\temp\ajcSandbox\workspace\ajcTest16957.tmp!pkg\BinaryAspect.class if the class file is in a directory * C:\temp\ajcSandbox\workspace\ajcTest16957.tmp!pkg\BinaryAspect.class if the class file is in a directory
*/ */
private File getBinaryFile() { private File getBinaryFile() {
if (binaryFile == null) { if (binaryFile == null) {
String s = getDeclaringType().getBinaryPath();
if (s.indexOf("!") == -1) {
String binaryPath = getDeclaringType().getBinaryPath();
if (binaryPath == null) {
// Looks like an aspect that has been picked up from the classpath (likely an abstract one
// being extended). As it didn't come in via inpath or aspectpath the binarypath has not
// yet been constructed.

// We can't discover where the file came from now, that info has been lost. So just
// use "classpath" for now - until we discover we need to get this right.

binaryPath = "classpath";
getDeclaringType().setBinaryPath(binaryPath);
// ReferenceTypeDelegate delegate = ((ReferenceType) getDeclaringType()).getDelegate();
// if (delegate instanceof BcelObjectType) {
// grab javaclass... but it doesnt know the originating file
// }
}
if (binaryPath.indexOf("!") == -1) {
File f = getDeclaringType().getSourceLocation().getSourceFile(); File f = getDeclaringType().getSourceLocation().getSourceFile();
// Replace the source file suffix with .class // Replace the source file suffix with .class
int i = f.getPath().lastIndexOf('.'); int i = f.getPath().lastIndexOf('.');
} else { } else {
path = f.getPath() + ".class"; path = f.getPath() + ".class";
} }
binaryFile = new File(s + "!" + path);
binaryFile = new File(binaryPath + "!" + path);
} else { } else {
binaryFile = new File(s);
binaryFile = new File(binaryPath);
} }
} }
return binaryFile; return binaryFile;

Loading…
Cancel
Save