CptBartender commented on code in PR #2720:
URL: https://github.com/apache/karaf/pull/2720#discussion_r3927556872
##########
config/core/src/main/java/org/apache/karaf/config/core/MetaServiceCaller.java:
##########
@@ -73,13 +72,15 @@ public static List<String>
getPidsWithMetaInfo(BundleContext context) {
* Attempts to find MetaType information for the specified PID and
* invokes the supplied callback with the result of the search
*/
- public static <T> T doWithMetaType(BundleContext context, String pid,
Function<Optional<MetaInfo>, T> function) {
+ public static <T> T doWithMetaType(BundleContext context, String pid,
Function<MetaInfo, T> function) {
ServiceReference<MetaTypeService> ref =
context.getServiceReference(MetaTypeService.class);
if (ref != null) {
try {
MetaTypeService metaService = context.getService(ref);
MetaInfo metaInfo = getMetatype(context, metaService, pid);
- return function.apply(Optional.ofNullable(metaInfo));
+ if (metaInfo != null) {
Review Comment:
Good catch - fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]