diff options
author | aclement <aclement> | 2011-08-17 15:54:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-08-17 15:54:09 +0000 |
commit | e71e287b8c6c18370b79f7f8bacc734274573267 (patch) | |
tree | 59bc1080f2f1ca7fb57e514028f09e637fdd17f1 /weaver | |
parent | 9b5b731ed004703c148340059496f8b5eda76928 (diff) | |
download | aspectj-e71e287b8c6c18370b79f7f8bacc734274573267.tar.gz aspectj-e71e287b8c6c18370b79f7f8bacc734274573267.zip |
354947: remove unused code that created an NPE than ate it
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java index 958bd1a3d..085189dfc 100644 --- a/weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java @@ -80,7 +80,6 @@ public class DocumentParser extends DefaultHandler { private static final boolean CACHE; private static final boolean LIGHTPARSER; - static { boolean value = false; try { @@ -89,10 +88,11 @@ public class DocumentParser extends DefaultHandler { t.printStackTrace(); } CACHE = value; - + value = false; try { - value = System.getProperty("org.aspectj.weaver.loadtime.configuration.lightxmlparser", "false").equalsIgnoreCase("true"); + value = System.getProperty("org.aspectj.weaver.loadtime.configuration.lightxmlparser", "false") + .equalsIgnoreCase("true"); } catch (Throwable t) { t.printStackTrace(); } @@ -104,31 +104,22 @@ public class DocumentParser extends DefaultHandler { } public static Definition parse(final URL url) throws Exception { - InputStream in = null; - try { - if (CACHE && parsedFiles.containsKey(url.toString())) { - return parsedFiles.get(url.toString()); - } - Definition def=null; - - if(LIGHTPARSER){ - def = SimpleAOPParser.parse(url); - }else{ - def = saxParsing(url); - } - - if (CACHE && def.getAspectClassNames().size() > 0) { - parsedFiles.put(url.toString(), def); - } + if (CACHE && parsedFiles.containsKey(url.toString())) { + return parsedFiles.get(url.toString()); + } + Definition def = null; - return def; - } finally { - try { - in.close(); - } catch (Throwable t) { + if (LIGHTPARSER) { + def = SimpleAOPParser.parse(url); + } else { + def = saxParsing(url); + } - } + if (CACHE && def.getAspectClassNames().size() > 0) { + parsedFiles.put(url.toString(), def); } + + return def; } private static Definition saxParsing(URL url) throws SAXException, ParserConfigurationException, IOException { |