Source:
private BundleInfoLine[] getNewBundleInfoLines(File[] bundleFileList) throws Exception { ArrayList<BundleInfoLine> bundleInfoArray = new ArrayList<BundleInfoLine>(); for (File file : bundleFileList) { try (JarFile jarFile = new JarFile(file.getAbsoluteFile())) { if (jarFile.getManifest() == null || jarFile.getManifest().getMainAttributes() == null) { log.error("Invalid Bundle found in the dropins directory: " + file.getName()); continue; } String bundleSymbolicName = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.BUNDLE_SYMBOLIC_NAME); String bundleVersion = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.BUNDLE_VERSION); if (bundleSymbolicName == null) { log.error("Required Bundle manifest headers do not exists: " + file.getAbsoluteFile()); continue; } else { if (bundleSymbolicName.contains(";")) { bundleSymbolicName = bundleSymbolicName.split(";")[0]; } } if (bundleVersion == null) { bundleVersion = "0.0.0"; } boolean isFragment = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.FRAGMENT_HOST) != null; String dropinsAbsolutePath = System.getProperty(LauncherConstants.CARBON_DROPINS_DIR_PATH); if(dropinsAbsolutePath != null ) { String compoenentProfilePath = Paths.get(Utils.getCarbonComponentRepo().getPath(), System.getProperty(LauncherConstants.PROFILE)).toString(); String relativePathToDropinsFolder = Paths.get(compoenentProfilePath).relativize(Paths.get(dropinsAbsolutePath)).toString(); bundleInfoArray.add(new BundleInfoLine(bundleSymbolicName, bundleVersion, Paths.get(relativePathToDropinsFolder, file.getName()).toString(), 4, isFragment)); } else { bundleInfoArray.add(new BundleInfoLine(bundleSymbolicName, bundleVersion, Paths.get("..", "dropins", file.getName()).toString(), 4, isFragment)); } } } return bundleInfoArray.toArray(new BundleInfoLine[bundleInfoArray.size()]); }

Target:
private BundleInfoLine[] getNewBundleInfoLines(File[] bundleFileList) throws Exception { ArrayList<BundleInfoLine> bundleInfoArray = new ArrayList<BundleInfoLine>(); for (File file : bundleFileList) { try (JarFile jarFile = new JarFile(file.getAbsoluteFile())) { if (jarFile.getManifest() == null || jarFile.getManifest().getMainAttributes() == null) { log.error("Invalid Bundle found in the dropins directory: " + file.getName()); continue; } String bundleSymbolicName = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.BUNDLE_SYMBOLIC_NAME); String bundleVersion = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.BUNDLE_VERSION); if (bundleSymbolicName == null) { log.error("Required Bundle manifest headers do not exists: " + file.getAbsoluteFile()); continue; } else { if (bundleSymbolicName.contains(";")) { bundleSymbolicName = bundleSymbolicName.split(";")[0]; } } if (bundleVersion == null) { bundleVersion = DEFAULT_BUNDLE_VERSION; } boolean isFragment = jarFile.getManifest().getMainAttributes(). getValue(LauncherConstants.FRAGMENT_HOST) != null; String dropinsAbsolutePath = System.getProperty(LauncherConstants.CARBON_DROPINS_DIR_PATH); if(dropinsAbsolutePath != null ) { String compoenentProfilePath = Paths.get(Utils.getCarbonComponentRepo().getPath(), System.getProperty(LauncherConstants.PROFILE)).toString(); String relativePathToDropinsFolder = Paths.get(compoenentProfilePath).relativize(Paths.get(dropinsAbsolutePath)).toString(); bundleInfoArray.add(new BundleInfoLine(bundleSymbolicName, bundleVersion, Paths.get(relativePathToDropinsFolder, file.getName()).toString(), 4, isFragment)); } else { bundleInfoArray.add(new BundleInfoLine(bundleSymbolicName, bundleVersion, Paths.get("..", "dropins", file.getName()).toString(), 4, isFragment)); } } } return bundleInfoArray.toArray(new BundleInfoLine[bundleInfoArray.size()]); }