7057459: Regression: Performance degradation with java.beans.XMLEncoder

Reviewed-by: rupashka
This commit is contained in:
Sergey Malenkov 2011-11-10 17:15:15 +04:00
parent 2eda2d142d
commit 66bc904d36

View File

@ -195,7 +195,13 @@ public class Encoder {
*/
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;
}
/**