diff options
author | wisberg <wisberg> | 2003-05-05 15:08:55 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-05-05 15:08:55 +0000 |
commit | 779e49fb268f8e90442e5260289d882cfc945e08 (patch) | |
tree | 2842f8cea80813302de4d24a7773567748a61d1d /org.aspectj.ajdt.core | |
parent | 11d2388cf977424369ede0047098222dd458bafc (diff) | |
download | aspectj-779e49fb268f8e90442e5260289d882cfc945e08.tar.gz aspectj-779e49fb268f8e90442e5260289d882cfc945e08.zip |
NPE guard - client of getSourceLocation only uses files - enforcing that.
(ajcTests.xml -emacssym passes)
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java index 4c19219aa..1b6283086 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java @@ -65,6 +65,12 @@ public class EmacsStructureModelManager { // } private void dumpStructureToFile(ProgramElementNode node) throws IOException { + String s = node.getKind(); + if (! (s.equals(ProgramElementNode.Kind.FILE_ASPECTJ.toString()) + || s.equals(ProgramElementNode.Kind.FILE_JAVA.toString()))) { + throw new IllegalArgumentException("externalize file, not " + node); + } + // source files have source locations String sourceName = node.getSourceLocation().getSourceFile().getAbsolutePath(); String fileName = sourceName.substring(0, sourceName.lastIndexOf(".")) + EXTERN_FILE_SUFFIX; BufferedWriter writer = null; |