You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/08 15:17:07 UTC
cvs commit: jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml WebXmlIo.java WebXmlMerger.java
cmlenz 2003/05/08 06:17:07
Modified: integration/ant/src/java/org/apache/cactus/integration/ant/webxml
Tag: CACTUS_14_ANT_BRANCH WebXmlIo.java
WebXmlMerger.java
Log:
Avoid NPEs for web.xml files without a DOCTYPE decl
Revision Changes Path
No revision
No revision
1.1.2.4 +8 -4 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/Attic/WebXmlIo.java
Index: WebXmlIo.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/Attic/WebXmlIo.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- WebXmlIo.java 1 May 2003 13:39:26 -0000 1.1.2.3
+++ WebXmlIo.java 8 May 2003 13:17:06 -0000 1.1.2.4
@@ -163,9 +163,13 @@
factory.setValidating(false);
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
- DocumentType docType =
- builder.getDOMImplementation().createDocumentType("web-app",
- theVersion.getPublicId(), theVersion.getSystemId());
+ DocumentType docType = null;
+ if (theVersion != null)
+ {
+ docType =
+ builder.getDOMImplementation().createDocumentType("web-app",
+ theVersion.getPublicId(), theVersion.getSystemId());
+ }
Document doc = builder.getDOMImplementation().createDocument(
"", "web-app", docType);
return new WebXml(doc);
1.4.2.3 +3 -2 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/WebXmlMerger.java
Index: WebXmlMerger.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/WebXmlMerger.java,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -r1.4.2.2 -r1.4.2.3
--- WebXmlMerger.java 30 Apr 2003 15:38:41 -0000 1.4.2.2
+++ WebXmlMerger.java 8 May 2003 13:17:06 -0000 1.4.2.3
@@ -138,7 +138,8 @@
*/
protected final void checkServletVersions(WebXml theWebXml)
{
- if (this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0)
+ if ((this.webXml.getVersion() != null)
+ && (this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0))
{
this.log.warn(
"Merging elements from a version " + theWebXml.getVersion()
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org