nus-yam/ex-repair huggingface dataset:
Program: 140039
Project: 140039
Buggy source:
@Override protected void okPressed(){
  int year=timec.getYear();
  int month=timec.getMonth();
  int day=timec.getDay();
  Calendar cenlendar=Calendar.getInstance();
  cenlendar.set(year,month,day);
  SimpleDateFormat format=new SimpleDateFormat("String_Node_Str");
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  Calendar cenlendar=Calendar.getInstance();
  SimpleDateFormat format=null;
  int year=timed.getYear();
  int month=timed.getMonth();
  int day=timed.getDay();
  if (timet != null) {
    format=new SimpleDateFormat("String_Node_Str");
    int hour=timet.getHours();
    int mnts=timet.getMinutes();
    int secds=timet.getSeconds();
    cenlendar.set(year,month,day,hour,mnts,secds);
  }
 else {
    format=new SimpleDateFormat("String_Node_Str");
    cenlendar.set(year,month,day);
  }
  selectDate=format.format(cenlendar.getTime());
  super.okPressed();
}
Program: 140041
Project: 140041
Buggy source:
public IndicatorThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  Indicator currentIndicator=(Indicator)parameters.eContainer();
  int sqltype=((TdColumn)currentIndicator.getAnalyzedElement()).getJavaType();
  IndicatorEnum currentIndicatorType=IndicatorEnum.findIndicatorEnum(currentIndicator.eClass());
  isRangeForDate=Java2SqlType.isDateInSQL(sqltype) && currentIndicatorType.isAChildOf(IndicatorEnum.RangeIndicatorEnum);
  isOptionForRowCount=currentIndicatorType == IndicatorEnum.RowCountIndicatorEnum;
  setupForm();
}

Fixed version (ground truth):
public IndicatorThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  Indicator currentIndicator=(Indicator)parameters.eContainer();
  int sqltype=((TdColumn)currentIndicator.getAnalyzedElement()).getJavaType();
  IndicatorEnum currentIndicatorType=IndicatorEnum.findIndicatorEnum(currentIndicator.eClass());
  isRangeForDate=Java2SqlType.isDateInSQL(sqltype) && currentIndicatorType.isAChildOf(IndicatorEnum.RangeIndicatorEnum);
  if (isRangeForDate) {
    isDatetime=Java2SqlType.isDateTimeSQL(sqltype);
  }
  isOptionForRowCount=currentIndicatorType == IndicatorEnum.RowCountIndicatorEnum;
  setupForm();
}
Program: 140042
Project: 140042
Buggy source:
@Override protected void addUtilsButtonListeners(){
  if (isRangeForDate) {
    lowerText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          lowerText.setText(dialog.getSelectDate());
        }
      }
    }
);
    higherText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          higherText.setText(dialog.getSelectDate());
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  if (isRangeForDate) {
    lowerBTN.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null,isDatetime);
        if (Window.OK == dialog.open()) {
          lowerText.setText(dialog.getSelectDate());
        }
      }
    }
);
    higherBTN.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null,isDatetime);
        if (Window.OK == dialog.open()) {
          higherText.setText(dialog.getSelectDate());
        }
      }
    }
);
    lowerDelBTN.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        lowerText.setText("String_Node_Str");
      }
    }
);
    higherDelBTN.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        higherText.setText("String_Node_Str");
      }
    }
);
  }
}
Program: 140043
Project: 140043
Buggy source:
/** 
 * DOC rli Comment method "createTempConnectionFile".
 * @throws ReloadCompareException
 */
protected void createTempConnectionFile() throws ReloadCompareException {
  IFile tempConnectionFile=DQStructureComparer.getTempRefreshFile();
  TypedReturnCode<TdDataProvider> returnProvider=getRefreshedDataProvider(oldDataProvider);
  if (!returnProvider.isOk()) {
    throw new ReloadCompareException(returnProvider.getMessage());
  }
  tempReloadProvider=returnProvider.getObject();
  DqRepositoryViewService.saveDataProviderResource(tempReloadProvider,(IFolder)tempConnectionFile.getParent(),tempConnectionFile);
}

Fixed version (ground truth):
/** 
 * DOC rli Comment method "createTempConnectionFile".
 * @throws ReloadCompareException
 */
protected void createTempConnectionFile() throws ReloadCompareException {
  IFile tempConnectionFile=DQStructureComparer.getTempRefreshFile();
  TypedReturnCode<TdDataProvider> returnProvider=getRefreshedDataProvider(oldDataProvider);
  if (!returnProvider.isOk()) {
    throw new ReloadCompareException(returnProvider.getMessage());
  }
  tempReloadProvider=returnProvider.getObject();
  tempReloadProvider.setComponent(oldDataProvider.getComponent());
  DqRepositoryViewService.saveDataProviderResource(tempReloadProvider,(IFolder)tempConnectionFile.getParent(),tempConnectionFile);
  tempReloadProvider.setComponent(null);
}
Program: 140044
Project: 140044
Buggy source:
public static IComparisonLevel creatComparisonLevel(Object selectedObject){
  IComparisonLevel comparisonLevel=null;
  if (selectedObject instanceof AbstractDatabaseFolderNode) {
    AbstractDatabaseFolderNode dbFolderNode=(AbstractDatabaseFolderNode)selectedObject;
    EObject parentEObject=dbFolderNode.getParent();
    EObject childEObject=(EObject)dbFolderNode.getChildren()[0];
    Package ctatlogSwtich=SwitchHelpers.PACKAGE_SWITCH.doSwitch(parentEObject);
    if (ctatlogSwtich != null) {
      comparisonLevel=new CatalogSchemaComparisonLevel(ctatlogSwtich,childEObject);
    }
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(parentEObject);
    if (columnSet != null) {
      comparisonLevel=new TableViewComparisonLevel(columnSet);
    }
  }
 else   if (selectedObject instanceof IFile) {
    comparisonLevel=new DataProviderComparisonLevel(selectedObject);
  }
 else {
    comparisonLevel=null;
  }
  return comparisonLevel;
}

