You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pp...@apache.org on 2008/07/11 01:56:08 UTC
svn commit: r675812 -
/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java
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) {