summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-04 13:50:41 +0000
committeraclement <aclement>2004-08-04 13:50:41 +0000
commit88a602a39d9e8f6872b65c310b4c6c83028f074b (patch)
tree549e823ca5014787919f0c3623eab97a4e4c7bf0 /org.aspectj.ajdt.core
parent393654bc12ed4c0379980955c4ed53e6aa6e778e (diff)
downloadaspectj-88a602a39d9e8f6872b65c310b4c6c83028f074b.tar.gz
aspectj-88a602a39d9e8f6872b65c310b4c6c83028f074b.zip
platform neutral path handling.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
index 6612e66ce..b4acd55be 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
@@ -373,18 +373,27 @@ public class AjLookupEnvironment extends LookupEnvironment {
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);