diff options
author | avasseur <avasseur> | 2005-05-13 09:37:31 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-05-13 09:37:31 +0000 |
commit | 0852d51f34460040aa3d3c60e47b7e0fe7b7633d (patch) | |
tree | 4b897ec6d3b3bba87b7c53643203ede5dda73fc7 /loadtime/src | |
parent | e8345b8759aebb52e5d56e216cb6634b6591fa54 (diff) | |
download | aspectj-0852d51f34460040aa3d3c60e47b7e0fe7b7633d.tar.gz aspectj-0852d51f34460040aa3d3c60e47b7e0fe7b7633d.zip |
added test entries instead of autowiredtest for Andy sake, fix 1.4 dependancies in loadtime module and util module
Diffstat (limited to 'loadtime/src')
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java index 4e1967870..92f2c4b89 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java @@ -19,6 +19,7 @@ import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.XMLReaderFactory; +import org.aspectj.util.LangUtil; import java.io.InputStream; import java.net.URL; @@ -83,12 +84,21 @@ public class DocumentParser extends DefaultHandler { try { xmlReader.setFeature("http://xml.org/sax/features/validation", false); + } catch (SAXException e) { + ;//fine, the parser don't do validation + } + try { xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false); + } catch (SAXException e) { + ;//fine, the parser don't do validation + } + try { xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); - } catch (SAXNotRecognizedException e) { + } catch (SAXException e) { ;//fine, the parser don't do validation } + xmlReader.setEntityResolver(parser); in = url.openStream(); xmlReader.parse(new InputSource(in)); @@ -106,6 +116,10 @@ public class DocumentParser extends DefaultHandler { if (publicId.equals(DTD_PUBLIC_ID) || publicId.equals(DTD_PUBLIC_ID_ALIAS)) { InputStream in = DTD_STREAM; if (in == null) { + System.err.println( + "AspectJ - WARN - could not read DTD " + + publicId + ); return null; } else { return new InputSource(in); @@ -203,8 +217,7 @@ public class DocumentParser extends DefaultHandler { private static String replaceXmlAnd(String expression) { //TODO AV do we need to handle "..)AND" or "AND(.." ? - //FIXME AV Java 1.4 code - if KO, use some Strings util - return expression.replaceAll(" AND ", " && "); + return LangUtil.replace(expression, " AND ", " && "); } private boolean isNull(String s) { |