cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r708550 - in /cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/type/java5/EnumType.java test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Date Tue, 28 Oct 2008 12:16:31 GMT
Author: bimargulies
Date: Tue Oct 28 05:16:31 2008
New Revision: 708550

URL: http://svn.apache.org/viewvc?rev=708550&view=rev
Log:
Fix CXF-1890.

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java?rev=708550&r1=708549&r2=708550&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
Tue Oct 28 05:16:31 2008
@@ -39,7 +39,8 @@
 
     @Override
     public void writeObject(Object object, MessageWriter writer, Context context) {
-        writer.writeValue(((Enum)object).toString());
+        // match the reader. 
+        writer.writeValue(((Enum)object).name());
     }
 
     @Override
@@ -67,7 +68,7 @@
 
         for (Object constant : constants) {
             Element enumeration = new Element("enumeration", xsd);
-            enumeration.setAttribute(new Attribute("value", ((Enum)constant).toString()));
+            enumeration.setAttribute(new Attribute("value", ((Enum)constant).name()));
             restriction.addContent(enumeration);
         }
     }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java?rev=708550&r1=708549&r2=708550&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Tue Oct 28 05:16:31 2008
@@ -39,7 +39,13 @@
     private DefaultTypeMapping tm;
 
     private enum smallEnum {
-        VALUE1, VALUE2
+        VALUE1, VALUE2;
+
+        @Override
+        public String toString() {
+            return name() + "*";
+        }
+        
     };
 
     @Before



Mime
View raw message