7057459: Regression: Performance degradation with java.beans.XMLEncoder
authormalenkov
Thu, 10 Nov 2011 17:15:15 +0400
changeset 11085 18d8201c795b
parent 11084 27e89dc55e63
child 11086 09b1d6383d0b
7057459: Regression: Performance degradation with java.beans.XMLEncoder Reviewed-by: rupashka
jdk/src/share/classes/java/beans/Encoder.java
--- a/jdk/src/share/classes/java/beans/Encoder.java	Thu Nov 10 14:10:54 2011 +0400
+++ b/jdk/src/share/classes/java/beans/Encoder.java	Thu Nov 10 17:15:15 2011 +0400
@@ -195,7 +195,13 @@
      */
     public PersistenceDelegate getPersistenceDelegate(Class<?> type) {
         PersistenceDelegate pd = this.finder.find(type);
-        return (pd != null) ? pd : MetaData.getPersistenceDelegate(type);
+        if (pd == null) {
+            pd = MetaData.getPersistenceDelegate(type);
+            if (pd != null) {
+                this.finder.register(type, pd);
+            }
+        }
+        return pd;
     }
 
     /**