Program: 108934
Project: 108934
Buggy source:
public ViewAttributeDefinition(final CTabFolder parent,final String attribute,final Controller controller){
  IMAGE_INSENSITIVE=controller.getResources().getImage("String_Node_Str");
  IMAGE_SENSITIVE=controller.getResources().getImage("String_Node_Str");
  IMAGE_QUASI_IDENTIFYING=controller.getResources().getImage("String_Node_Str");
  IMAGE_IDENTIFYING=controller.getResources().getImage("String_Node_Str");
  this.controller=controller;
  this.attribute=attribute;
  this.controller.addListener(ModelPart.MODEL,this);
  this.controller.addListener(ModelPart.INPUT,this);
  this.controller.addListener(ModelPart.ATTRIBUTE_TYPE,this);
  tab=new CTabItem(parent,SWT.NULL);
  tab.setText(attribute);
  tab.setShowClose(false);
  tab.setImage(IMAGE_INSENSITIVE);
  Composite group=new Composite(parent,SWT.NULL);
  group.setLayoutData(SWTUtil.createFillGridData());
  final GridLayout groupInputGridLayout=new GridLayout();
  groupInputGridLayout.numColumns=1;
  group.setLayout(groupInputGridLayout);
  final Composite type=new Composite(group,SWT.NULL);
  type.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  final GridLayout typeInputGridLayout=new GridLayout();
  typeInputGridLayout.numColumns=4;
  type.setLayout(typeInputGridLayout);
  final IView outer=this;
  final Label kLabel=new Label(type,SWT.PUSH);
  kLabel.setText(Resources.getMessage("String_Node_Str"));
  typeCombo=new Combo(type,SWT.READ_ONLY);
  typeCombo.setLayoutData(SWTUtil.createFillGridData());
  typeCombo.setItems(COMBO1_VALUES);
  typeCombo.select(0);
  typeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if ((typeCombo.getSelectionIndex() != -1) && (attribute != null)) {
        if ((model != null) && (model.getInputConfig().getInput() != null)) {
          final AttributeType type=COMBO1_TYPES[typeCombo.getSelectionIndex()];
          final DataDefinition definition=model.getInputConfig().getInput().getDefinition();
          if (type == null) {
            definition.setAttributeType(attribute,Hierarchy.create());
          }
 else {
            definition.setAttributeType(attribute,type);
          }
          if (type == AttributeType.SENSITIVE_ATTRIBUTE) {
            model.getLDiversityModel().get(attribute).setActive(true);
            model.getTClosenessModel().get(attribute).setActive(true);
          }
 else {
            model.getLDiversityModel().get(attribute).setActive(false);
            model.getLDiversityModel().get(attribute).setEnabled(false);
            model.getTClosenessModel().get(attribute).setActive(false);
            model.getTClosenessModel().get(attribute).setEnabled(false);
          }
          if (definition.getQuasiIdentifyingAttributes().isEmpty()) {
            model.getKAnonymityModel().setActive(false);
            model.getDPresenceModel().setActive(false);
          }
 else {
            model.getKAnonymityModel().setActive(true);
            model.getDPresenceModel().setActive(true);
          }
          updateIcon();
          controller.update(new ModelEvent(outer,ModelPart.ATTRIBUTE_TYPE,attribute));
        }
      }
    }
  }
);
  final Label kLabel2=new Label(type,SWT.PUSH);
  kLabel2.setText(Resources.getMessage("String_Node_Str"));
  dataTypeCombo=new Combo(type,SWT.READ_ONLY);
  dataTypeCombo.setLayoutData(SWTUtil.createFillGridData());
  dataTypeCombo.setItems(COMBO2_VALUES);
  dataTypeCombo.select(0);
  dataTypeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if ((dataTypeCombo.getSelectionIndex() != -1) && (attribute != null)) {
        if ((model != null) && (model.getInputConfig().getInput() != null)) {
          DataType<?> type=COMBO2_TYPES[dataTypeCombo.getSelectionIndex()];
          if (type == DataType.DATE) {
            final String format=controller.actionShowDateFormatInputDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),getValues());
            if (format == null) {
              type=DataType.STRING;
              dataTypeCombo.select(0);
            }
 else {
              type=DataType.DATE(format);
            }
          }
          model.getInputConfig().getInput().getDefinition().setDataType(attribute,type);
          controller.update(new ModelEvent(outer,ModelPart.DATA_TYPE,attribute));
        }
      }
    }
  }
);
  editor=new ViewHierarchy(group,attribute,controller);
  tab.setControl(group);
}

