Source:
<code>private void computePwaConfiguration() throws ClassNotFoundException, IllegalStateException { FrontendAnnotatedClassVisitor pwaVisitor = new FrontendAnnotatedClassVisitor( getFinder(), PWA.class.getName()); Class<?> AppShellConfigurator = getFinder().loadClass( AppShellConfigurator.class.getName()); for (Class<?> hopefullyAppShellClass : getFinder().getAnnotatedClasses(PWA.class.getName())) { if (!Arrays.asList(hopefullyAppShellClass.getInterfaces()) .contains(AppShellConfigurator)) { throw new IllegalStateException( ERROR_CAN_ONLY_HAVE_ONE_PWA_ANNOTATION); } pwaVisitor.visitClass(hopefullyAppShellClass.getName()); } Set<String> dependencies = pwaVisitor.getValues("name"); if (dependencies.size() > 1) { throw new IllegalStateException(ERROR_CAN_ONLY_HAVE_ONE_PWA_ANNOTATION); } if (dependencies.isEmpty()) { this.pwaConfiguration = new PwaConfiguration(); return; } String name = pwaVisitor.getValue("name"); String shortName = pwaVisitor.getValue("shortName"); String description = pwaVisitor.getValue("description"); String backgroundColor = pwaVisitor.getValue("backgroundColor"); String themeColor = pwaVisitor.getValue("themeColor"); String iconPath = pwaVisitor.getValue("iconPath"); log().error("iconPath in {}: {}", getClass().getSimpleName(), iconPath); String manifestPath = pwaVisitor.getValue("manifestPath"); String offlinePath = pwaVisitor.getValue("offlinePath"); String display = pwaVisitor.getValue("display"); String startPath = pwaVisitor.getValue("startPath"); List<String> offlineResources = pwaVisitor.getValue("offlineResources"); this.pwaConfiguration = new PwaConfiguration(true, name, shortName, description, backgroundColor, themeColor, iconPath, manifestPath, offlinePath, display, startPath, <START> offlineResources.toArray(new String[offlineResources.size()])); <END> }</code><technical_language>Replace empty String[] array constant: preallocation is needed Java 6</technical_language>

Target:
private void computePwaConfiguration() throws ClassNotFoundException { FrontendAnnotatedClassVisitor pwaVisitor = new FrontendAnnotatedClassVisitor( getFinder(), PWA.class.getName()); Class<?> appShellConfiguratorClass = getFinder().loadClass( AppShellConfigurator.class.getName()); for (Class<?> hopefullyAppShellClass : getFinder().getAnnotatedClasses(PWA.class.getName())) { if (!Arrays.asList(hopefullyAppShellClass.getInterfaces()) .contains(appShellConfiguratorClass)) { throw new IllegalStateException( ERROR_INVALID_PWA_ANNOTATION); } pwaVisitor.visitClass(hopefullyAppShellClass.getName()); } Set<String> dependencies = pwaVisitor.getValues("name"); if (dependencies.size() > 1) { throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION); } if (dependencies.isEmpty()) { this.pwaConfiguration = new PwaConfiguration(); return; } String name = pwaVisitor.getValue("name"); String shortName = pwaVisitor.getValue("shortName"); String description = pwaVisitor.getValue("description"); String backgroundColor = pwaVisitor.getValue("backgroundColor"); String themeColor = pwaVisitor.getValue("themeColor"); String iconPath = pwaVisitor.getValue("iconPath"); log().error("iconPath in {}: {}", getClass().getSimpleName(), iconPath); String manifestPath = pwaVisitor.getValue("manifestPath"); String offlinePath = pwaVisitor.getValue("offlinePath"); String display = pwaVisitor.getValue("display"); String startPath = pwaVisitor.getValue("startPath"); List<String> offlineResources = pwaVisitor.getValue("offlineResources"); this.pwaConfiguration = new PwaConfiguration(true, name, shortName, description, backgroundColor, themeColor, iconPath, manifestPath, offlinePath, display, startPath, offlineResources.toArray(new String[] {})); }