db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject svn commit: r1004586 - in /db/derby/code/trunk/java: client/org/apache/derby/client/net/ testing/org/apache/derbyTesting/functionTests/tests/derbynet/
Date Tue, 05 Oct 2010 09:33:03 GMT
Author: tiago
Date: Tue Oct  5 09:33:03 2010
New Revision: 1004586

URL: http://svn.apache.org/viewvc?rev=1004586&view=rev
Log:
DERBY-4757 (Client) Implement UTF8 support on DRDA

Small patch to cleanup unused code in the CCSID managers

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/CcsidManager.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/EbcdicCcsidManager.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Utf8CcsidManager.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/Utf8CcsidManagerClientTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/CcsidManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/CcsidManager.java?rev=1004586&r1=1004585&r2=1004586&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/CcsidManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/CcsidManager.java Tue Oct
 5 09:33:03 2010
@@ -86,13 +86,6 @@ public abstract class CcsidManager {
     abstract String convertToJavaString(byte[] sourceBytes, int offset, int numToConvert);
 
 
-    // Convert a byte representing a char in a particular ccsid into a Java char.
-    //
-    // @param sourceByte The byte to be converted
-    // @return The converted Java char.
-    abstract char convertToJavaChar(byte sourceByte);
-
-
     
     /**
      * 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/EbcdicCcsidManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/EbcdicCcsidManager.java?rev=1004586&r1=1004585&r2=1004586&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/EbcdicCcsidManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/EbcdicCcsidManager.java Tue
Oct  5 09:33:03 2010
@@ -177,11 +177,6 @@ public class EbcdicCcsidManager extends 
         return new String(theChars);
     }
 
-
-    char convertToJavaChar(byte sourceByte) {
-        return (char) conversionArrayToUCS2[(sourceByte < 0) ? (sourceByte + 256) : sourceByte];
-    }
-
     
     /* (non-Javadoc)
      * @see org.apache.derby.client.net.CcsidManager#maxBytesPerChar()

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Utf8CcsidManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/Utf8CcsidManager.java?rev=1004586&r1=1004585&r2=1004586&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Utf8CcsidManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Utf8CcsidManager.java Tue
Oct  5 09:33:03 2010
@@ -81,18 +81,6 @@ public class Utf8CcsidManager extends Cc
         return null;
     }
 
-//    //Will this be needed in client?
-//    int getByteLength(String str) {
-//        try {
-//            return str.getBytes("UTF-8").length;
-//        } catch (UnsupportedEncodingException e) {
-//            if (SanityManager.DEBUG) {
-//                SanityManager.THROWASSERT("Could not obtain byte length of Java String
in Utf8CcsidManager",e);
-//            }
-//        }
-//        return -1;
-//    }
-
     public int convertFromJavaString(String sourceString, byte[] buffer,
             int offset, Agent agent) throws SqlException {
         try {
@@ -108,11 +96,6 @@ public class Utf8CcsidManager extends Cc
         return offset;
     }
 
-    public char convertToJavaChar(byte sourceByte) {
-        /* 1 byte = 0 to 255 which is the same in UTF-8 and ASCII */ 
-        return (char)sourceByte;
-    }
-
     int maxBytesPerChar() {
         return 4;
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/Utf8CcsidManagerClientTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/Utf8CcsidManagerClientTest.java?rev=1004586&r1=1004585&r2=1004586&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/Utf8CcsidManagerClientTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/Utf8CcsidManagerClientTest.java
Tue Oct  5 09:33:03 2010
@@ -105,15 +105,6 @@ public class Utf8CcsidManagerClientTest 
         assertEquals(offsetUcs2String, convertedOffset);
     }
     
-    /**
-     * Use the Utf8CcsidManager to convert a byte to a character
-     */
-    public void testConvertToJavaChar() throws Exception {
-        byte b = 0x2a; // '*'
-        
-        assertEquals('*', ccsidManager.convertToJavaChar(b));
-    }
-    
     public static Test suite() {
         return TestConfiguration.clientServerSuite(Utf8CcsidManagerClientTest.class);
     }



Mime
View raw message