Commit 523f24ae authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JFX editors: Fix type resolution for constructing IModelFactories

Issue-Ref: 3883

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <>
parent c84f2b07 ad214d83b5821b39862b7c382c91a13c3dfddbd0 YELLOW f421742267610f41bb6196346026d2f239d90ed0 YELLOW ea7c3e1c612101bb3ba71d7dc97893783c0319a3 YELLOW 87ad29bc457b6316392625fb63221039bbb7c616 YELLOW 7e834acd12ae4d1c2b2b32a5456dc9f2b6d4e466 YELLOW
......@@ -55,9 +55,9 @@ public class DelegatingModelFactory extends DelegatingFactoryBase<IModelFactory>
constructFactory(Class<? extends IModelFactory> delegateFactory) {
Constructor<? extends IModelFactory> ctor = null;
try {
// TODO(AD): Avoid that cast...
ctor = getMatchingAccessibleConstructor(delegateFactory,
Class<?> ctorParamType = (editedObject instanceof EObject)
? getInterfaceType((EObject)editedObject) : editedObject.getClass();
ctor = getMatchingAccessibleConstructor(delegateFactory, ctorParamType);
try {
return Optional.of(ctor.newInstance(editedObject));
} catch(InstantiationException | IllegalAccessException | IllegalArgumentException |
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment