Source:
private PwaConfiguration discoverPwa() { try { Class<? extends Annotation> loadedPWAAnnotation = getFinder() .loadClass(PWA.class.getName()); Set<Class<?>> annotatedClasses = getFinder() .getAnnotatedClasses(loadedPWAAnnotation); if (annotatedClasses.isEmpty()) { return new PwaConfiguration(); } else if (annotatedClasses.size() != 1) { throw new IllegalStateException( ERROR_CAN_ONLY_HAVE_ONE_PWA_ANNOTATION); } Class<?> hopefullyAppShellClass = annotatedClasses.iterator().next(); if (!Arrays.asList(hopefullyAppShellClass.getInterfaces()).stream() .map(Class::getName).collect(Collectors.toList()) .contains(AppShellConfigurator.class.getName())) { throw new IllegalStateException( ERROR_CAN_ONLY_HAVE_ONE_PWA_ANNOTATION); } Annotation pwa = annotationFinder .apply(hopefullyAppShellClass, loadedPWAAnnotation).get(0); String name = getAnnotationValueAsString(pwa, "name"); String shortName = getAnnotationValueAsString(pwa, "shortName"); String description = getAnnotationValueAsString(pwa, "description"); String backgroundColor = getAnnotationValueAsString(pwa, "backgroundColor"); String themeColor = getAnnotationValueAsString(pwa, "themeColor"); String iconPath = getAnnotationValueAsString(pwa, "iconPath"); getLogger().error("iconPath in " + getClass().getSimpleName() + ": " + iconPath); String manifestPath = getAnnotationValueAsString(pwa, "manifestPath"); String offlinePath = getAnnotationValueAsString(pwa, "offlinePath"); String display = getAnnotationValueAsString(pwa, "display"); String startPath = getAnnotationValueAsString(pwa, "startPath"); String[] offlineResources = (String[]) getAnnotationValue(pwa, "offlineResources"); return new PwaConfiguration(true, name, shortName, description, backgroundColor, themeColor, iconPath, manifestPath, offlinePath, display, startPath, offlineResources); } catch (ClassNotFoundException exception) { throw new IllegalStateException( "Could not load PWA annotation class", exception); } }

Target:
private PwaConfiguration discoverPwa() { try { Class<? extends Annotation> loadedPWAAnnotation = getFinder() .loadClass(PWA.class.getName()); Set<Class<?>> annotatedClasses = getFinder() .getAnnotatedClasses(loadedPWAAnnotation); if (annotatedClasses.isEmpty()) { return new PwaConfiguration(); } else if (annotatedClasses.size() != 1) { throw new IllegalStateException( ERROR_INVALID_PWA_ANNOTATION); } Class<?> hopefullyAppShellClass = annotatedClasses.iterator().next(); if (!Arrays.stream(hopefullyAppShellClass.getInterfaces()) .map(Class::getName).collect(Collectors.toList()) .contains(AppShellConfigurator.class.getName())) { throw new IllegalStateException( ERROR_INVALID_PWA_ANNOTATION); } Annotation pwa = annotationFinder .apply(hopefullyAppShellClass, loadedPWAAnnotation).get(0); String name = getAnnotationValueAsString(pwa, "name"); String shortName = getAnnotationValueAsString(pwa, "shortName"); String description = getAnnotationValueAsString(pwa, "description"); String backgroundColor = getAnnotationValueAsString(pwa, "backgroundColor"); String themeColor = getAnnotationValueAsString(pwa, "themeColor"); String iconPath = getAnnotationValueAsString(pwa, "iconPath"); String manifestPath = getAnnotationValueAsString(pwa, "manifestPath"); String offlinePath = getAnnotationValueAsString(pwa, "offlinePath"); String display = getAnnotationValueAsString(pwa, "display"); String startPath = getAnnotationValueAsString(pwa, "startPath"); String[] offlineResources = (String[]) getAnnotationValue(pwa, "offlineResources"); assert shortName != null; return new PwaConfiguration(true, name, shortName, description, backgroundColor, themeColor, iconPath, manifestPath, offlinePath, display, startPath, offlineResources); } catch (ClassNotFoundException exception) { throw new IllegalStateException( "Could not load PWA annotation class", exception); } }