7057459: Regression: Performance degradation with java.beans.XMLEncoder
Reviewed-by: rupashka
--- 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;
}
/**