cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r788774 - in /cxf/trunk/rt/bindings/corba: pom.xml src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java
Date Fri, 26 Jun 2009 17:25:42 GMT
Author: dkulp
Date: Fri Jun 26 17:25:41 2009
New Revision: 788774

URL: http://svn.apache.org/viewvc?rev=788774&view=rev
Log:
Remove commons-codec from required jars list for corba bindings (still
needed by abdera/jax-rs though)

Modified:
    cxf/trunk/rt/bindings/corba/pom.xml
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java

Modified: cxf/trunk/rt/bindings/corba/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/pom.xml?rev=788774&r1=788773&r2=788774&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/pom.xml (original)
+++ cxf/trunk/rt/bindings/corba/pom.xml Fri Jun 26 17:25:41 2009
@@ -65,11 +65,6 @@
             <artifactId>easymockclassextension</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <version>1.3</version>
-        </dependency>
     </dependencies>
 
 

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java?rev=788774&r1=788773&r2=788774&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaOctetSequenceHandler.java
Fri Jun 26 17:25:41 2009
@@ -18,10 +18,9 @@
  */
 package org.apache.cxf.binding.corba.types;
 
+import javax.xml.bind.DatatypeConverter;
 import javax.xml.namespace.QName;
 
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.binary.Hex;
 import org.apache.cxf.binding.corba.CorbaBindingException;
 import org.apache.cxf.binding.corba.wsdl.W3CConstants;
 import org.omg.CORBA.TypeCode;
@@ -50,9 +49,9 @@
     public String getDataFromValue() {
         String result;
         if (isBase64Octets) {
-            result = new String(Base64.encodeBase64(value));
+            result = new String(DatatypeConverter.printBase64Binary(value));
         } else {
-            result = new String(Hex.encodeHex(value));
+            result = new String(DatatypeConverter.printHexBinary(value));
         }
         return result;
     }
@@ -60,9 +59,9 @@
     public void setValueFromData(String data) {
         try {
             if (isBase64Octets) {
-                value = Base64.decodeBase64(data.getBytes());
+                value = DatatypeConverter.parseBase64Binary(data);
             } else {
-                value = Hex.decodeHex(data.toCharArray());
+                value = DatatypeConverter.parseHexBinary(data);
             }
         } catch (Exception ex) {
             throw new CorbaBindingException("Not able to parse the octet sequence", ex);

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java?rev=788774&r1=788773&r2=788774&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaObjectReferenceHelper.java
Fri Jun 26 17:25:41 2009
@@ -29,11 +29,10 @@
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
+import javax.xml.bind.DatatypeConverter;
 import javax.xml.namespace.QName;
 
 import com.ibm.wsdl.ImportImpl;
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.codec.binary.Hex;
 import org.apache.cxf.binding.corba.wsdl.BindingType;
 import org.apache.cxf.common.logging.LogUtils;
 import org.omg.CORBA.Object;
@@ -157,13 +156,7 @@
 
     public static String extractTypeIdFromIOR(String url) {        
         String ret = new String();
-        byte data[] = null;
-        try {
-            // skip past IOR:
-            data = Hex.decodeHex(url.substring(4).toCharArray());
-        } catch (DecoderException e) {
-            throw new RuntimeException("Failed to convert ascii hex ior to byte[], ior url="
+ url, e);
-        }
+        byte data[] = DatatypeConverter.parseHexBinary(url.substring(4));
         if (data.length > 0) {
             // parse out type_id from IOR CDR encapsulation
             boolean bigIndian = !(data[0] > 0);



Mime
View raw message