changeset 4348:e01325b53a12

7057459: Regression: Performance degradation with java.beans.XMLEncoder Reviewed-by: rupashka
author malenkov
date Wed, 10 Aug 2011 18:47:31 +0400
parents 2c93c0965f99
children 72b2b2a3f228
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	Wed Aug 10 09:08:08 2011 +0100
+++ b/src/share/classes/java/beans/Encoder.java	Wed Aug 10 18:47:31 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;
     }
 
     /**