Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Add type information to IServiceLocator.getService

Should have been:

So instead of:

IContextService contextService = (IContextService) locator.getService(IContextService.class); 

you can simply write

IContextService contextService = locator.getService(IContextService.class)

Thanks to Gunnar for pointing that out.

2014-08-04 21:19 GMT+02:00 Lars Vogel <lars.vogel@xxxxxxxxx>:
FYI - Early in the development of M2 I plan to add the type information to IServiceLocator.getService. This is a tiny change but might cause "unnecessary cast"  warning message in your code if use use that interface.  

So instead ofcontextService = locator.getService(IContextService.class) you can simply write
contextService = (IContextService) locator.getService(IContextService.class); 

If you see issues with this change please comment in to test you can use which contains the the Gerrit change. 

Back to the top