aboutsummaryrefslogtreecommitdiffstats
path: root/asm/src
diff options
context:
space:
mode:
authormkersten <mkersten>2003-02-18 09:23:58 +0000
committermkersten <mkersten>2003-02-18 09:23:58 +0000
commit32a7e80fac54b553e98e5049e9f9f5b8bb765a60 (patch)
tree001112385a72b41c9751f2625ea8bab93b582304 /asm/src
parentab6b18d68794cfee99eaf1f2a914c501eb596f9d (diff)
downloadaspectj-32a7e80fac54b553e98e5049e9f9f5b8bb765a60.tar.gz
aspectj-32a7e80fac54b553e98e5049e9f9f5b8bb765a60.zip
Fixed source line mapping errors.
Fixed formatting of pointcuts. Added a few more tests for above.
Diffstat (limited to 'asm/src')
-rw-r--r--asm/src/org/aspectj/asm/StructureModel.java34
1 files changed, 22 insertions, 12 deletions
diff --git a/asm/src/org/aspectj/asm/StructureModel.java b/asm/src/org/aspectj/asm/StructureModel.java
index e58159087..263a32853 100644
--- a/asm/src/org/aspectj/asm/StructureModel.java
+++ b/asm/src/org/aspectj/asm/StructureModel.java
@@ -114,18 +114,22 @@ public class StructureModel implements Serializable {
* @param sourceFilePath modified to '/' delimited path for consistency
* @return a new structure node for the file if it was not found in the model
*/
- public StructureNode findRootNodeForSourceFile(String sourceFilePath) {
- if (!isValid() || sourceFilePath == null) {
- return StructureModel.NO_STRUCTURE;
- } else {
- String correctedPath = sourceFilePath;//.replace('\\', '/');
- StructureNode node = (StructureNode)getFileMap().get(correctedPath);//findFileNode(filePath, model);
- if (node != null) {
- return node;
- } else {
- return createFileStructureNode(sourceFilePath);
- }
- }
+ public StructureNode findRootNodeForSourceFile(String sourceFile) {
+ try {
+ if (!isValid() || sourceFile == null) {
+ return StructureModel.NO_STRUCTURE;
+ } else {
+ String correctedPath = new File(sourceFile).getCanonicalPath();//.replace('\\', '/');
+ StructureNode node = (StructureNode)getFileMap().get(correctedPath);//findFileNode(filePath, model);
+ if (node != null) {
+ return node;
+ } else {
+ return createFileStructureNode(correctedPath);
+ }
+ }
+ } catch (Exception e) {
+ return StructureModel.NO_STRUCTURE;
+ }
}
/**
@@ -175,6 +179,12 @@ public class StructureModel implements Serializable {
private boolean matches(StructureNode node, String sourceFilePath, int lineNumber) {
try {
+// if (node != null && node.getSourceLocation() != null)
+// System.err.println("====\n1: " +
+// sourceFilePath + "\n2: " +
+// node.getSourceLocation().getSourceFile().getCanonicalPath().equals(sourceFilePath)
+// );
+
return node != null
&& node.getSourceLocation() != null
&& node.getSourceLocation().getSourceFile().getCanonicalPath().equals(sourceFilePath)