From 393654bc12ed4c0379980955c4ed53e6aa6e778e Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 4 Aug 2004 13:37:56 +0000 Subject: [PATCH] Works on Linux too :) --- weaver/src/org/aspectj/weaver/Shadow.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weaver/src/org/aspectj/weaver/Shadow.java b/weaver/src/org/aspectj/weaver/Shadow.java index b34f62e7e..58ae6e723 100644 --- a/weaver/src/org/aspectj/weaver/Shadow.java +++ b/weaver/src/org/aspectj/weaver/Shadow.java @@ -356,7 +356,12 @@ public abstract class Shadow { if (isl==null || isl.getSourceFile()==null || isl.getSourceFile().getName().indexOf("no debug info available")!=-1) { nice.append("no debug info available"); } else { - nice.append(isl.getSourceFile().getName()); + // can't use File.getName() as this fails when a Linux box encounters a path created on Windows and vice-versa + int takeFrom = isl.getSourceFile().getPath().lastIndexOf('/'); + if (takeFrom == -1) { + takeFrom = isl.getSourceFile().getPath().lastIndexOf('\\'); + } + nice.append(isl.getSourceFile().getPath().substring(takeFrom +1)); if (isl.getLine()!=0) nice.append(":").append(isl.getLine()); } return nice.toString(); -- 2.39.5