changeset 4773:81f1b32f9e24

7057459: Regression: Performance degradation with java.beans.XMLEncoder Reviewed-by: rupashka
author malenkov
date Thu, 10 Nov 2011 17:15:15 +0400
parents 84e473cf4531
children e120c78cb45c
files src/share/classes/java/beans/Encoder.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/beans/Encoder.java	Thu Nov 10 14:10:54 2011 +0400
+++ b/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;
     }
 
     /**