Fixed version (ground truth):
public ViewAttributeDefinition(final CTabFolder parent,final String attribute,final Controller controller){
  IMAGE_INSENSITIVE=controller.getResources().getImage("String_Node_Str");
  IMAGE_SENSITIVE=controller.getResources().getImage("String_Node_Str");
  IMAGE_QUASI_IDENTIFYING=controller.getResources().getImage("String_Node_Str");
  IMAGE_IDENTIFYING=controller.getResources().getImage("String_Node_Str");
  this.controller=controller;
  this.attribute=attribute;
  this.controller.addListener(ModelPart.MODEL,this);
  this.controller.addListener(ModelPart.INPUT,this);
  this.controller.addListener(ModelPart.ATTRIBUTE_TYPE,this);
  tab=new CTabItem(parent,SWT.NULL);
  tab.setText(attribute);
  tab.setShowClose(false);
  tab.setImage(IMAGE_INSENSITIVE);
  Composite group=new Composite(parent,SWT.NULL);
  group.setLayoutData(SWTUtil.createFillGridData());
  final GridLayout groupInputGridLayout=new GridLayout();
  groupInputGridLayout.numColumns=1;
  group.setLayout(groupInputGridLayout);
  final Composite type=new Composite(group,SWT.NULL);
  type.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  final GridLayout typeInputGridLayout=new GridLayout();
  typeInputGridLayout.numColumns=4;
  type.setLayout(typeInputGridLayout);
  final IView outer=this;
  final Label kLabel=new Label(type,SWT.PUSH);
  kLabel.setText(Resources.getMessage("String_Node_Str"));
  typeCombo=new Combo(type,SWT.READ_ONLY);
  typeCombo.setLayoutData(SWTUtil.createFillGridData());
  typeCombo.setItems(COMBO1_VALUES);
  typeCombo.select(0);
  typeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if ((typeCombo.getSelectionIndex() != -1) && (attribute != null)) {
        if ((model != null) && (model.getInputConfig().getInput() != null)) {
          final AttributeType type=COMBO1_TYPES[typeCombo.getSelectionIndex()];
          final DataDefinition definition=model.getInputConfig().getInput().getDefinition();
          if (type == null) {
            definition.setAttributeType(attribute,Hierarchy.create());
          }
 else {
            definition.setAttributeType(attribute,type);
          }
          boolean criteriaDisabled=false;
          if (type == AttributeType.SENSITIVE_ATTRIBUTE) {
            model.getLDiversityModel().get(attribute).setActive(true);
            model.getTClosenessModel().get(attribute).setActive(true);
          }
 else {
            if (model.getLDiversityModel().get(attribute).isEnabled() || model.getTClosenessModel().get(attribute).isEnabled()) {
              criteriaDisabled=true;
            }
            model.getLDiversityModel().get(attribute).setActive(false);
            model.getTClosenessModel().get(attribute).setActive(false);
            model.getTClosenessModel().get(attribute).setEnabled(false);
            model.getLDiversityModel().get(attribute).setEnabled(false);
          }
          if (definition.getQuasiIdentifyingAttributes().isEmpty()) {
            if (model.getKAnonymityModel().isEnabled() || model.getDPresenceModel().isEnabled()) {
              criteriaDisabled=true;
            }
            model.getKAnonymityModel().setActive(false);
            model.getDPresenceModel().setActive(false);
            model.getKAnonymityModel().setEnabled(false);
            model.getDPresenceModel().setEnabled(false);
          }
 else {
            model.getKAnonymityModel().setActive(true);
            model.getDPresenceModel().setActive(true);
          }
          updateIcon();
          if (criteriaDisabled) {
            controller.update(new ModelEvent(outer,ModelPart.CRITERION_DEFINITION,null));
          }
          controller.update(new ModelEvent(outer,ModelPart.ATTRIBUTE_TYPE,attribute));
        }
      }
    }
  }
);
  final Label kLabel2=new Label(type,SWT.PUSH);
  kLabel2.setText(Resources.getMessage("String_Node_Str"));
  dataTypeCombo=new Combo(type,SWT.READ_ONLY);
  dataTypeCombo.setLayoutData(SWTUtil.createFillGridData());
  dataTypeCombo.setItems(COMBO2_VALUES);
  dataTypeCombo.select(0);
  dataTypeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if ((dataTypeCombo.getSelectionIndex() != -1) && (attribute != null)) {
        if ((model != null) && (model.getInputConfig().getInput() != null)) {
          DataType<?> type=COMBO2_TYPES[dataTypeCombo.getSelectionIndex()];
          if (type == DataType.DATE) {
            final String format=controller.actionShowDateFormatInputDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),getValues());
            if (format == null) {
              type=DataType.STRING;
              dataTypeCombo.select(0);
            }
 else {
              type=DataType.DATE(format);
            }
          }
          model.getInputConfig().getInput().getDefinition().setDataType(attribute,type);
          controller.update(new ModelEvent(outer,ModelPart.DATA_TYPE,attribute));
        }
      }
    }
  }
);
  editor=new ViewHierarchy(group,attribute,controller);
  tab.setControl(group);
}