[
http://jira.magnolia-cms.com/browse/MAGNOLIA-3079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26768#action_26768
]
Jan Haderka commented on MAGNOLIA-3079:
---------------------------------------
And yet another incarnation of the same problem:
Changing {{DefaultI18nContentSupport}} to {{ETKI18nContentSupport}} on the fly
causes the exception below even tho both implement required interface (but the
cast is to the superclass of the Default... not to the {{I18nContentSupport}}
interface.
{noformat}
java.lang.ClassCastException:
info.magnolia.module.extendedtemplatingkit.i18n.ETKI18nContentSupport cannot be
cast to info.magnolia.cms.i18n.AbstractI18nContentSupport
info.magnolia.cms.i18n.DefaultI18nContentSupport$$EnhancerByCGLIB$$a2946d4f.determineLocale(<generated>)
info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:60)
info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:70)
info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
{noformat}
> ComponentProvider should lookup superclasses and interfaces of the required
> component
> -------------------------------------------------------------------------------------
>
> Key: MAGNOLIA-3079
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3079
> Project: Magnolia
> Issue Type: Improvement
> Components: core
> Reporter: Grégory Joseph
> Assignee: Grégory Joseph
> Fix For: 4.3
>
>
> If {{ComponentProvider.getSingleton(com.foo.SomeSubInterface.class)}} is
> called, and no component is registered specifically for
> {{com.foo.SomeSubInterface}}, the ComponentProvider should look up
> registration for parents of {{com.foo.SomeSubInterface}} (i.e
> {{com.foo.SomeInterface}}, if {{SomeSubInterface extends SomeInterface}})
> This should:
> * remove the need for casting when depending on a specific implementation:
> {code}
> // instead of:
> SomeSubInterface z = (SomeSubInterface)
> Components.getSingleton(SomeInterface.class);
> // you should be able to do:
> SomeSubInterface z = Components.getSingleton(SomeSubInterface.class);
> // even if only SomeInterface was configured (i.e if there's only a property
> for com.foo.SomeInterface)
> {code}
> * likewise, this should fix MAGNOLIA-3059 -- TODO: insert details as to
> how/why ;)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------