db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r418651 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
Date Sun, 02 Jul 2006 21:51:52 GMT
Author: tomdz
Date: Sun Jul  2 14:51:51 2006
New Revision: 418651

URL: http://svn.apache.org/viewvc?rev=418651&view=rev
Log:
Added null check to unescape function

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java?rev=418651&r1=418650&r2=418651&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java Sun Jul 
2 14:51:51 2006
@@ -1059,20 +1059,23 @@
         String result = text;
 
         // we need special handling if the single quote is escaped via a double single quote
-        if (escaped.equals("''"))
+        if (result != null)
         {
-            if ((result.length() >= 2) && result.startsWith("'") && result.endsWith("'"))
+            if (escaped.equals("''"))
             {
-                result = "'" + StringUtils.replace(result.substring(1, result.length() -
1), escaped, unescaped) + "'";
+                if ((result.length() >= 2) && result.startsWith("'") &&
result.endsWith("'"))
+                {
+                    result = "'" + StringUtils.replace(result.substring(1, result.length()
- 1), escaped, unescaped) + "'";
+                }
+                else
+                {
+                    result = StringUtils.replace(result, escaped, unescaped);
+                }
             }
             else
             {
                 result = StringUtils.replace(result, escaped, unescaped);
             }
-        }
-        else
-        {
-            result = StringUtils.replace(result, escaped, unescaped);
         }
         return result;
     }



Mime
View raw message