Community
Participate
Working Groups
Adaptable#getAdapter(Object) could be changed to <T> T getAdapter( Class<T> adapter ) This would make casting the result of getAdapter() calls obsolete. Client code could be simplified from IWidgetAdapter adapter = ( IWidgetAdapter )widget.getAdapter( IWidgetAdapter.class ); to IWidgetAdapter adapter = widget.getAdapter( IWidgetAdapter.class ); Though there are possible implications: * not sure if this change would be backwards compatible * a use case that is used in some places in RWT would have to be rewritten Bar barAdapter = x.getAdapter( Foo.class );
I can't see that this change would affect backwards comptibility except for clients that use code like Bar barAdapter = x.getAdapter( Foo.class ); Since the documentation states that getAdapter() must return "an object castable to the given class or null", the above use-case wasn't valid anyway. Therefor I decided to do the propsed changes. Changes are in CVS HEAD.