openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r675812 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
Date Thu, 10 Jul 2008 23:56:08 GMT
Author: ppoddar
Date: Thu Jul 10 16:56:07 2008
New Revision: 675812

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

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java?rev=675812&r1=675811&r2=675812&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
Thu Jul 10 16:56:07 2008
@@ -120,8 +120,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 (String code : codes) {



Mime
View raw message