Fixed version (ground truth):
public static IComparisonLevel creatComparisonLevel(Object selectedObject){
  IComparisonLevel comparisonLevel=null;
  if (selectedObject instanceof AbstractDatabaseFolderNode) {
    AbstractDatabaseFolderNode dbFolderNode=(AbstractDatabaseFolderNode)selectedObject;
    EObject parentEObject=dbFolderNode.getParent();
    int folderNodeType=dbFolderNode.getFolderNodeType();
    Package ctatlogSwtich=SwitchHelpers.PACKAGE_SWITCH.doSwitch(parentEObject);
    if (ctatlogSwtich != null) {
      comparisonLevel=new CatalogSchemaComparisonLevel(ctatlogSwtich,folderNodeType);
    }
    ColumnSet columnSet=SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(parentEObject);
    if (columnSet != null) {
      comparisonLevel=new TableViewComparisonLevel(columnSet);
    }
  }
 else   if (selectedObject instanceof IFile) {
    comparisonLevel=new DataProviderComparisonLevel(selectedObject);
  }
 else {
    comparisonLevel=null;
  }
  return comparisonLevel;
}
Program: 140045
Project: 140045
Buggy source:
public CatalogSchemaComparisonLevel(EObject parentObj,EObject childObj){
  this(parentObj);
  if (childObj != null) {
    if (SwitchHelpers.TABLE_SWITCH.doSwitch(childObj) != null) {
      isCompareTabel=true;
    }
    if (SwitchHelpers.VIEW_SWITCH.doSwitch(childObj) != null) {
      isCompareView=true;
    }
  }
}

Fixed version (ground truth):
public CatalogSchemaComparisonLevel(EObject parentObj,int folderType){
  this(parentObj);
  if (folderType == IFolderNode.TABLEFOLDER_NODE_TYPE) {
    isCompareTabel=true;
  }
  if (folderType == IFolderNode.VIEWFOLDER_NODE_TYPE) {
    isCompareView=true;
  }
}
Program: 140046
Project: 140046
Buggy source:
@Override public void createPartControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new FillLayout());
  ScrolledComposite scomp=new ScrolledComposite(comp,SWT.H_SCROLL | SWT.V_SCROLL);
  scomp.setLayout(new FillLayout());
  Composite composite=new Composite(scomp,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  scomp.setExpandHorizontal(true);
  scomp.setExpandVertical(true);
  scomp.setMinWidth(400);
  scomp.setMinHeight(300);
  scomp.setContent(composite);
  gContainer=new Group(composite,SWT.NONE);
  gContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridLayout layout=new GridLayout(2,false);
  GridData data=new GridData(GridData.FILL_BOTH);
  gContainer.setLayout(layout);
  gContainer.setLayoutData(data);
  if (switchFlag) {
    tContainer=new Group(composite,SWT.NONE);
    tContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    tContainer.setLayout(new GridLayout(2,false));
    tContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    createExtDefault();
  }
  createDefault();
  getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new FillLayout());
  ScrolledComposite scomp=new ScrolledComposite(comp,SWT.H_SCROLL | SWT.V_SCROLL);
  scomp.setLayout(new FillLayout());
  Composite composite=new Composite(scomp,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  scomp.setExpandHorizontal(true);
  scomp.setExpandVertical(true);
  scomp.setMinWidth(400);
  scomp.setMinHeight(350);
  scomp.setContent(composite);
  gContainer=new Group(composite,SWT.NONE);
  gContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridLayout layout=new GridLayout(2,false);
  GridData data=new GridData(GridData.FILL_BOTH);
  gContainer.setLayout(layout);
  gContainer.setLayoutData(data);
  if (switchFlag) {
    tContainer=new Group(composite,SWT.NONE);
    tContainer.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    tContainer.setLayout(new GridLayout(2,false));
    tContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
    createExtDefault();
  }
  createDefault();
  getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
  initializeToolBar();
}
Program: 140047
Project: 140047
Buggy source:
/** 
 * Method "createConnection".
 * @param url the database url
 * @param driverClassName the Driver classname
 * @param props properties passed to the driver manager for getting the connection (normally at least a "user" and"password" property should be included)
 * @return the connection
 * @throws SQLException
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws ClassNotFoundException
 * @throws IOException
 */
public static Connection createConnection(String url,String driverClassName,Properties props) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
  Driver driver=getClassDriver(driverClassName);
  if (driver != null) {
    DriverManager.registerDriver(driver);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + driverClassName);
      log.debug("String_Node_Str");
      Enumeration<Driver> drivers=DriverManager.getDrivers();
      while (drivers.hasMoreElements()) {
        log.debug(drivers.nextElement());
      }
    }
    Connection connection=null;
    if (driverClassName.equals("String_Node_Str")) {
      connection=DriverManager.getConnection(url,props);
    }
 else     if (driverClassName.equals("String_Node_Str")) {
      connection=DriverManager.getConnection(url);
    }
 else {
      connection=driver.connect(url,props);
    }
    return connection;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method "createConnection".
 * @param url the database url
 * @param driverClassName the Driver classname
 * @param props properties passed to the driver manager for getting the connection (normally at least a "user" and"password" property should be included)
 * @return the connection
 * @throws SQLException
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws ClassNotFoundException
 * @throws IOException
 */
