cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1090300 - /cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
Date Fri, 08 Apr 2011 15:32:23 GMT
Author: cschneider
Date: Fri Apr  8 15:32:22 2011
New Revision: 1090300

URL: http://svn.apache.org/viewvc?rev=1090300&view=rev
Log:
Remove special case for Integer. The cast from Integer to Byte is not possible

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java?rev=1090300&r1=1090299&r2=1090300&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
Fri Apr  8 15:32:22 2011
@@ -36,12 +36,8 @@ public class ByteType extends AegisType 
 
     @Override
     public void writeObject(Object object, MessageWriter writer, Context context) {
-        if (object instanceof Integer) {
-            writer.writeValueAsByte((Byte)object);
-        } else {
-            int intValue = ((Number)object).intValue();
-            byte byteValue = (byte)(intValue & 0xff);
-            writer.writeValueAsByte(new Byte(byteValue));
-        }
+        int intValue = ((Number)object).intValue();
+        byte byteValue = (byte)(intValue & 0xff);
+        writer.writeValueAsByte(new Byte(byteValue));
     }
 }



Mime
View raw message