Browse Source

354947: remove unused code that created an NPE than ate it

tags/V1_6_12M2
aclement 12 years ago
parent
commit
e71e287b8c
1 changed files with 16 additions and 25 deletions
  1. 16
    25
      weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java

+ 16
- 25
weaver/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java View File

@@ -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 {

Loading…
Cancel
Save