public static Connection createConnection(String url,String driverClassName,Properties props) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
  Driver driver=getClassDriver(driverClassName);
  if (driver != null) {
    DriverManager.registerDriver(driver);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + driverClassName);
      log.debug("String_Node_Str");
      Enumeration<Driver> drivers=DriverManager.getDrivers();
      while (drivers.hasMoreElements()) {
        log.debug(drivers.nextElement());
      }
    }
    Connection connection=null;
    if (driverClassName.equals("String_Node_Str")) {
      connection=DriverManager.getConnection(url,props);
    }
 else {
      connection=driver.connect(url,props);
    }
    return connection;
  }
  return null;
}
Program: 140049
Project: 140049
Buggy source:
public void widgetSelected(SelectionEvent event){
  FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
  String filename=dialog.open();
  if (filename != null) {
    fileText.setText(filename);
  }
 else {
    fileText.setText("String_Node_Str");
  }
  String url=SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str");
  String validURL=getValidURL(url);
  setConnectionURL(validURL);
  urlText.setText(getConnectionURL());
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent event){
  FileDialog dialog=new FileDialog(Display.getCurrent().getActiveShell());
  String filename=dialog.open();
  if (filename != null) {
    fileText.setText(filename);
  }
 else {
    fileText.setText("String_Node_Str");
  }
  String url=SupportDBUrlStore.getInstance().getDBUrl(dbType.getDBKey(),"String_Node_Str","String_Node_Str",fileText.getText(),"String_Node_Str","String_Node_Str");
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + url);
  }
  setConnectionURL(url);
  urlText.setText(getConnectionURL());
}
Program: 140051
Project: 140051
Buggy source:
private boolean isContainNumber(){
  TdColumn column=(TdColumn)selection.getFirstElement();
  return Java2SqlType.isNumbericInSQL(column.getJavaType());
}

Fixed version (ground truth):
private boolean isContainNumber(){
  if (!selection.isEmpty()) {
    Iterator it=selection.iterator();
    while (it.hasNext()) {
      TdColumn column=(TdColumn)it.next();
      if (Java2SqlType.isNumbericInSQL(column.getJavaType())) {
        return true;
      }
    }
  }
  return false;
}
Program: 140052
Project: 140052
Buggy source:
/** 
 * @param parentShell
 */
