From a43ec0b4cfa28267dab8b1a87e100db44642a614 Mon Sep 17 00:00:00 2001 From: mkersten Date: Fri, 5 Sep 2003 06:47:57 +0000 Subject: [PATCH] Removed asm path canonicalization. --- .../asm/internal/AspectJElementHierarchy.java | 14 ++++++------ .../aspectj/asm/internal/ProgramElement.java | 22 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java index f33a5b9c8..5dba7de54 100644 --- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java +++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java @@ -163,7 +163,7 @@ public class AspectJElementHierarchy implements IHierarchy { if (!isValid() || sourceFile == null) { return IHierarchy.NO_STRUCTURE; } else { - String correctedPath = new File(sourceFile).getCanonicalPath();//.replace('\\', '/'); + String correctedPath = new File(sourceFile).getAbsolutePath();//.replace('\\', '/'); //StructureNode node = (StructureNode)getFileMap().get(correctedPath);//findFileNode(filePath, model); IProgramElement node = (IProgramElement)findInFileMap(correctedPath);//findFileNode(filePath, model); if (node != null) { @@ -182,7 +182,7 @@ public class AspectJElementHierarchy implements IHierarchy { */ public IProgramElement findElementForSourceLine(ISourceLocation location) { try { - return findElementForSourceLine(location.getSourceFile().getCanonicalPath(), location.getLine()); + return findElementForSourceLine(location.getSourceFile().getAbsolutePath(), location.getLine()); } catch (Exception e) { return null; } @@ -233,7 +233,7 @@ public class AspectJElementHierarchy implements IHierarchy { } private boolean matches(IProgramElement node, String sourceFilePath, int lineNumber) { - try { +// try { // if (node != null && node.getSourceLocation() != null) // System.err.println("====\n1: " + // sourceFilePath + "\n2: " + @@ -241,16 +241,16 @@ public class AspectJElementHierarchy implements IHierarchy { // ); return node != null && node.getSourceLocation() != null - && node.getSourceLocation().getSourceFile().getCanonicalPath().equals(sourceFilePath) + && node.getSourceLocation().getSourceFile().getAbsolutePath().equals(sourceFilePath) && ((node.getSourceLocation().getLine() <= lineNumber && node.getSourceLocation().getEndLine() >= lineNumber) || (lineNumber <= 1 && node.getKind().isSourceFileKind()) ); - } catch (IOException ioe) { - return false; - } +// } catch (IOException ioe) { +// return false; +// } } private boolean hasMoreSpecificChild(IProgramElement node, String sourceFilePath, int lineNumber) { diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java index ecf1c862d..327a88d78 100644 --- a/asm/src/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java @@ -416,36 +416,36 @@ public class ProgramElement implements IProgramElement { // TODO: determine if using canonical path incurrs performance overhead public static String createHandleIdentifier(File sourceFile, int line,int column) { - try { +// try { StringBuffer sb = new StringBuffer(); - sb.append(sourceFile.getCanonicalPath()); + sb.append(sourceFile.getAbsolutePath()); sb.append(ID_DELIM); sb.append(line); sb.append(ID_DELIM); sb.append(column); return sb.toString(); - } catch (IOException ioe) { - ioe.printStackTrace(); - return null; - } +// } catch (IOException ioe) { +// ioe.printStackTrace(); +// return null; +// } } public String getHandleIdentifier() { - try { +// try { StringBuffer sb = new StringBuffer(); if (sourceLocation == null) { return null; } else { - sb.append(sourceLocation.getSourceFile().getCanonicalPath()); + sb.append(sourceLocation.getSourceFile().getAbsolutePath()); sb.append(ID_DELIM); sb.append(sourceLocation.getLine()); sb.append(ID_DELIM); sb.append(sourceLocation.getColumn()); return sb.toString(); } - } catch (IOException ioe) { - return null; - } +// } catch (IOException ioe) { +// return null; +// } } public List getParameterNames() { -- 2.39.5