Program: 188386
Project: 188386
Buggy source:
public void configurePlugins(final String selectedClass){
  List<String> categoriesOnListBox=new ArrayList<>();
  if (plugins != null) {
    PluginUtils.sortByName(plugins);
    int pluginAdded=0;
    for (    PluginInfo pluginInfo : plugins) {
      if (pluginInfo != null) {
        List<String> pluginCategories=pluginInfo.getCategories();
        if (pluginCategories != null) {
          for (          String category : pluginCategories) {
            if (!categoriesOnListBox.contains(category) && !category.equals(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
              CheckBox box=new CheckBox();
              box.setText(messages.showPluginCategories(category));
              box.setName(category);
              box.addStyleName("String_Node_Str");
              box.addValueChangeHandler(new ValueChangeHandler<Boolean>(){
                @Override public void onValueChange(                ValueChangeEvent<Boolean> event){
                  workflowList.clear();
                  boolean noChecks=true;
                  if (plugins != null) {
                    PluginUtils.sortByName(plugins);
                    int pluginsAdded=0;
                    for (                    PluginInfo pluginInfo : plugins) {
                      if (pluginInfo != null) {
                        List<String> categories=pluginInfo.getCategories();
                        if (categories != null) {
                          for (int i=0; i < workflowCategoryList.getWidgetCount(); i++) {
                            CheckBox checkbox=(CheckBox)workflowCategoryList.getWidget(i);
                            if (checkbox.getValue()) {
                              noChecks=false;
                              if (categories.contains(checkbox.getName()) && !categories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
                                Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
                                if (pluginsAdded == 0) {
                                  CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
                                  pluginItem.addStyleName("String_Node_Str");
                                  pluginsAdded++;
                                }
                              }
                            }
                          }
                          if (noChecks) {
                            if (!pluginInfo.getCategories().contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
                              Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
                              if (pluginsAdded == 0) {
                                CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
                                pluginItem.addStyleName("String_Node_Str");
                                pluginsAdded++;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  updateWorkflowOptions();
                }
              }
);
              workflowCategoryList.add(box);
              categoriesOnListBox.add(category);
            }
          }
          if (!pluginCategories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
            Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
            if (pluginAdded == 0) {
              CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
              pluginItem.addStyleName("String_Node_Str");
              pluginAdded++;
            }
          }
        }
      }
 else {
        GWT.log("String_Node_Str");
      }
    }
    updateWorkflowOptions();
  }
}

Fixed version (ground truth):
public void configurePlugins(final String selectedClass){
  List<String> categoriesOnListBox=new ArrayList<>();
  if (plugins != null) {
    PluginUtils.sortByName(plugins);
    int pluginAdded=0;
    for (    PluginInfo pluginInfo : plugins) {
      if (pluginInfo != null) {
        List<String> pluginCategories=pluginInfo.getCategories();
        if (pluginCategories != null) {
          for (          String category : pluginCategories) {
            if (!categoriesOnListBox.contains(category) && !category.equals(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
              CheckBox box=new CheckBox();
              box.setText(messages.showPluginCategories(category));
              box.setName(category);
              box.addStyleName("String_Node_Str");
              box.addValueChangeHandler(new ValueChangeHandler<Boolean>(){
                @Override public void onValueChange(                ValueChangeEvent<Boolean> event){
                  workflowList.clear();
                  boolean noChecks=true;
                  if (plugins != null) {
                    PluginUtils.sortByName(plugins);
                    List<String> pluginsAdded=new ArrayList<>();
                    for (                    PluginInfo pluginInfo : plugins) {
                      if (pluginInfo != null) {
                        List<String> categories=pluginInfo.getCategories();
                        if (categories != null) {
                          for (int i=0; i < workflowCategoryList.getWidgetCount(); i++) {
                            CheckBox checkbox=(CheckBox)workflowCategoryList.getWidget(i);
                            if (checkbox.getValue()) {
                              noChecks=false;
                              if (categories.contains(checkbox.getName()) && !categories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))&& !pluginsAdded.contains(pluginInfo.getId())) {
                                Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
                                if (pluginsAdded.isEmpty()) {
                                  CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
                                  pluginItem.addStyleName("String_Node_Str");
                                }
                                pluginsAdded.add(pluginInfo.getId());
                              }
                            }
                          }
                          if (noChecks) {
                            if (!pluginInfo.getCategories().contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
                              Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
                              if (pluginsAdded.isEmpty()) {
                                CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
                                pluginItem.addStyleName("String_Node_Str");
                              }
                              pluginsAdded.add(pluginInfo.getId());
                            }
                          }
                        }
                      }
                    }
                  }
                  updateWorkflowOptions();
                }
              }
);
              workflowCategoryList.add(box);
              categoriesOnListBox.add(category);
            }
          }
          if (!pluginCategories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE) && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass)) || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
            Widget pluginItem=addPluginItemWidgetToWorkflowList(pluginInfo);
            if (pluginAdded == 0) {
              CreateSelectedJob.this.selectedPlugin=lookupPlugin(pluginInfo.getId());
              pluginItem.addStyleName("String_Node_Str");
              pluginAdded++;
            }
          }
        }
      }
 else {
        GWT.log("String_Node_Str");
      }
    }
    updateWorkflowOptions();
  }
}