public IndicatorSelectDialog(Shell parentShell,String title,ColumnIndicator[] columnIndicators){
  super(parentShell);
  this.title=title;
  this.columnIndicators=columnIndicators;
  this.setShellStyle(SWT.MAX | SWT.RESIZE);
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public IndicatorSelectDialog(Shell parentShell,String title,ColumnIndicator[] columnIndicators){
  super(parentShell);
  this.title=title;
  this.columnIndicators=columnIndicators;
  int shellStyle=getShellStyle();
  setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
}
Program: 140053
Project: 140053
Buggy source:
protected TypedReturnCode<TdDataProvider> getRefreshedDataProvider(TdDataProvider oldDataProvider){
  TypedReturnCode<TdProviderConnection> tdProviderConnection=DataProviderHelper.getTdProviderConnection(oldDataProvider);
  String urlString=tdProviderConnection.getObject().getConnectionString();
  String driverClassName=tdProviderConnection.getObject().getDriverClassName();
  Properties properties=new Properties();
  properties.setProperty(PluginConstant.USER_PROPERTY,TaggedValueHelper.getValue(PluginConstant.USER_PROPERTY,tdProviderConnection.getObject()));
  properties.setProperty(org.talend.dq.PluginConstant.PASSWORD_PROPERTY,TaggedValueHelper.getValue(org.talend.dq.PluginConstant.PASSWORD_PROPERTY,tdProviderConnection.getObject()));
  DBConnectionParameter connectionParameters=new DBConnectionParameter();
  connectionParameters.setName(oldDataProvider.getName());
  connectionParameters.setAuthor(TaggedValueHelper.getAuthor(oldDataProvider));
  connectionParameters.setDescription(TaggedValueHelper.getDescription(oldDataProvider));
  connectionParameters.setPurpose(TaggedValueHelper.getPurpose(oldDataProvider));
  connectionParameters.setStatus(TaggedValueHelper.getDevStatus(oldDataProvider).getLiteral());
  connectionParameters.setJdbcUrl(urlString);
  connectionParameters.setDriverClassName(driverClassName);
  connectionParameters.setParameters(properties);
  TypedReturnCode<TdDataProvider> returnProvider=ConnectionService.createConnection(connectionParameters);
  return returnProvider;
}

Fixed version (ground truth):
protected TypedReturnCode<TdDataProvider> getRefreshedDataProvider(TdDataProvider oldDataProvider){
  TypedReturnCode<TdProviderConnection> tdProviderConnection=DataProviderHelper.getTdProviderConnection(oldDataProvider);
  String urlString=tdProviderConnection.getObject().getConnectionString();
  String driverClassName=tdProviderConnection.getObject().getDriverClassName();
  Properties properties=new Properties();
  properties.setProperty(PluginConstant.USER_PROPERTY,TaggedValueHelper.getValue(PluginConstant.USER_PROPERTY,tdProviderConnection.getObject()));
  properties.setProperty(org.talend.dq.PluginConstant.PASSWORD_PROPERTY,DataProviderHelper.getClearTextPassword(oldDataProvider));
  DBConnectionParameter connectionParameters=new DBConnectionParameter();
  connectionParameters.setName(oldDataProvider.getName());
  connectionParameters.setAuthor(TaggedValueHelper.getAuthor(oldDataProvider));
  connectionParameters.setDescription(TaggedValueHelper.getDescription(oldDataProvider));
  connectionParameters.setPurpose(TaggedValueHelper.getPurpose(oldDataProvider));
  connectionParameters.setStatus(TaggedValueHelper.getDevStatus(oldDataProvider).getLiteral());
  connectionParameters.setJdbcUrl(urlString);
  connectionParameters.setDriverClassName(driverClassName);
  connectionParameters.setParameters(properties);
  TypedReturnCode<TdDataProvider> returnProvider=ConnectionService.createConnection(connectionParameters);
  return returnProvider;
}
Program: 140054
Project: 140054
Buggy source:
/** 
 * DOC scorreia Comment method "getWhereInvalidClause".
 * @param value
 * @param whereClause
 * @param domain
 * @return
 */
private String getWhereInvalidClause(double value,Domain domain){
  double max=Double.valueOf(DomainHelper.getMaxValue(domain.getRanges().get(0)));
  double min=Double.valueOf(DomainHelper.getMinValue(domain.getRanges().get(0)));
  String whereClause=(value < min || value > max) ? columnName + dbmsLanguage.less() + min+ dbmsLanguage.or()+ columnName+ dbmsLanguage.greater()+ max : null;
  return whereClause;
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "getWhereInvalidClause".
 * @param value
 * @param whereClause
 * @param domain
 * @return
 */
private String getWhereInvalidClause(double value,Domain domain){
  final String maxValue=DomainHelper.getMaxValue(domain.getRanges().get(0));
  final String minValue=DomainHelper.getMinValue(domain.getRanges().get(0));
  String whereClause=null;
  boolean hasLowerThreshold=!StringUtils.isEmpty(minValue);
  boolean hasHigherThreshold=!StringUtils.isEmpty(maxValue);
  if (hasLowerThreshold && hasHigherThreshold) {
    whereClause=columnName + dbmsLanguage.less() + minValue+ dbmsLanguage.or()+ columnName+ dbmsLanguage.greater()+ maxValue;
  }
 else   if (hasLowerThreshold) {
    whereClause=columnName + dbmsLanguage.less() + minValue;
  }
 else   if (hasHigherThreshold) {
    whereClause=columnName + dbmsLanguage.greater() + maxValue;
  }
  return whereClause;
}
Program: 140055
Project: 140055
Buggy source:
public void checkPerformed(AbstractForm source){
  if (source.isStatusOnError()) {
    DynamicIndicatorOptionsPage.this.setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    DynamicIndicatorOptionsPage.this.setPageComplete(true);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}

Fixed version (ground truth):
public void checkPerformed(AbstractForm source){
  if (source.isStatusOnError()) {
    setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    setPageComplete(true);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}
Program: 140056
Project: 140056
Buggy source:
/** 
 * DOC zqin DynamicIndicatorOptionsPage constructor comment.
 * @param pageName
 */
public DynamicIndicatorOptionsPage(IndicatorUnit indicatorUnit){
  super(DefaultMessagesImpl.getString("String_Node_Str"));
  this.indicatorUnit=indicatorUnit;
  setPageComplete(false);
  setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  this.listener=new AbstractForm.ICheckListener(){
    public void checkPerformed(    AbstractForm source){
      if (source.isStatusOnError()) {
        DynamicIndicatorOptionsPage.this.setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        DynamicIndicatorOptionsPage.this.setPageComplete(true);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * DOC zqin DynamicIndicatorOptionsPage constructor comment.
 * @param pageName
 */
public DynamicIndicatorOptionsPage(IndicatorUnit indicatorUnit){
  super(DefaultMessagesImpl.getString("String_Node_Str"));
  this.indicatorUnit=indicatorUnit;
  setPageComplete(false);
  setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  this.listener=new AbstractForm.ICheckListener(){
    public void checkPerformed(    AbstractForm source){
      if (source.isStatusOnError()) {
        setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        setPageComplete(true);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
}
Program: 140058
Project: 140058
Buggy source:
public void modifyText(ModifyEvent e){
  String numb=numbOfBins.getText();
  if (numb == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numb)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  String numbtxt=numbOfBins.getText();
  if (numbtxt == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numbtxt)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    numb=Integer.parseInt(numbtxt);
    updateStatus(IStatus.OK,MSG_OK);
  }
}
Program: 140059
Project: 140059
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  Object inputList=tableViewer.getInput();
  Domain userDomain=DomainHelper.createDomain("String_Node_Str");
  if (inputList != null && (inputList instanceof List)) {
    List<RangeRestriction> eInputList=(List<RangeRestriction>)inputList;
    userDomain.getRanges().addAll(eInputList);
    parameters.setBins(userDomain);
    return true;
  }
 else {
    parameters.setBins(null);
    return false;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  Object inputList=tableViewer.getInput();
  Domain userDomain=DomainHelper.createDomain("String_Node_Str");
  if (inputList != null && (inputList instanceof List)) {
    List<RangeRestriction> eInputList=(List<RangeRestriction>)inputList;
    userDomain.getRanges().addAll(eInputList);
    parameters.setBins(userDomain);
    return true;
  }
 else   if (min != 0 && max != 0 && numb != 0 && min < max) {
    Domain domain=DomainHelper.createContiguousClosedBinsIntoDomain("String_Node_Str",numb,min,max);
    parameters.setBins(domain);
    return true;
  }
 else {
    parameters.setBins(null);
    return false;
  }
}
Program: 140061
Project: 140061
Buggy source:
public void modifyText(ModifyEvent e){
  String numbtxt=numbOfBins.getText();
  if (numbtxt == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numbtxt)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    numb=Integer.parseInt(numbtxt);
    updateStatus(IStatus.OK,MSG_OK);
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  String numbtxt=numbOfBins.getText();
  if (numbtxt == "String_Node_Str") {
    updateStatus(IStatus.ERROR,MSG_EMPTY);
  }
 else   if (!CheckValueUtils.isNumberValue(numbtxt)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
  }
}
Program: 140062
Project: 140062
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  Object inputList=tableViewer.getInput();
  Domain userDomain=DomainHelper.createDomain("String_Node_Str");
  if (inputList != null && (inputList instanceof List)) {
    List<RangeRestriction> eInputList=(List<RangeRestriction>)inputList;
    userDomain.getRanges().addAll(eInputList);
    parameters.setBins(userDomain);
    return true;
  }
 else   if (min != 0 && max != 0 && numb != 0 && min < max) {
    Domain domain=DomainHelper.createContiguousClosedBinsIntoDomain("String_Node_Str",numb,min,max);
    parameters.setBins(domain);
    return true;
  }
 else {
    parameters.setBins(null);
    return false;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean performFinish(){
  if (minValue.getText().equals("String_Node_Str") || maxValue.getText().equals("String_Node_Str") || numbOfBins.getText().equals("String_Node_Str")) {
    parameters.setBins(null);
  }
 else {
    double min=Double.parseDouble(minValue.getText());
    double max=Double.parseDouble(maxValue.getText());
    int numb=Integer.parseInt(numbOfBins.getText());
    Object inputList=tableViewer.getInput();
    Domain domain=DomainHelper.createDomain("String_Node_Str");
    if (inputList != null && (inputList instanceof List)) {
      List<RangeRestriction> eInputList=(List<RangeRestriction>)inputList;
      domain.getRanges().addAll(eInputList);
      parameters.setBins(domain);
    }
 else {
      domain=DomainHelper.createContiguousClosedBinsIntoDomain("String_Node_Str",numb,min,max);
      parameters.setBins(domain);
    }
  }
  return true;
}
Program: 140063
Project: 140063
Buggy source:
@Override protected void addFieldsListeners(){
  lowerText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String min=lowerText.getText();
      if (!CheckValueUtils.isNumberWithNegativeValue(min)) {
        updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
      }
 else {
        updateStatus(IStatus.OK,MSG_OK);
      }
    }
  }
);
  higherText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String max=higherText.getText();
      if (!CheckValueUtils.isNumberWithNegativeValue(max)) {
        updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
      }
 else {
        updateStatus(IStatus.OK,MSG_OK);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addFieldsListeners(){
  lowerText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String min=lowerText.getText();
      String max=higherText.getText();
      if (!min.equals("String_Node_Str") && !CheckValueUtils.isNumberWithNegativeValue(min)) {
        updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
      }
 else       if (CheckValueUtils.isAoverB(min,max)) {
        updateStatus(IStatus.ERROR,UIMessages.MSG_LOWER_LESS_HIGHER);
      }
 else {
        updateStatus(IStatus.OK,MSG_OK);
      }
    }
  }
);
  higherText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String max=higherText.getText();
      String min=lowerText.getText();
      if (!max.equals("String_Node_Str") && !CheckValueUtils.isNumberWithNegativeValue(max)) {
        updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
      }
 else       if (CheckValueUtils.isAoverB(min,max)) {
        updateStatus(IStatus.ERROR,UIMessages.MSG_LOWER_LESS_HIGHER);
      }
 else {
        updateStatus(IStatus.OK,MSG_OK);
      }
    }
  }
);
}
Program: 140064
Project: 140064
Buggy source:
public void modifyText(ModifyEvent e){
  String max=higherText.getText();
  if (!CheckValueUtils.isNumberWithNegativeValue(max)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
  }
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  String max=higherText.getText();
  String min=lowerText.getText();
  if (!max.equals("String_Node_Str") && !CheckValueUtils.isNumberWithNegativeValue(max)) {
    updateStatus(IStatus.ERROR,MSG_ONLY_NUMBER);
  }
 else   if (CheckValueUtils.isAoverB(min,max)) {
    updateStatus(IStatus.ERROR,UIMessages.MSG_LOWER_LESS_HIGHER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
  }
}
Program: 140065
Project: 140065
Buggy source:
@Override protected boolean checkFieldsValue(){
  String min=lowerText.getText();
  String max=higherText.getText();
  if (CheckValueUtils.isAoverB(min,max)) {
    updateStatus(IStatus.ERROR,LOWER_LESS_HIGHER);
  }
 else {
    updateStatus(IStatus.OK,MSG_OK);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean checkFieldsValue(){
  return false;
}
Program: 140066
Project: 140066
Buggy source:
@Override public boolean performFinish(){
  if (!checkFieldsValue()) {
    return false;
  }
  String min=lowerText.getText();
  String max=higherText.getText();
  if ("String_Node_Str".equals(min) && "String_Node_Str".equals(max)) {
    parameters.setDataValidDomain(null);
  }
 else {
    IndicatorHelper.setDataThreshold(parameters,min,max);
    Indicator indicator=(Indicator)parameters.eContainer();
    IndicatorHelper.propagateDataThresholdsInChildren(indicator);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  String min=lowerText.getText();
  String max=higherText.getText();
  if ("String_Node_Str".equals(min) && "String_Node_Str".equals(max)) {
    parameters.setDataValidDomain(null);
  }
 else {
    IndicatorHelper.setDataThreshold(parameters,min,max);
    Indicator indicator=(Indicator)parameters.eContainer();
    IndicatorHelper.propagateDataThresholdsInChildren(indicator);
  }
  return true;
}
Program: 140067
Project: 140067
Buggy source:
/** 
 * DOC Zqin Comment method "runInDQViewer". this method open DQ responsitory view and run the specified query.
 * @param tdDataProvider
 * @param query
 */
public void runInDQViewer(TdDataProvider tdDataProvider,String query,String editorName){
  if (editorName == null) {
    editorName=String.valueOf(SQLExplorerPlugin.getDefault().getEditorSerialNo());
  }
  SQLExplorerPlugin sqlexplorer=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=sqlexplorer.getAliasManager().getAliases();
  TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(tdDataProvider);
  TdProviderConnection providerConnection=tdPc.getObject();
  String url=providerConnection.getConnectionString();
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      SQLEditorInput input=new SQLEditorInput("String_Node_Str" + editorName + "String_Node_Str");
      input.setUser(alias.getDefaultUser());
      try {
        IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
        SQLEditor editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
        editorPart.setText(query);
        ExecSQLAction execSQLAction=new ExecSQLAction(editorPart);
        execSQLAction.run();
        break;
      }
 catch (      PartInitException e) {
        ExceptionHandler.process(e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC Zqin Comment method "runInDQViewer". this method open DQ responsitory view and run the specified query.
 * @param tdDataProvider
 * @param query
 */
public void runInDQViewer(TdDataProvider tdDataProvider,String query,String editorName){
  if (editorName == null) {
    editorName=String.valueOf(SQLExplorerPlugin.getDefault().getEditorSerialNo());
  }
  TypedReturnCode<TdProviderConnection> tdPc=DataProviderHelper.getTdProviderConnection(tdDataProvider);
  TdProviderConnection providerConnection=tdPc.getObject();
  String url=providerConnection.getConnectionString();
  SQLExplorerPlugin sqlexplorer=SQLExplorerPlugin.getDefault();
  Collection<Alias> aliases=sqlexplorer.getAliasManager().getAliases();
  if (aliases.isEmpty()) {
    new ChangePerspectiveAction(PluginConstant.SE_ID).run();
  }
  for (  Alias alias : aliases) {
    if (alias.getUrl().equals(url)) {
      SQLEditorInput input=new SQLEditorInput("String_Node_Str" + editorName + "String_Node_Str");
      input.setUser(alias.getDefaultUser());
      try {
        IWorkbenchPage page=SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
        SQLEditor editorPart=(SQLEditor)page.openEditor((IEditorInput)input,SQLEditor.class.getName());
        editorPart.setText(query);
        ExecSQLAction execSQLAction=new ExecSQLAction(editorPart);
        execSQLAction.run();
        break;
      }
 catch (      PartInitException e) {
        ExceptionHandler.process(e);
      }
    }
  }
}
Program: 140068
Project: 140068
Buggy source:
public DuplicateCWMResourceAction(IFile[] files){
  super("String_Node_Str");
  this.files=files;
}

Fixed version (ground truth):
public DuplicateCWMResourceAction(IFile[] files){
  super("String_Node_Str");
  setImageDescriptor(ImageLib.getImageDescriptor(ImageLib.EDIT_COPY));
  this.files=files;
}
Program: 140069
Project: 140069
Buggy source:
public void createControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new GridLayout());
  comp.setLayoutData(new GridData(GridData.FILL_BOTH));
  AbstractIndicatorForm.setParameters(parameters);
  FreqTimeSliceForm timeSliceForm=new FreqTimeSliceForm(comp,SWT.NONE);
  timeSliceForm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  timeSliceForm.setListener(listener);
  setControl(comp);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  comp.setLayout(new GridLayout());
  comp.setLayoutData(new GridData(GridData.FILL_BOTH));
  FreqTimeSliceForm timeSliceForm=new FreqTimeSliceForm(comp,SWT.NONE,parameters);
  timeSliceForm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  timeSliceForm.setListener(listener);
  setControl(comp);
}
Program: 140070
Project: 140070
Buggy source:
public AbstractIndicatorForm[] createForm(Composite parent,ICheckListener listener,FormEnum[] formTypes){
  IndicatorParameters parameters=indicatorUnit.getIndicator().getParameters();
  if (parameters == null) {
    parameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    indicatorUnit.getIndicator().setParameters(parameters);
  }
  AbstractIndicatorForm.setParameters(parameters);
  AbstractIndicatorForm.setSqltype(indicatorUnit.getParentColumn().getTdColumn().getJavaType());
  AbstractIndicatorForm[] froms=new AbstractIndicatorForm[formTypes.length];
  for (int i=0; i < formTypes.length; i++) {
    AbstractIndicatorForm form=IndicatorFormFactory.createForm(parent,formTypes[i]);
    form.setListener(listener);
    froms[i]=form;
  }
  return froms;
}

Fixed version (ground truth):
public AbstractIndicatorForm[] createForm(Composite parent,ICheckListener listener,FormEnum[] formTypes){
  IndicatorParameters parameters=indicatorUnit.getIndicator().getParameters();
  if (parameters == null) {
    parameters=IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    indicatorUnit.getIndicator().setParameters(parameters);
  }
  AbstractIndicatorForm[] froms=new AbstractIndicatorForm[formTypes.length];
  for (int i=0; i < formTypes.length; i++) {
    AbstractIndicatorForm form=IndicatorFormFactory.createForm(parent,formTypes[i],parameters);
    form.setListener(listener);
    froms[i]=form;
  }
  return froms;
}
Program: 140071
Project: 140071
Buggy source:
public static AbstractIndicatorForm createForm(Composite parent,FormEnum formEnum){
  AbstractIndicatorForm form=null;
switch (formEnum) {
case BinsDesignerForm:
    form=new BinsDesignerForm(parent,SWT.NONE);
  break;
case TextLengthForm:
form=new TextLengthForm(parent,SWT.NONE);
break;
case FreqTextLengthForm:
form=new FreqTextLengthForm(parent,SWT.NONE);
break;
case TextParametersForm:
form=new TextParametersForm(parent,SWT.NONE);
break;
case DataThresholdsForm:
form=new DataThresholdsForm(parent,SWT.NONE);
break;
case TimeSlicesForm:
form=new TimeSlicesForm(parent,SWT.NONE);
break;
case FreqBinsDesignerForm:
form=new FreqBinsDesignerForm(parent,SWT.NONE);
break;
case FreqTextParametersForm:
form=new FreqTextParametersForm(parent,SWT.NONE);
break;
case FreqTimeSliceForm:
form=new FreqTimeSliceForm(parent,SWT.NONE);
break;
case IndicatorThresholdsForm:
form=new IndicatorThresholdsForm(parent,SWT.NONE);
break;
case NumbericNominalForm:
form=new NumbericNominalForm(parent,SWT.NONE);
break;
case ExpectedValueForm:
form=new ExpectedValueForm(parent,SWT.NONE);
break;
default :
}
return form;
}

Fixed version (ground truth):
public static AbstractIndicatorForm createForm(Composite parent,FormEnum formEnum,IndicatorParameters parameters){
  AbstractIndicatorForm form=null;
switch (formEnum) {
case BinsDesignerForm:
    form=new BinsDesignerForm(parent,SWT.NONE,parameters);
  break;
case TextLengthForm:
form=new TextLengthForm(parent,SWT.NONE,parameters);
break;
case FreqTextLengthForm:
form=new FreqTextLengthForm(parent,SWT.NONE,parameters);
break;
case TextParametersForm:
form=new TextParametersForm(parent,SWT.NONE,parameters);
break;
case DataThresholdsForm:
form=new DataThresholdsForm(parent,SWT.NONE,parameters);
break;
case TimeSlicesForm:
form=new TimeSlicesForm(parent,SWT.NONE,parameters);
break;
case FreqBinsDesignerForm:
form=new FreqBinsDesignerForm(parent,SWT.NONE,parameters);
break;
case FreqTextParametersForm:
form=new FreqTextParametersForm(parent,SWT.NONE,parameters);
break;
case FreqTimeSliceForm:
form=new FreqTimeSliceForm(parent,SWT.NONE,parameters);
break;
case IndicatorThresholdsForm:
form=new IndicatorThresholdsForm(parent,SWT.NONE,parameters);
break;
case NumbericNominalForm:
form=new NumbericNominalForm(parent,SWT.NONE,parameters);
break;
case ExpectedValueForm:
form=new ExpectedValueForm(parent,SWT.NONE,parameters);
break;
default :
}
return form;
}
Program: 140072
Project: 140072
Buggy source:
/** 
 * DOC zqin AbstractIndicatorForm constructor comment.
 * @param parent
 * @param style
 */
public AbstractIndicatorForm(Composite parent,int style){
  super(parent,style);
}

Fixed version (ground truth):
/** 
 * DOC Administrator AbstractIndicatorForm constructor comment.
 * @param parent
 * @param style
 * @param parameters
 */
public AbstractIndicatorForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style);
  this.parameters=parameters;
}
Program: 140073
Project: 140073
Buggy source:
public BinsDesignerForm(Composite parent,int style){
  super(parent,style);
  setupForm();
}

Fixed version (ground truth):
public BinsDesignerForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  setupForm();
}
Program: 140074
Project: 140074
Buggy source:
public DataThresholdsForm(Composite parent,int style){
  super(parent,style);
  setupForm();
}

Fixed version (ground truth):
public DataThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  setupForm();
}
Program: 140075
Project: 140075
Buggy source:
/** 
 * DOC zqin ExpectedValueForm constructor comment.
 * @param parent
 * @param style
 * @param parameter
 */
public ExpectedValueForm(Composite parent,int style){
  super(parent,style);
  setupForm();
}

Fixed version (ground truth):
/** 
 * DOC zqin ExpectedValueForm constructor comment.
 * @param parent
 * @param style
 * @param parameter
 */
public ExpectedValueForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  setupForm();
}
Program: 140076
Project: 140076
Buggy source:
@Override protected void addFields(){
  Group group=new Group(this,SWT.NONE);
  group.setLayout(new GridLayout(2,false));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData gdText=new GridData(GridData.FILL_HORIZONTAL);
  Label lowerLabel=new Label(group,SWT.NONE);
  lowerLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  lowerText=new Text(group,SWT.BORDER);
  lowerText.setLayoutData(gdText);
  Label higherLabel=new Label(group,SWT.NONE);
  higherLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  higherText=new Text(group,SWT.BORDER);
  higherText.setLayoutData(gdText);
  if (!(parameters.eContainer() instanceof RowCountIndicator) && !Java2SqlType.isDateInSQL(sqltype)) {
    Group pGroup=new Group(this,SWT.NONE);
    pGroup.setLayout(new GridLayout(2,false));
    pGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    pGroup.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    Label pLower=new Label(pGroup,SWT.NONE);
    pLower.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    pLowerText=new Text(pGroup,SWT.BORDER);
    pLowerText.setLayoutData(gdText);
    Label pHigher=new Label(pGroup,SWT.NONE);
    pHigher.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    pHigherText=new Text(pGroup,SWT.BORDER);
    pHigherText.setLayoutData(gdText);
    setPercentUIEnable();
  }
}

Fixed version (ground truth):
@Override protected void addFields(){
  Group group=new Group(this,SWT.NONE);
  group.setLayout(new GridLayout(2,false));
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  group.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData gdText=new GridData(GridData.FILL_HORIZONTAL);
  Label lowerLabel=new Label(group,SWT.NONE);
  lowerLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  lowerText=new Text(group,SWT.BORDER);
  lowerText.setLayoutData(gdText);
  Label higherLabel=new Label(group,SWT.NONE);
  higherLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  higherText=new Text(group,SWT.BORDER);
  higherText.setLayoutData(gdText);
  if (!isOptionForRowCount && !isRangeForDate) {
    Group pGroup=new Group(this,SWT.NONE);
    pGroup.setLayout(new GridLayout(2,false));
    pGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    pGroup.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    Label pLower=new Label(pGroup,SWT.NONE);
    pLower.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    pLowerText=new Text(pGroup,SWT.BORDER);
    pLowerText.setLayoutData(gdText);
    Label pHigher=new Label(pGroup,SWT.NONE);
    pHigher.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    pHigherText=new Text(pGroup,SWT.BORDER);
    pHigherText.setLayoutData(gdText);
    setPercentUIEnable();
  }
}
Program: 140077
Project: 140077
Buggy source:
public IndicatorThresholdsForm(Composite parent,int style){
  super(parent,style);
  setupForm();
}

Fixed version (ground truth):
public IndicatorThresholdsForm(Composite parent,int style,IndicatorParameters parameters){
  super(parent,style,parameters);
  Indicator currentIndicator=(Indicator)parameters.eContainer();
  int sqltype=((TdColumn)currentIndicator.getAnalyzedElement()).getJavaType();
  IndicatorEnum currentIndicatorType=IndicatorEnum.findIndicatorEnum(currentIndicator.eClass());
  isRangeForDate=Java2SqlType.isDateInSQL(sqltype) && currentIndicatorType.isAChildOf(IndicatorEnum.RangeIndicatorEnum);
  isOptionForRowCount=currentIndicatorType == IndicatorEnum.RowCountIndicatorEnum;
  setupForm();
}
Program: 140078
Project: 140078
Buggy source:
private void setPercentUIEnable(){
  IEditorPart editor=CorePlugin.getDefault().getCurrentActiveEditor();
  ColumnMasterDetailsPage masterPage=null;
  AnalysisEditor anaEditor=null;
  if (editor != null) {
    anaEditor=(AnalysisEditor)editor;
    if (anaEditor.getMasterPage() != null) {
      masterPage=(ColumnMasterDetailsPage)anaEditor.getMasterPage();
    }
  }
  if (masterPage != null) {
    canUsed=AnalysisHelper.containsRowCount(masterPage.getAnalysisHandler().getAnalysis());
  }
  pLowerText.setEnabled(canUsed);
  pHigherText.setEnabled(canUsed);
}

Fixed version (ground truth):
private void setPercentUIEnable(){
  IEditorPart editor=CorePlugin.getDefault().getCurrentActiveEditor();
  ColumnMasterDetailsPage masterPage=null;
  AnalysisEditor anaEditor=null;
  if (editor != null) {
    anaEditor=(AnalysisEditor)editor;
    if (anaEditor.getMasterPage() != null) {
      masterPage=(ColumnMasterDetailsPage)anaEditor.getMasterPage();
    }
  }
  if (masterPage != null) {
    isContainRowCount=AnalysisHelper.containsRowCount(masterPage.getAnalysisHandler().getAnalysis());
  }
  pLowerText.setEnabled(isContainRowCount);
  pHigherText.setEnabled(isContainRowCount);
}
Program: 140079
Project: 140079
Buggy source:
@Override protected void addUtilsButtonListeners(){
  if (Java2SqlType.isDateInSQL(sqltype)) {
    lowerText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          lowerText.setText(dialog.getSelectDate());
        }
      }
    }
);
    higherText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          higherText.setText(dialog.getSelectDate());
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  if (isRangeForDate) {
    lowerText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          lowerText.setText(dialog.getSelectDate());
        }
      }
    }
);
    higherText.addMouseListener(new MouseAdapter(){
      @Override public void mouseDown(      MouseEvent e){
        DateTimeDialog dialog=new DateTimeDialog(null);
        if (Window.OK == dialog.open()) {
          higherText.setText(dialog.getSelectDate());
        }
      }
    }
);
  }
}
Program: 140081
Project: 140081
Buggy source:
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && canUsed) {
    pLowerText.setText(indicatorPersentThreshold[0]);
    pHigherText.setText(indicatorPersentThreshold[1]);
  }
}

Fixed version (ground truth):
@Override protected void initialize(){
  String[] indicatorThreshold=IndicatorHelper.getIndicatorThreshold(parameters);
  if (indicatorThreshold != null) {
    lowerText.setText(indicatorThreshold[0]);
    higherText.setText(indicatorThreshold[1]);
  }
  String[] indicatorPersentThreshold=IndicatorHelper.getIndicatorThresholdInPercent(parameters);
  if (indicatorPersentThreshold != null && isContainRowCount) {
    pLowerText.setText(indicatorPersentThreshold[0]);
    pHigherText.setText(indicatorPersentThreshold[1]);
  }
}