aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asm/src/org/aspectj/asm/IHierarchy.java9
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java2
2 files changed, 10 insertions, 1 deletions
diff --git a/asm/src/org/aspectj/asm/IHierarchy.java b/asm/src/org/aspectj/asm/IHierarchy.java
index d4351d17b..50d4a5fc1 100644
--- a/asm/src/org/aspectj/asm/IHierarchy.java
+++ b/asm/src/org/aspectj/asm/IHierarchy.java
@@ -112,4 +112,13 @@ public interface IHierarchy extends Serializable {
* @return any closer match below 'node' or null if nothing is a more accurate match
*/
public IProgramElement findCloserMatchForLineNumber(IProgramElement node, int lineno);
+
+ /**
+ * Discover the node representing a particular source file.
+ *
+ * @param node where in the model to start looking (usually the root on the initial call)
+ * @param sourcefilePath the source file being searched for
+ * @return the node representing that source file or null if it cannot be found
+ */
+ public IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath);
} \ No newline at end of file
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index d7892b56d..cd07bb5d7 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -363,7 +363,7 @@ public class AspectJElementHierarchy implements IHierarchy {
* @param sourcefilePath the source file being searched for
* @return the node representing that source file or null if it cannot be found
*/
- private IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath) {
+ public IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath) {
// 1. why is <root> a sourcefile node?
// 2. should isSourceFile() return true for a FILE that is a .class file...?
if ((node.getKind().isSourceFile() && !node.getName().equals("<root>")) || node.getKind().isFile()) {