Program: 86534
Project: 86534
Buggy source:
/** 
 * If enabled, grab the execution root pom (which will be the topmost POM in terms of directory structure). Check for the presence of the project-sources-maven-plugin in the base build (/project/build/plugins/). Inject a new plugin execution for creating project sources if this plugin has not already been declared in the base build section.
 */
@Override public Set<Project> applyChanges(final List<Project> projects,final ManipulationSession session) throws ManipulationException {
  final ProjectSourcesInjectingState state=session.getState(ProjectSourcesInjectingState.class);
  if (state.isEnabled() && session.anyStateEnabled(State.activeByDefault)) {
    for (    final Project project : projects) {
      if (project.isExecutionRoot()) {
        logger.info("String_Node_Str",project);
        final Model model=project.getModel();
        Build build=model.getBuild();
        if (build == null) {
          build=new Build();
          model.setBuild(build);
        }
        boolean changed=false;
        final Map<String,Plugin> pluginMap=build.getPluginsAsMap();
        if (!pluginMap.containsKey(PROJECT_SOURCES_COORD)) {
          final PluginExecution execution=new PluginExecution();
          execution.setId(PROJECT_SOURCES_EXEC_ID);
          execution.setPhase(INITIALIZE_PHASE);
          execution.setGoals(Collections.singletonList(PROJECT_SOURCES_GOAL));
          final Plugin plugin=new Plugin();
          plugin.setGroupId(PROJECT_SOURCES_GID);
          plugin.setArtifactId(PROJECT_SOURCES_AID);
          plugin.setVersion(state.getProjectSourcesPluginVersion());
          plugin.addExecution(execution);
          build.addPlugin(plugin);
          changed=true;
        }
        if (!pluginMap.containsKey(BMMP_COORD)) {
          final PluginExecution execution=new PluginExecution();
          execution.setId(BMMP_EXEC_ID);
          execution.setPhase(VALIDATE_PHASE);
          execution.setGoals(Collections.singletonList(BMMP_GOAL));
          final Xpp3Dom xml=new Xpp3Dom("String_Node_Str");
          final Map<String,Object> config=new HashMap<String,Object>();
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str","String_Node_Str");
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",true);
          for (          final Map.Entry<String,Object> entry : config.entrySet()) {
            final Xpp3Dom child=new Xpp3Dom(entry.getKey());
            if (entry.getValue() != null) {
              child.setValue(entry.getValue().toString());
            }
            xml.addChild(child);
          }
          execution.setConfiguration(xml);
          final Plugin plugin=new Plugin();
          plugin.setGroupId(BMMP_GID);
          plugin.setArtifactId(BMMP_AID);
          plugin.setVersion(state.getBuildMetadataPluginVersion());
          plugin.addExecution(execution);
          plugin.setInherited(false);
          build.addPlugin(plugin);
          changed=true;
        }
        if (changed) {
          return Collections.singleton(project);
        }
      }
    }
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
/** 
 * If enabled, grab the execution root pom (which will be the topmost POM in terms of directory structure). Check for the presence of the project-sources-maven-plugin in the base build (/project/build/plugins/). Inject a new plugin execution for creating project sources if this plugin has not already been declared in the base build section.
 */
@Override public Set<Project> applyChanges(final List<Project> projects,final ManipulationSession session) throws ManipulationException {
  final ProjectSourcesInjectingState state=session.getState(ProjectSourcesInjectingState.class);
  if (state.isEnabled() && session.anyStateEnabled(State.activeByDefault)) {
    for (    final Project project : projects) {
      if (project.isExecutionRoot()) {
        logger.info("String_Node_Str",project);
        final Model model=project.getModel();
        Build build=model.getBuild();
        if (build == null) {
          build=new Build();
          model.setBuild(build);
        }
        boolean changed=false;
        final Map<String,Plugin> pluginMap=build.getPluginsAsMap();
        if (state.isProjectSourcesPluginEnabled() && !pluginMap.containsKey(PROJECT_SOURCES_COORD)) {
          final PluginExecution execution=new PluginExecution();
          execution.setId(PROJECT_SOURCES_EXEC_ID);
          execution.setPhase(INITIALIZE_PHASE);
          execution.setGoals(Collections.singletonList(PROJECT_SOURCES_GOAL));
          final Plugin plugin=new Plugin();
          plugin.setGroupId(PROJECT_SOURCES_GID);
          plugin.setArtifactId(PROJECT_SOURCES_AID);
          plugin.setVersion(state.getProjectSourcesPluginVersion());
          plugin.addExecution(execution);
          build.addPlugin(plugin);
          changed=true;
        }
        if (state.isBuildMetadataPluginEnabled() && !pluginMap.containsKey(BMMP_COORD)) {
          final PluginExecution execution=new PluginExecution();
          execution.setId(BMMP_EXEC_ID);
          execution.setPhase(VALIDATE_PHASE);
          execution.setGoals(Collections.singletonList(BMMP_GOAL));
          final Xpp3Dom xml=new Xpp3Dom("String_Node_Str");
          final Map<String,Object> config=new HashMap<String,Object>();
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str","String_Node_Str");
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",true);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",false);
          config.put("String_Node_Str",true);
          for (          final Map.Entry<String,Object> entry : config.entrySet()) {
            final Xpp3Dom child=new Xpp3Dom(entry.getKey());
            if (entry.getValue() != null) {
              child.setValue(entry.getValue().toString());
            }
            xml.addChild(child);
          }
          execution.setConfiguration(xml);
          final Plugin plugin=new Plugin();
          plugin.setGroupId(BMMP_GID);
          plugin.setArtifactId(BMMP_AID);
          plugin.setVersion(state.getBuildMetadataPluginVersion());
          plugin.addExecution(execution);
          plugin.setInherited(false);
          build.addPlugin(plugin);
          changed=true;
        }
        if (changed) {
          return Collections.singleton(project);
        }
      }
    }
  }
  return Collections.emptySet();
}