You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by ss...@apache.org on 2008/09/10 02:17:10 UTC

svn commit: r693664 - /openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java

Author: ssegu
Date: Tue Sep  9 17:17:10 2008
New Revision: 693664

URL: http://svn.apache.org/viewvc?rev=693664&view=rev
Log:
OPENJPA-657 Removing DOM 3 level methods in parsing XML

Modified:
    openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java

Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java?rev=693664&r1=693663&r2=693664&view=diff
==============================================================================
--- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java (original)
+++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java Tue Sep  9 17:17:10 2008
@@ -139,8 +139,9 @@
 			short nodeType = child.getNodeType();
 			if (nodeType == Node.ELEMENT_NODE) {
 				String errorType = child.getNodeName();
-				if (storeErrorTypes.containsKey(errorType)) {
-					String errorCodes = child.getTextContent();
+				Node textNode = child.getFirstChild();
+				if (storeErrorTypes.containsKey(errorType) && textNode != null){
+					String errorCodes = textNode.getNodeValue();
 					if (!StringUtils.isEmpty(errorCodes)) {
 						String[] codes = errorCodes.split(ERROR_CODE_DELIMITER);
 						for (int k = 0; k < codes.length; k++ ) {