Source:
protected void testPapyrusDependencies(final String partialDependencyName, final String wantedVersion, List<String> exceptions) { final StringBuilder builder = new StringBuilder(); int nb = 0; final Version wanted = new Version(wantedVersion); for (final Bundle current : BundleTestsUtils.getPapyrusBundles()) { final String value = current.getHeaders().get(BundleTestsUtils.REQUIRE_BUNDLE); if (value == null) { continue; } Pattern pattern = Pattern.compile("(" + partialDependencyName + REGEX_PLUGIN + ")" + REGEX_DEPENDENCY); Matcher matcher = pattern.matcher(value); final StringBuilder localBuilder = new StringBuilder(); while (matcher.find()) { final String pluginName = matcher.group(1); if (exceptions.contains(pluginName)) { continue; } String versionString = null; if (matcher.groupCount() > 1) { versionString = matcher.group(2); } if (versionString == null) { if (localBuilder.length() == 0) { localBuilder.append(NLS.bind("{0} incorrect required bundle-version:\n", current.getSymbolicName())); } localBuilder.append(NLS.bind("No Version number for {0}\n", pluginName)); nb++; } else { Version version = new Version(versionString); if (!version.inIncludedIn(wanted)) { if (localBuilder.length() == 0) { localBuilder.append(NLS.bind("{0} incorrect required bundle-version:\n", current.getSymbolicName())); } localBuilder.append(NLS.bind("Bad version for {0}, got {1} and not {2} \n", new String[] {pluginName, versionString,wantedVersion})); nb++; } } } if (localBuilder.length() != 0) { builder.append(localBuilder.toString()); builder.append("\n"); } } if (builder.length() != 0) { builder.insert(0, NLS.bind("{0} problems. We want this version : {1} for the plugin {2}\n", new String[] { Integer.toString(nb), wantedVersion, partialDependencyName })); } Assert.assertTrue(builder.toString(), builder.length() == 0); }

Target:
protected void testPapyrusDependencies(final String partialDependencyName, final String wantedVersion, List<String> exceptions) { final StringBuilder builder = new StringBuilder(); int nb = 0; final Version wanted = new Version(wantedVersion); for (final Bundle current : BundleTestsUtils.getPapyrusBundles()) { final String value = current.getHeaders().get(BundleTestsUtils.REQUIRE_BUNDLE); if (value == null) { continue; } Pattern pattern = Pattern.compile("(" + partialDependencyName + REGEX_PLUGIN + ")" + REGEX_DEPENDENCY); Matcher matcher = pattern.matcher(value); final StringBuilder localBuilder = new StringBuilder(); while (matcher.find()) { final String pluginName = matcher.group(1); if (exceptions.contains(pluginName)) { continue; } String versionString = null; if (matcher.groupCount() > 1) { versionString = matcher.group(2); } if (versionString == null) { if (localBuilder.length() == 0) { localBuilder.append(NLS.bind("Incorrect version for {0}, got {1} and not {2} \n", new String[] {pluginName, current.getSymbolicName(), wantedVersion})); } localBuilder.append(NLS.bind("No Version number for {0}\n", pluginName)); nb++; } else { Version version = new Version(versionString); if (!version.inIncludedIn(wanted)) { if (localBuilder.length() == 0) { localBuilder.append(NLS.bind("{0} incorrect required bundle-version:\n", current.getSymbolicName())); } localBuilder.append(NLS.bind("Bad version for {0}, got {1} and not {2} \n", new String[] {pluginName, versionString, wantedVersion})); nb++; } } } if (localBuilder.length() != 0) { builder.append(localBuilder.toString()); builder.append("\n"); } } if (builder.length() != 0) { builder.insert(0, NLS.bind("{0} problems. We want this version : {1} for the plugin {2}\n", new String[] { Integer.toString(nb), wantedVersion, partialDependencyName })); } Assert.assertTrue(builder.toString(), builder.length() == 0); }