From 8607dd888f426cc8acbe3ce1f655d1699f0a44a4 Mon Sep 17 00:00:00 2001 From: Andrey Subbotin Date: Mon, 20 Jun 2016 18:25:23 +0400 Subject: [PATCH] PL-7376 UnsupportedOperationException while using RuntimePropertiesFrame --- .../dynamicattributes/DynamicAttributesMetaClass.java | 2 +- .../com/haulmont/cuba/core/global/MetadataTools.java | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/global/src/com/haulmont/cuba/core/app/dynamicattributes/DynamicAttributesMetaClass.java b/modules/global/src/com/haulmont/cuba/core/app/dynamicattributes/DynamicAttributesMetaClass.java index 34c0a0dad6..01045cf80d 100644 --- a/modules/global/src/com/haulmont/cuba/core/app/dynamicattributes/DynamicAttributesMetaClass.java +++ b/modules/global/src/com/haulmont/cuba/core/app/dynamicattributes/DynamicAttributesMetaClass.java @@ -63,7 +63,7 @@ public class DynamicAttributesMetaClass extends MetadataObjectImpl implements Me @Override public Class getJavaClass() { - return getClass(); + return Object.class; } @Override diff --git a/modules/global/src/com/haulmont/cuba/core/global/MetadataTools.java b/modules/global/src/com/haulmont/cuba/core/global/MetadataTools.java index 82f00eff7c..5db00f42cc 100644 --- a/modules/global/src/com/haulmont/cuba/core/global/MetadataTools.java +++ b/modules/global/src/com/haulmont/cuba/core/global/MetadataTools.java @@ -375,15 +375,7 @@ public class MetadataTools { * Determine whether the given metaclass is embeddable. */ public boolean isEmbeddable(MetaClass metaClass) { - Class javaClass; - try { - // RuntimePropertiesMetaClass can throw UnsupportedOperationException - javaClass = metaClass.getJavaClass(); - } catch (UnsupportedOperationException e) { - return false; - } - - return javaClass.isAnnotationPresent(javax.persistence.Embeddable.class); + return metaClass.getJavaClass().isAnnotationPresent(javax.persistence.Embeddable.class); } public boolean isCacheable(MetaClass metaClass) {