Skip to content
Snippets Groups Projects
Commit 523f24ae authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JFX editors: Fix type resolution for constructing IModelFactories

parent c84f2b07
No related branches found
No related tags found
1 merge request!81JFX: Base classes
DelegatingControllerFactory.java ad214d83b5821b39862b7c382c91a13c3dfddbd0 YELLOW
DelegatingFactoryBase.java f421742267610f41bb6196346026d2f239d90ed0 YELLOW
DelegatingModelFactory.java ea7c3e1c612101bb3ba71d7dc97893783c0319a3 YELLOW
DelegatingModelFactory.java 87ad29bc457b6316392625fb63221039bbb7c616 YELLOW
DelegatingVisualFactory.java 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,
getInterfaceType((EObject)editedObject));
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 |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment