Program: 167334
Project: 167334
Buggy source:
protected void addResourceCombo(XMLComponentDefinition componentDefintion,FormLayout formLayout,final Component component){
  if (componentDefintion == null) {
    log.error("String_Node_Str" + component.getName() + "String_Node_Str"+ component.getType());
  }
 else {
    IConfigurationService configurationService=context.getConfigurationService();
    FlowStep step=getSingleFlowStep();
    if (componentDefintion.getResourceCategory() != null && componentDefintion.getResourceCategory() != ResourceCategory.NONE && step != null) {
      final AbstractSelect resourcesCombo=new ComboBox("String_Node_Str");
      resourcesCombo.setImmediate(true);
      String projectVersionId=step.getComponent().getProjectVersionId();
      Set<XMLResourceDefinition> types=context.getDefinitionFactory().getResourceDefinitions(projectVersionId,componentDefintion.getResourceCategory());
      if (types != null) {
        String[] typeStrings=types.toArray(new String[types.size()]);
        int i=0;
        for (        XMLResourceDefinition type : types) {
          typeStrings[i++]=type.getId();
        }
        List<Resource> resources=new ArrayList<>(configurationService.findResourcesByTypes(projectVersionId,typeStrings));
        List<ProjectVersionDependency> dependencies=configurationService.findProjectDependencies(projectVersionId);
        for (        ProjectVersionDependency projectVersionDependency : dependencies) {
          resources.addAll(configurationService.findResourcesByTypes(projectVersionDependency.getTargetProjectVersionId(),typeStrings));
        }
        if (resources != null) {
          for (          Resource resource : resources) {
            resourcesCombo.addItem(resource);
          }
          resourcesCombo.setValue(component.getResource());
        }
      }
      resourcesCombo.addValueChangeListener(new ValueChangeListener(){
        private static final long serialVersionUID=1L;
        @Override public void valueChange(        ValueChangeEvent event){
          component.setResource((Resource)resourcesCombo.getValue());
          context.getConfigurationService().save(component);
        }
      }
);
      formLayout.addComponent(resourcesCombo);
    }
  }
}

Fixed version (ground truth):
protected void addResourceCombo(XMLComponentDefinition componentDefintion,FormLayout formLayout,final Component component){
  if (componentDefintion == null) {
    log.error("String_Node_Str" + component.getName() + "String_Node_Str"+ component.getType());
  }
 else {
    IConfigurationService configurationService=context.getConfigurationService();
    FlowStep step=getSingleFlowStep();
    if (componentDefintion.getResourceCategory() != null && componentDefintion.getResourceCategory() != ResourceCategory.NONE && step != null) {
      final AbstractSelect resourcesCombo=new ComboBox("String_Node_Str");
      resourcesCombo.setImmediate(true);
      String projectVersionId=step.getComponent().getProjectVersionId();
      Set<XMLResourceDefinition> types=context.getDefinitionFactory().getResourceDefinitions(projectVersionId,componentDefintion.getResourceCategory());
      if (types != null) {
        String[] typeStrings=new String[types.size()];
        int i=0;
        for (        XMLResourceDefinition type : types) {
          typeStrings[i++]=type.getId();
        }
        List<Resource> resources=new ArrayList<>(configurationService.findResourcesByTypes(projectVersionId,typeStrings));
        List<ProjectVersionDependency> dependencies=configurationService.findProjectDependencies(projectVersionId);
        for (        ProjectVersionDependency projectVersionDependency : dependencies) {
          resources.addAll(configurationService.findResourcesByTypes(projectVersionDependency.getTargetProjectVersionId(),typeStrings));
        }
        if (resources != null) {
          for (          Resource resource : resources) {
            resourcesCombo.addItem(resource);
          }
          resourcesCombo.setValue(component.getResource());
        }
      }
      resourcesCombo.addValueChangeListener(new ValueChangeListener(){
        private static final long serialVersionUID=1L;
        @Override public void valueChange(        ValueChangeEvent event){
          component.setResource((Resource)resourcesCombo.getValue());
          context.getConfigurationService().save(component);
        }
      }
);
      formLayout.addComponent(resourcesCombo);
    }
  }
}