harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhouke...@apache.org
Subject svn commit: r1002535 - /harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java
Date Wed, 29 Sep 2010 09:28:51 GMT
Author: zhoukevin
Date: Wed Sep 29 09:28:51 2010
New Revision: 1002535

URL: http://svn.apache.org/viewvc?rev=1002535&view=rev
Log:
This refines patch committed at r998763. It's a non-functional patch.

Modified:
    harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java?rev=1002535&r1=1002534&r2=1002535&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Encoder.java
Wed Sep 29 09:28:51 2010
@@ -70,6 +70,8 @@ public class Encoder {
 
     private static final DefaultPersistenceDelegate defaultPD = new DefaultPersistenceDelegate();
 
+    private static final LangEnumPersistenceDelegate langEnumPD = new LangEnumPersistenceDelegate();
+
     private static final ArrayPersistenceDelegate arrayPD = new ArrayPersistenceDelegate();
 
     private static final ProxyPersistenceDelegate proxyPD = new ProxyPersistenceDelegate();
@@ -104,7 +106,6 @@ public class Encoder {
         delegates.put(String.class, new StringPersistenceDelegate());
         delegates.put(Proxy.class, new ProxyPersistenceDelegate());
         delegates.put(Date.class, new UtilDatePersistenceDelegate());
-        delegates.put(Enum.class, new LangEnumPersistenceDelegate());
     }
 
     private ExceptionListener listener = defaultExListener;
@@ -201,21 +202,24 @@ public class Encoder {
 		}
 
         // registered delegate
-        PersistenceDelegate registeredPD = Enum.class.isAssignableFrom(type) ? delegates
-                .get(Enum.class) : delegates.get(type);
+        PersistenceDelegate registeredPD = delegates.get(type);
         if (registeredPD != null) {
             return registeredPD;
         }
 
+        if (java.lang.Enum.class.isAssignableFrom(type)) {
+            return langEnumPD;
+        }
+
         if (java.util.List.class.isAssignableFrom(type)) {
             return new UtilListPersistenceDelegate();
         }
 
-        if (Collection.class.isAssignableFrom(type)) {
+        if (java.util.Collection.class.isAssignableFrom(type)) {
             return new UtilCollectionPersistenceDelegate();
         }
 
-        if (Map.class.isAssignableFrom(type)) {
+        if (java.util.Map.class.isAssignableFrom(type)) {
             return new UtilMapPersistenceDelegate();
         }
 



Mime
View raw message