db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r959089 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java
Date Tue, 29 Jun 2010 19:58:12 GMT
Author: kmarsden
Date: Tue Jun 29 19:58:12 2010
New Revision: 959089

URL: http://svn.apache.org/viewvc?rev=959089&view=rev
Log:
DERBY-728 Unable to create databases whose name containg Chinese characters through the client
driver (partial)

Fix SanityManger usage to be wrapped in if (SanityManager.DEBUG) blocks.
Contrubuted by Tiago R. Espinha ( tiago dot derby at yahoo dot co dot uk )



Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java?rev=959089&r1=959088&r2=959089&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Utf8CcsidManager.java Tue Jun
29 19:58:12 2010
@@ -49,7 +49,9 @@ public class Utf8CcsidManager extends Cc
         try {
             return sourceString.getBytes("UTF-8");
         } catch (UnsupportedEncodingException e) {
-            SanityManager.THROWASSERT("Could not convert UCS2 (String) to UTF-8 (byte[])",
e);
+            if (SanityManager.DEBUG) {
+                SanityManager.THROWASSERT("Could not convert Java String to byte[] in UTF-8",
e);
+            }
         }
         return null;
     }
@@ -58,7 +60,9 @@ public class Utf8CcsidManager extends Cc
        try {
            return new String(sourceBytes,"UTF-8");
         } catch (UnsupportedEncodingException e) {
-            SanityManager.THROWASSERT("Could not convert UCS2 (byte[]) to UTF-8 (String)",
e);
+            if (SanityManager.DEBUG) {
+                SanityManager.THROWASSERT("Could not convert byte[] to Java String using
UTF-8 encoding", e);
+            }
         }
         return null;
     }
@@ -67,7 +71,9 @@ public class Utf8CcsidManager extends Cc
         try {
             return new String(sourceBytes,"UTF-8").substring(offset, offset+numToConvert);
         } catch (UnsupportedEncodingException e) {
-            SanityManager.THROWASSERT("Could not convert UCS2 (byte[]) to UTF-8 (String)
with offset",e);
+            if (SanityManager.DEBUG) {
+                SanityManager.THROWASSERT("Could not convert byte[] to Java String using
UTF-8 encoding with offset",e);
+            }
         }
         return null;
     }



Mime
View raw message