From 07919b9becd533a113949dce397a2d6ba1879f69 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Thu, 10 Jul 2008 23:56:07 +0000 Subject: [PATCH] OPENJPA-657 Removing DOM 3 level methods in parsing XML git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@675812 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java index dec3e23f9..ad88d036e 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java @@ -120,8 +120,9 @@ public class SQLErrorCodeReader { 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) {