private void reportDeclareParentsMessage(WeaveMessage.WeaveMessageKind wmk,SourceTypeBinding sourceType,ResolvedTypeX parent) {
if (!factory.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) {
String filename = new String(sourceType.getFileName());
- if (filename.lastIndexOf(File.separator)!=-1)
- filename = filename.substring(filename.lastIndexOf(File.separator)+1);
+
+ int takefrom = filename.lastIndexOf('/');
+ if (takefrom == -1 ) takefrom = filename.lastIndexOf('\\');
+ filename = filename.substring(takefrom+1);
factory.getWorld().getMessageHandler().handleMessage(
WeaveMessage.constructWeavingMessage(wmk,
new String[]{CharOperation.toString(sourceType.compoundName),
filename,
parent.getClassName(),
- parent.getSourceLocation().getSourceFile().getName()}));
+ getShortname(parent.getSourceLocation().getSourceFile().getPath())}));
}
}
-
+
+ private String getShortname(String path) {
+ int takefrom = path.lastIndexOf('/');
+ if (takefrom == -1) {
+ takefrom = path.lastIndexOf('\\');
+ }
+ return path.substring(takefrom+1);
+ }
private void addParent(SourceTypeBinding sourceType, ResolvedTypeX parent) {
ReferenceBinding parentBinding = (ReferenceBinding)factory.makeTypeBinding(parent);
if (worthReporting && munger!=null && !weaver.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) {
String tName = weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getName();
if (tName.indexOf("no debug info available")!=-1) tName = "no debug info available";
- String fName = getAspectType().getSourceLocation().getSourceFile().getName();
+ else tName = getShortname(weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getPath());
+ String fName = getShortname(getAspectType().getSourceLocation().getSourceFile().getPath());
if (munger.getKind().equals(ResolvedTypeMunger.Parent)) {
// This message will come out of AjLookupEnvironment.addParent if doing a source
// compilation.
return changed;
}
+
+ private String getShortname(String path) {
+ int takefrom = path.lastIndexOf('/');
+ if (takefrom == -1) {
+ takefrom = path.lastIndexOf('\\');
+ }
+ return path.substring(takefrom+1);
+ }
private boolean mungeNewParent(BcelClassWeaver weaver, NewParentTypeMunger munger) {