mrglavas 2004/03/03 14:52:33 Modified: java/src/org/apache/xerces/dom CoreDocumentImpl.java Log: Fixing Bug #27421:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27421 getFeature was throwing a NullPointerException when the version passed into the method was null. This is fixed thanks to the patch from Naela Nissar. Revision Changes Path 1.68 +8 -4 xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java Index: CoreDocumentImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- CoreDocumentImpl.java 3 Mar 2004 19:28:00 -0000 1.67 +++ CoreDocumentImpl.java 3 Mar 2004 22:52:33 -0000 1.68 @@ -479,9 +479,14 @@ * @since DOM Level 3 */ public Object getFeature(String feature, String version) { + + boolean anyVersion = version == null || version.length() == 0; + if ((feature.equalsIgnoreCase("XPath") - || feature.equalsIgnoreCase("+XPath"))&& version.equals("3.0")){ - try{ + || feature.equalsIgnoreCase("+XPath")) && + (anyVersion || version.equals("3.0"))) { + + try { Class xpathClass = ObjectFactory.findProviderClass( "org.apache.xpath.domapi.XPathEvaluatorImpl", ObjectFactory.findClassLoader(), true); @@ -491,7 +496,6 @@ return fXPathEvaluator; } catch (Exception e){ - //e.printStackTrace(); return null; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]