@Override
 public Collection<String> validateChange(ProjectMetadata project, VersionChange change) {
   if (isBundle(project) && isProjectVersionChange(project, change)) {
     String error = Versions.validateOsgiVersion(change.getNewVersion(), getManifestFile(project));
     return error != null ? Collections.singleton(error) : null;
   }
   return null;
 }
  @Override
  public void applyChange(
      ProjectMetadata project, VersionChange change, Set<VersionChange> allChanges) {
    // only update bundle version for now
    if (isBundle(project) && isProjectVersionChange(project, change)) {
      MutableBundleManifest mf = getBundleManifest(project);

      logger.info(
          "  META-INF/MANIFEST.MF//Bundle-Version: "
              + change.getVersion()
              + " => "
              + change.getNewVersion());

      mf.setVersion(change.getNewVersion());

      // TODO handle this by separate PackageVersionChange instances for each changed package? see
      // addMoreChanges
      logger.info(
          "  META-INF/MANIFEST.MF//Export-Package//version: "
              + change.getVersion()
              + " => "
              + change.getNewVersion().replace(".qualifier", ""));
      mf.setExportedPackageVersion(change.getVersion(), change.getNewVersion());
    }
  }
 @Override
 public Collection<String> validateChanges(
     ProjectMetadata project, VersionChangesDescriptor versionChangeContext) {
   if (isEclipseRepository(project)) {
     for (VersionChange change : versionChangeContext.getVersionChanges()) {
       ArrayList<String> errors = new ArrayList<>();
       for (Map.Entry<File, ProductConfiguration> entry :
           getProductConfigurations(project).entrySet()) {
         if (isSameProject(project, change.getProject())
             && change.getVersion().equals(entry.getValue().getVersion())) {
           String error = Versions.validateOsgiVersion(change.getNewVersion(), entry.getKey());
           if (error != null) {
             errors.add(error);
           }
         }
       }
       if (!errors.isEmpty()) {
         return errors;
       }
     }
   }
   return null;
 }
 private boolean isProjectVersionChange(ProjectMetadata project, VersionChange change) {
   MutableBundleManifest mf = getBundleManifest(project);
   return change.getArtifactId().equals(mf.getSymbolicName())
       && change.getVersion().equals(mf.getVersion());
 }