[YANGTOOLS-866] ClassLoaderUtils.withClassLoader is hard to use in Java 8 with Supplier as well as Callable signatures Created: 16/Mar/18 Updated: 19/Mar/18 Resolved: 19/Mar/18 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.3 |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Michael Vorburger | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
https://git.opendaylight.org/gerrit/#/c/68840/ pointed to ClassLoaderUtils.withClassLoader(KarafIniWebEnvironment.class.getClassLoader(), () -> { return factory.getInstance(); }); The method withClassLoader(ClassLoader, Supplier<SecurityManager>) is ambiguous for the type ClassLoaderUtils this can be worked around with a cast like this of course, but this is cumbersome:
ClassLoaderUtils.withClassLoader(
KarafIniWebEnvironment.class.getClassLoader(), (Supplier<SecurityManager>) factory::getInstance);
|
| Comments |
| Comment by Robert Varga [ 19/Mar/18 ] |
|
https://git.opendaylight.org/gerrit/69608
|