nus-yam/ex-repair huggingface dataset:
Program: 66073
Project: 66073
Buggy source:
public void testTrailing1() throws IOException {
  int[] values=new int[]{2011,3,9,4,39,5,22,265};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK,TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR};
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=TimeFunctionFactory.createTrailingFunction(TimeMember.TIME_LEVEL_TYPE_YEAR,-3).getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}

Fixed version (ground truth):
public void testTrailing1() throws IOException {
  int[] values=new int[]{2011,3,9,4,39,5,22,265};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK,TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR};
  TimeMember timeMember=new TimeMember(values,types);
  IPeriodsFunction periodsFunction=TimeFunctionFactory.createTrailingFunction(TimeMember.TIME_LEVEL_TYPE_YEAR,-3);
  ReferenceDate referenceDate=new ReferenceDate(new Date(2011,8,22));
  ((AbstractMDX)periodsFunction).setReferenceDate(referenceDate);
  List<TimeMember> timeMembers=periodsFunction.getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}
Program: 66074
Project: 66074
Buggy source:
public void testWTD3() throws IOException {
  int[] values=new int[]{2002,1,2,1,7};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK};
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=new WeekToDateFunciton().getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}

Fixed version (ground truth):
public void testWTD3() throws IOException {
  int[] values=new int[]{2002,1,2,1,7};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK};
  ReferenceDate referenceDate=new ReferenceDate(new Date(2002,1,9));
  WeekToDateFunciton weekToDate=new WeekToDateFunciton();
  ((AbstractMDX)weekToDate).setReferenceDate(referenceDate);
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=weekToDate.getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}
Program: 66075
Project: 66075
Buggy source:
public void testWTD4() throws IOException {
  int[] values=new int[]{2011,1,2,1};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH};
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=new WeekToDateFunciton().getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}

Fixed version (ground truth):
public void testWTD4() throws IOException {
  int[] values=new int[]{2011,1,2,1};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH};
  ReferenceDate referenceDate=new ReferenceDate(new Date(2011,1,5));
  WeekToDateFunciton weekToDate=new WeekToDateFunciton();
  ((AbstractMDX)weekToDate).setReferenceDate(referenceDate);
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=weekToDate.getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}
Program: 66076
Project: 66076
Buggy source:
public void testWTD1() throws IOException {
  int[] values=new int[]{2011,3,9,4,39,5,22,265};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK,TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR};
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=new WeekToDateFunciton().getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}

Fixed version (ground truth):
public void testWTD1() throws IOException {
  int[] values=new int[]{2011,3,9,4,39,5,22,265};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_QUARTER,TimeMember.TIME_LEVEL_TYPE_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK,TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH,TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR};
  TimeMember timeMember=new TimeMember(values,types);
  ReferenceDate referenceDate=new ReferenceDate(new Date(2011,8,22));
  WeekToDateFunciton weekToDate=new WeekToDateFunciton();
  ((AbstractMDX)weekToDate).setReferenceDate(referenceDate);
  List<TimeMember> timeMembers=weekToDate.getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}
Program: 66077
Project: 66077
Buggy source:
public void testWTD2() throws IOException {
  int[] values=new int[]{2011,20,5};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK};
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=new WeekToDateFunciton().getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}

Fixed version (ground truth):
public void testWTD2() throws IOException {
  int[] values=new int[]{2011,20,5};
  String[] types=new String[]{TimeMember.TIME_LEVEL_TYPE_YEAR,TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR,TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK};
  ReferenceDate referenceDate=new ReferenceDate(new Date(2011,4,19));
  WeekToDateFunciton weekToDate=new WeekToDateFunciton();
  ((AbstractMDX)weekToDate).setReferenceDate(referenceDate);
  TimeMember timeMember=new TimeMember(values,types);
  List<TimeMember> timeMembers=weekToDate.getResult(timeMember);
  printMembers(timeMembers);
  checkOutputFile();
}
Program: 66084
Project: 66084
Buggy source:
/** 
 * @param outputStream
 * @param exprMap
 * @throws IOException
 * @throws DataException 
 */
private static Map loadBinding(InputStream inputStream,int version) throws IOException, DataException {
  DataInputStream dis=new DataInputStream(inputStream);
  Map exprMap=new HashMap();
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    String exprName=IOUtil.readString(dis);
    if (version < VersionManager.VERSION_2_2_1)     exprMap.put(exprName,new Binding(exprName,ExprUtil.loadBaseExpr(dis)));
 else     exprMap.put(exprName,BindingIOUtil.loadBinding(dis));
  }
  return exprMap;
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param exprMap
 * @throws IOException
 * @throws DataException 
 */
private static Map loadBinding(InputStream inputStream,int version) throws IOException, DataException {
  DataInputStream dis=new DataInputStream(inputStream);
  Map exprMap=new HashMap();
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    String exprName=IOUtil.readString(dis);
    if (version < VersionManager.VERSION_2_2_1)     exprMap.put(exprName,new Binding(exprName,ExprUtil.loadBaseExpr(dis)));
 else     exprMap.put(exprName,BindingIOUtil.loadBinding(dis,version));
  }
  return exprMap;
}
Program: 66085
Project: 66085
Buggy source:
/** 
 * @param outputStream
 * @param exprMap
 * @throws IOException
 * @throws DataException 
 */
private static void saveBinding(OutputStream outputStream,Map exprMap,int version) throws IOException, DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  if (exprMap == null) {
    IOUtil.writeInt(dos,0);
  }
 else {
    IOUtil.writeInt(dos,exprMap.size());
    Iterator it=exprMap.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry=(Entry)it.next();
      IOUtil.writeString(dos,(String)entry.getKey());
      if (version < VersionManager.VERSION_2_2_1)       ExprUtil.saveBaseExpr(dos,((IBinding)entry.getValue()).getExpression());
 else       BindingIOUtil.saveBinding(dos,(IBinding)entry.getValue());
    }
  }
  dos.flush();
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param exprMap
 * @throws IOException
 * @throws DataException 
 */
private static void saveBinding(OutputStream outputStream,Map exprMap,int version) throws IOException, DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  if (exprMap == null) {
    IOUtil.writeInt(dos,0);
  }
 else {
    IOUtil.writeInt(dos,exprMap.size());
    Iterator it=exprMap.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry=(Entry)it.next();
      IOUtil.writeString(dos,(String)entry.getKey());
      if (version < VersionManager.VERSION_2_2_1)       ExprUtil.saveBaseExpr(dos,((IBinding)entry.getValue()).getExpression());
 else       BindingIOUtil.saveBinding(dos,(IBinding)entry.getValue(),version);
    }
  }
  dos.flush();
}
Program: 66086
Project: 66086
Buggy source:
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,IDocArchiveWriter writer,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings());
    saveFilters(dos,qd.getFilters());
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveEdges(dos,qd);
    saveCubeOperations(dos,qd.getCubeOperations());
    dos.flush();
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Saves   {@code CubeQueryDefinition} instance into report document
 * @param queryResultID
 * @param writer
 * @param qd
 * @throws DataException
 * @throws IOException
 */
public static void save(String queryResultID,IDocArchiveWriter writer,ICubeQueryDefinition qd) throws DataException, IOException {
  DataOutputStream dos=null;
  try {
    RAOutputStream outputStream=writer.createRandomAccessStream(queryResultID + STREAM_FLAG);
    dos=new DataOutputStream(outputStream);
    IOUtil.writeString(dos,qd.getName());
    IOUtil.writeBool(dos,qd.cacheQueryResults());
    IOUtil.writeInt(dos,qd.getFilterOption());
    saveBindings(dos,qd.getBindings(),VersionManager.getLatestVersion());
    saveFilters(dos,qd.getFilters());
    saveSortDefns(dos,qd.getSorts());
    saveMeasures(dos,qd.getMeasures());
    saveComputedMeasures(dos,qd.getComputedMeasures());
    saveEdges(dos,qd);
    saveCubeOperations(dos,qd.getCubeOperations(),VersionManager.getLatestVersion());
    dos.flush();
    saveVersion(queryResultID,writer);
  }
  finally {
    if (dos != null) {
      dos.close();
    }
  }
}
Program: 66087
Project: 66087
Buggy source:
private static ICubeOperation loadCubeOperation(DataInputStream dis) throws DataException, IOException {
}

Fixed version (ground truth):
private static ICubeOperation loadCubeOperation(DataInputStream dis,int version) throws DataException, IOException {
}
Program: 66088
Project: 66088
Buggy source:
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,IDocArchiveReader reader) throws DataException, IOException {
  DataInputStream dis=null;
  try {
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd);
    loadFilters(dis,cqd);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadEdges(dis,cqd);
    loadCubeOperations(dis,cqd);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads   {@code CubeQueryDefinition} instance from report document
 * @param queryResultID
 * @param reader
 * @return
 * @throws DataException
 * @throws IOException
 */
public static ICubeQueryDefinition load(String queryResultID,DataEngineContext context) throws DataException, IOException {
  DataInputStream dis=null;
  IDocArchiveReader reader=context.getDocReader();
  int version=0;
  try {
    if (reader.exists(queryResultID + "String_Node_Str")) {
      RAInputStream inputStream=reader.getStream(queryResultID + "String_Node_Str");
      DataInputStream stream=new DataInputStream(inputStream);
      version=IOUtil.readInt(stream);
    }
    RAInputStream inputStream=reader.getStream(queryResultID + STREAM_FLAG);
    dis=new DataInputStream(inputStream);
    String name=IOUtil.readString(dis);
    ICubeQueryDefinition cqd=new CubeQueryDefinition(name);
    cqd.setCacheQueryResults(IOUtil.readBool(dis));
    cqd.setFilterOption(IOUtil.readInt(dis));
    loadBindings(dis,cqd,version);
    loadFilters(dis,cqd);
    loadSortDefns(dis,cqd);
    loadMeasures(dis,cqd);
    loadComputedMeasures(dis,cqd);
    loadEdges(dis,cqd);
    loadCubeOperations(dis,cqd,version);
    return cqd;
  }
  finally {
    if (dis != null) {
      dis.close();
    }
  }
}
Program: 66089
Project: 66089
Buggy source:
private static void saveBindings(DataOutputStream dos,List<IBinding> bindings) throws DataException, IOException {
  if (writeSize(dos,bindings) > 0) {
    for (    IBinding b : bindings) {
      BindingIOUtil.saveBinding(dos,b);
    }
  }
}

Fixed version (ground truth):
private static void saveBindings(DataOutputStream dos,List<IBinding> bindings,int version) throws DataException, IOException {
  if (writeSize(dos,bindings) > 0) {
    for (    IBinding b : bindings) {
      BindingIOUtil.saveBinding(dos,b,version);
    }
  }
}
Program: 66090
Project: 66090
Buggy source:
private static void loadBindings(DataInputStream dis,ICubeQueryDefinition qd) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IBinding b=BindingIOUtil.loadBinding(dis);
    qd.addBinding(b);
  }
}

Fixed version (ground truth):
private static void loadBindings(DataInputStream dis,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    IBinding b=BindingIOUtil.loadBinding(dis,version);
    qd.addBinding(b);
  }
}
Program: 66091
Project: 66091
Buggy source:
private static void loadCubeOperations(DataInputStream dis,ICubeQueryDefinition qd) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    ICubeOperation co=loadCubeOperation(dis);
    qd.addCubeOperation(co);
  }
}

Fixed version (ground truth):
private static void loadCubeOperations(DataInputStream dis,ICubeQueryDefinition qd,int version) throws DataException, IOException {
  int size=IOUtil.readInt(dis);
  for (int i=0; i < size; i++) {
    ICubeOperation co=loadCubeOperation(dis,version);
    qd.addCubeOperation(co);
  }
}
Program: 66092
Project: 66092
Buggy source:
private static void saveCubeOperations(DataOutputStream dos,ICubeOperation[] cos) throws DataException, IOException {
  if (writeSize(dos,cos) > 0) {
    for (    ICubeOperation co : cos) {
      saveCubeOperation(dos,co);
    }
  }
}

Fixed version (ground truth):
private static void saveCubeOperations(DataOutputStream dos,ICubeOperation[] cos,int version) throws DataException, IOException {
  if (writeSize(dos,cos) > 0) {
    for (    ICubeOperation co : cos) {
      saveCubeOperation(dos,co,version);
    }
  }
}
Program: 66093
Project: 66093
Buggy source:
private static void saveCubeOperation(DataOutputStream dos,ICubeOperation co) throws DataException, IOException {
  if (co == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  if (co instanceof AddingNestAggregations) {
    IOUtil.writeInt(dos,CUBE_OPERATION_FLAG_ADDING_NEST_AGGRS);
    saveBindings(dos,Arrays.asList(co.getNewBindings()));
  }
}

Fixed version (ground truth):
private static void saveCubeOperation(DataOutputStream dos,ICubeOperation co,int version) throws DataException, IOException {
  if (co == null) {
    IOUtil.writeBool(dos,false);
    return;
  }
  IOUtil.writeBool(dos,true);
  if (co instanceof AddingNestAggregations) {
    IOUtil.writeInt(dos,CUBE_OPERATION_FLAG_ADDING_NEST_AGGRS);
    saveBindings(dos,Arrays.asList(co.getNewBindings()),version);
  }
}
Program: 66095
Project: 66095
Buggy source:
public void initDialog(){
  cmbType.setItems(dataTypes);
  txtDisplayName.setFocus();
  if (isAggregate()) {
    initFunction();
    initFilter();
{
      initAggOn();
    }
  }
  if (isTimePeriod()) {
    initTimeDimension();
    initReferenceDate();
    initCalculationTypeCombo(getTimeDimsionName());
  }
  if (getBinding() == null) {
    setTypeSelect(dataTypes[0]);
    if (isTimePeriod()) {
      this.newBinding=StructureFactory.newComputedColumn(getBindingHolder(),DEFAULT_TIMEPERIOD_NAME);
    }
 else {
      this.newBinding=StructureFactory.newComputedColumn(getBindingHolder(),isAggregate() ? DEFAULT_AGGREGATION_NAME : DEFAULT_ITEM_NAME);
    }
    setName(this.newBinding.getName());
  }
 else {
    setName(getBinding().getName());
    setDisplayName(getBinding().getDisplayName());
    setDisplayNameID(getBinding().getDisplayNameID());
    if (getBinding().getDataType() != null)     if (DATA_TYPE_CHOICE_SET.findChoice(getBinding().getDataType()) != null)     setTypeSelect(DATA_TYPE_CHOICE_SET.findChoice(getBinding().getDataType()).getDisplayName());
 else     cmbType.setText("String_Node_Str");
    if (getBinding().getExpression() != null)     setDataFieldExpression(getBinding());
  }
  if (this.getBinding() != null) {
    this.txtName.setEnabled(false);
  }
  validate();
  hasInitDialog=true;
  composite.getShell().pack();
}

Fixed version (ground truth):
public void initDialog(){
  cmbType.setItems(dataTypes);
  txtDisplayName.setFocus();
  if (isAggregate()) {
    initFunction();
    initFilter();
{
      initAggOn();
    }
  }
  if (isTimePeriod()) {
    initTimeDimension();
    initReferenceDate();
    initCalculationTypeCombo(getTimeDimsionName());
  }
  if (getBinding() == null) {
    if (cmbType.getSelectionIndex() < 0) {
      setTypeSelect(dataTypes[0]);
    }
    if (isTimePeriod()) {
      this.newBinding=StructureFactory.newComputedColumn(getBindingHolder(),DEFAULT_TIMEPERIOD_NAME);
    }
 else {
      this.newBinding=StructureFactory.newComputedColumn(getBindingHolder(),isAggregate() ? DEFAULT_AGGREGATION_NAME : DEFAULT_ITEM_NAME);
    }
    setName(this.newBinding.getName());
  }
 else {
    setName(getBinding().getName());
    setDisplayName(getBinding().getDisplayName());
    setDisplayNameID(getBinding().getDisplayNameID());
    if (getBinding().getDataType() != null)     if (DATA_TYPE_CHOICE_SET.findChoice(getBinding().getDataType()) != null)     setTypeSelect(DATA_TYPE_CHOICE_SET.findChoice(getBinding().getDataType()).getDisplayName());
 else     cmbType.setText("String_Node_Str");
    if (getBinding().getExpression() != null)     setDataFieldExpression(getBinding());
  }
  if (this.getBinding() != null) {
    this.txtName.setEnabled(false);
  }
  validate();
  hasInitDialog=true;
  composite.getShell().pack();
}
Program: 66096
Project: 66096
Buggy source:
/** 
 * This method revise property values according to limit of different chart types.
 * @param eObj
 * @param eRefObj
 */
protected void revise(Chart eObj,Chart eRefObj){
  if (hasStockSeries(eObj)) {
    ((ChartWithAxes)eObj).unsetOrientation();
  }
  if (eObj != null) {
    if (eObj instanceof ChartWithAxes && eObj.getDimension() != ChartDimension.THREE_DIMENSIONAL_LITERAL) {
      rotateAxesTitle((ChartWithAxes)eObj);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method revise property values according to limit of different chart types.
 * @param eObj
 * @param eRefObj
 */
protected void revise(Chart eObj,Chart eRefObj){
  boolean[] hasSeries=hasSpecificSeries(eObj);
  if (hasSeries[0]) {
    ((ChartWithAxes)eObj).unsetOrientation();
  }
  if (hasSeries[1]) {
    ((ChartWithAxes)eObj).setOrientation(Orientation.HORIZONTAL_LITERAL);
  }
  if (eObj != null) {
    if (eObj instanceof ChartWithAxes && eObj.getDimension() != ChartDimension.THREE_DIMENSIONAL_LITERAL) {
      rotateAxesTitle((ChartWithAxes)eObj);
    }
  }
}
Program: 66098
Project: 66098
Buggy source:
public void handleEvent(Event event){
  if (event.widget.equals(txtTitle)) {
    getChart().getTitle().getLabel().getCaption().setValue(txtTitle.getText());
  }
 else   if (event.widget.equals(fdcFont)) {
    if (event.type == FontDefinitionComposite.FONT_CHANTED_EVENT) {
      getChart().getTitle().getLabel().getCaption().setFont((FontDefinition)((Object[])event.data)[0]);
      getChart().getTitle().getLabel().getCaption().setColor((ColorDefinition)((Object[])event.data)[1]);
    }
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (event.widget.equals(txtTitle)) {
    if (txtTitle.getText() == null || txtTitle.getText().trim().length() == 0) {
      getChart().getTitle().getLabel().getCaption().setValue(null);
    }
 else {
      getChart().getTitle().getLabel().getCaption().setValue(txtTitle.getText());
    }
  }
 else   if (event.widget.equals(fdcFont)) {
    if (event.type == FontDefinitionComposite.FONT_CHANTED_EVENT) {
      getChart().getTitle().getLabel().getCaption().setFont((FontDefinition)((Object[])event.data)[0]);
      getChart().getTitle().getLabel().getCaption().setColor((ColorDefinition)((Object[])event.data)[1]);
    }
  }
}
Program: 66101
Project: 66101
Buggy source:
public void widgetSelected(SelectionEvent event){
  if (event.widget == btnAuto) {
    if (btnAuto.getSelection()) {
      updateInsetsButtons(false);
      if (defaultInsets != null) {
        insets.unsetTop();
        insets.unsetBottom();
        insets.unsetLeft();
        insets.unsetRight();
        try {
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getTop());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getBottom());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getLeft());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getRight());
        }
 catch (        ChartException e) {
          ChartWizard.displayException(e);
        }
      }
    }
 else {
      updateInsetsButtons(true);
      insets.setTop(txtTop.getValue());
      insets.setLeft(txtLeft.getValue());
      insets.setRight(txtRight.getValue());
      insets.setBottom(txtBottom.getValue());
    }
    updateInsetsData(insets);
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent event){
  if (event.widget == btnAuto) {
    if (btnAuto.getSelection()) {
      updateInsetsButtons(false);
      if (defaultInsets != null) {
        insets.unsetTop();
        insets.unsetBottom();
        insets.unsetLeft();
        insets.unsetRight();
        try {
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getTop());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getBottom());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getLeft());
          ChartElementUtil.setDefaultValue(insets,"String_Node_Str",defaultInsets.getRight());
        }
 catch (        ChartException e) {
          ChartWizard.displayException(e);
        }
      }
    }
 else {
      updateInsetsButtons(true);
      insets.setTop(txtTop.getValue());
      insets.setLeft(txtLeft.getValue());
      insets.setRight(txtRight.getValue());
      insets.setBottom(txtBottom.getValue());
    }
    setModifyListener(false);
    updateInsetsData(insets);
    setModifyListener(true);
  }
}
Program: 66102
Project: 66102
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (getChart() instanceof ChartWithoutAxes) {
    if (e.widget == cmbMinSlice) {
      if (cmbMinSlice.getSelectionIndex() == 0) {
        ((ChartWithoutAxes)getChart()).unsetMinSlicePercent();
      }
 else {
        ((ChartWithoutAxes)getChart()).setMinSlicePercent(cmbMinSlice.getSelectionIndex() == 1);
      }
      updateUIState();
    }
 else     if (e.widget == btnTxtMinSliceAuto) {
      if (btnTxtMinSliceAuto.getSelection()) {
        ((ChartWithoutAxes)getChart()).unsetMinSlice();
      }
 else {
        ((ChartWithoutAxes)getChart()).setMinSlice(txtMinSlice.getValue());
      }
      txtMinSlice.setValue(((ChartWithoutAxes)getChart()).getMinSlice());
      updateUIState();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (getChart() instanceof ChartWithoutAxes) {
    if (e.widget == cmbMinSlice) {
      if (cmbMinSlice.getSelectionIndex() == 0) {
        ((ChartWithoutAxes)getChart()).unsetMinSlicePercent();
      }
 else {
        ((ChartWithoutAxes)getChart()).setMinSlicePercent(cmbMinSlice.getSelectionIndex() == 1);
      }
      updateUIState();
    }
 else     if (e.widget == btnTxtMinSliceAuto) {
      if (btnTxtMinSliceAuto.getSelection()) {
        ((ChartWithoutAxes)getChart()).unsetMinSlice();
      }
 else {
        ((ChartWithoutAxes)getChart()).setMinSlice(txtMinSlice.getValue());
      }
      txtMinSlice.removeModifyListener(this);
      txtMinSlice.setValue(((ChartWithoutAxes)getChart()).getMinSlice());
      txtMinSlice.addModifyListener(this);
      updateUIState();
    }
  }
}
Program: 66104
Project: 66104
Buggy source:
/** 
 * Note: Manually written
 */
protected void initialize(){
  setVersion(VERSION);
  block=BlockImpl.create();
  TitleBlock tb=(TitleBlock)TitleBlockImpl.create();
  Plot pl=(Plot)PlotImpl.create();
  Legend lg=(Legend)LegendImpl.create();
  block.add(tb);
  block.add(pl);
  block.add(lg);
  Text txtChartTitle=tb.getLabel().getCaption();
  txtChartTitle.setValue(Messages.getString("String_Node_Str"));
  txtChartTitle.getFont().setSize(16);
  txtChartTitle.getFont().setBold(true);
  TextAlignment taTitle=TextAlignmentImpl.create();
  taTitle.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL);
  taTitle.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
  txtChartTitle.getFont().setAlignment(taTitle);
  setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
  setSeriesThickness(10);
  setInteractivity(InteractivityImpl.create());
  setEmptyMessage(newEmptyMessage());
  ChartModelHelper.instance().updateExtendedProperties(getExtendedProperties());
}

Fixed version (ground truth):
/** 
 * Note: Manually written
 */
protected void initialize(){
  setVersion(VERSION);
  block=BlockImpl.create();
  TitleBlock tb=(TitleBlock)TitleBlockImpl.create();
  Plot pl=(Plot)PlotImpl.create();
  Legend lg=(Legend)LegendImpl.create();
  block.add(tb);
  block.add(pl);
  block.add(lg);
  Text txtChartTitle=tb.getLabel().getCaption();
  txtChartTitle.setValue(Messages.getString("String_Node_Str"));
  txtChartTitle.getFont().setSize(16);
  txtChartTitle.getFont().setBold(true);
  TextAlignment taTitle=TextAlignmentImpl.create();
  taTitle.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL);
  taTitle.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
  txtChartTitle.getFont().setAlignment(taTitle);
  setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
  setSeriesThickness(10);
  setInteractivity(InteractivityImpl.create());
  setEmptyMessage(newEmptyMessage());
  ChartModelHelper.instance().updateExtendedProperties(getExtendedProperties());
  units="String_Node_Str";
}
Program: 66105
Project: 66105
Buggy source:
/** 
 * @param parent
 * @param style
 * @param numberRows specify row number. Valid number is 1,2,4.
 * @param insets
 * @param sUnits
 * @param serviceprovider
 */
public InsetsComposite(Composite parent,int style,int numberRows,Insets insets,String sUnits,IUIServiceProvider serviceprovider){
  super(parent,style);
  this.numberRows=numberRows;
  this.insets=insets;
  this.sUnits=sUnits;
  this.serviceprovider=serviceprovider;
  init();
  placeComponents();
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param style
 * @param numberRows specify row number. Valid number is 1,2,4.
 * @param insets
 * @param sUnits
 * @param serviceprovider
 * @param context
 */
public InsetsComposite(Composite parent,int style,int numberRows,Insets insets,String sUnits,IUIServiceProvider serviceprovider,ChartWizardContext context){
  super(parent,style);
  this.numberRows=numberRows;
  this.insets=insets;
  this.sUnits=sUnits;
  this.serviceprovider=serviceprovider;
  this.context=context;
  if (this.sUnits == null) {
    this.sUnits=ChartDefaultValueUtil.getDefaultUnits(this.context.getModel());
  }
  init();
  placeComponents();
}
Program: 66107
Project: 66107
Buggy source:
protected Composite getComponent(Composite parent){
  cmpContent=new Composite(parent,SWT.NONE);
{
    GridLayout glContent=new GridLayout();
    cmpContent.setLayout(glContent);
  }
  ic=new InsetsComposite(cmpContent,SWT.NONE,getBlockForProcessing().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider());
  GridData gdInsets=new GridData(GridData.FILL_HORIZONTAL);
  gdInsets.widthHint=300;
  ic.setLayoutData(gdInsets);
  ic.setDefaultInsetsValue(DefaultValueProvider.defChartWithAxes().getBlock().getInsets());
  grpOutline=new Group(cmpContent,SWT.NONE);
  GridData gdGRPOutline=new GridData(GridData.FILL_HORIZONTAL);
  grpOutline.setLayoutData(gdGRPOutline);
  grpOutline.setLayout(new FillLayout());
  grpOutline.setText(Messages.getString("String_Node_Str"));
  liacOutline=new LineAttributesComposite(grpOutline,SWT.NONE,getOutlineAttributesStyle(),getContext(),getBlockForProcessing().getOutline());
  liacOutline.addListener(this);
  return cmpContent;
}

Fixed version (ground truth):
protected Composite getComponent(Composite parent){
  cmpContent=new Composite(parent,SWT.NONE);
{
    GridLayout glContent=new GridLayout();
    cmpContent.setLayout(glContent);
  }
  ic=new InsetsComposite(cmpContent,SWT.NONE,getBlockForProcessing().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider(),getContext());
  GridData gdInsets=new GridData(GridData.FILL_HORIZONTAL);
  gdInsets.widthHint=300;
  ic.setLayoutData(gdInsets);
  ic.setDefaultInsetsValue(DefaultValueProvider.defChartWithAxes().getBlock().getInsets());
  grpOutline=new Group(cmpContent,SWT.NONE);
  GridData gdGRPOutline=new GridData(GridData.FILL_HORIZONTAL);
  grpOutline.setLayoutData(gdGRPOutline);
  grpOutline.setLayout(new FillLayout());
  grpOutline.setText(Messages.getString("String_Node_Str"));
  liacOutline=new LineAttributesComposite(grpOutline,SWT.NONE,getOutlineAttributesStyle(),getContext(),getBlockForProcessing().getOutline());
  liacOutline.addListener(this);
  return cmpContent;
}
Program: 66110
Project: 66110
Buggy source:
private void populateLists(){
  NameSet ns=LiteralHelper.unitsOfMeasurementSet;
  cmbUnits.setItems(ChartUIExtensionUtil.getItemsWithAuto(ns.getDisplayNames()));
  String str=getChart().getUnits();
  if (str != null && str.trim().length() != 0) {
    cmbUnits.setText(ns.getDisplayNameByName(str));
  }
 else {
    cmbUnits.select(0);
  }
  this.sOldUnits=ns.getNameByDisplayName(cmbUnits.getText());
  lblSeriesThickness.setText(new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{LiteralHelper.unitsOfMeasurementSet.getDisplayNameByName(getChart().getUnits())}));
}

Fixed version (ground truth):
private void populateLists(){
  NameSet ns=LiteralHelper.unitsOfMeasurementSet;
  cmbUnits.setItems(ChartUIExtensionUtil.getItemsWithAuto(ns.getDisplayNames()));
  String str=getUnits();
  if (str != null && str.trim().length() != 0) {
    cmbUnits.setText(ns.getDisplayNameByName(str));
  }
 else {
    cmbUnits.select(0);
  }
  this.sOldUnits=ns.getNameByDisplayName(cmbUnits.getText());
  lblSeriesThickness.setText(new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{LiteralHelper.unitsOfMeasurementSet.getDisplayNameByName(getUnits())}));
}
Program: 66111
Project: 66111
Buggy source:
protected void getComponentLegendRightArea(Composite cmpLegRight){
  Group grpOutline=new Group(cmpLegRight,SWT.NONE);
{
    GridData gdGRPOutline=new GridData(GridData.FILL_HORIZONTAL);
    grpOutline.setLayoutData(gdGRPOutline);
    grpOutline.setLayout(new FillLayout());
    grpOutline.setText(Messages.getString("String_Node_Str"));
  }
  boolean bEnableUI=getBlockForProcessing().isVisible();
  int lineOptions=LineAttributesComposite.ENABLE_VISIBILITY | LineAttributesComposite.ENABLE_STYLES | LineAttributesComposite.ENABLE_WIDTH| LineAttributesComposite.ENABLE_COLOR| LineAttributesComposite.ENABLE_AUTO_COLOR;
  outlineLegend=new LineAttributesComposite(grpOutline,SWT.NONE,lineOptions,getContext(),getBlockForProcessing().getOutline());
{
    outlineLegend.addListener(this);
    outlineLegend.setAttributesEnabled(bEnableUI);
  }
  icLegend=new InsetsComposite(cmpLegRight,SWT.NONE,getBlockForProcessing().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider());
{
    GridData gdICBlock=new GridData(GridData.FILL_HORIZONTAL);
    icLegend.setLayoutData(gdICBlock);
    icLegend.addListener(this);
    icLegend.setEnabled(bEnableUI);
    icLegend.setDefaultInsetsValue(DefaultValueProvider.defLegend().getInsets());
  }
}

Fixed version (ground truth):
protected void getComponentLegendRightArea(Composite cmpLegRight){
  Group grpOutline=new Group(cmpLegRight,SWT.NONE);
{
    GridData gdGRPOutline=new GridData(GridData.FILL_HORIZONTAL);
    grpOutline.setLayoutData(gdGRPOutline);
    grpOutline.setLayout(new FillLayout());
    grpOutline.setText(Messages.getString("String_Node_Str"));
  }
  boolean bEnableUI=getBlockForProcessing().isVisible();
  int lineOptions=LineAttributesComposite.ENABLE_VISIBILITY | LineAttributesComposite.ENABLE_STYLES | LineAttributesComposite.ENABLE_WIDTH| LineAttributesComposite.ENABLE_COLOR| LineAttributesComposite.ENABLE_AUTO_COLOR;
  outlineLegend=new LineAttributesComposite(grpOutline,SWT.NONE,lineOptions,getContext(),getBlockForProcessing().getOutline());
{
    outlineLegend.addListener(this);
    outlineLegend.setAttributesEnabled(bEnableUI);
  }
  icLegend=new InsetsComposite(cmpLegRight,SWT.NONE,getBlockForProcessing().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider(),getContext());
{
    GridData gdICBlock=new GridData(GridData.FILL_HORIZONTAL);
    icLegend.setLayoutData(gdICBlock);
    icLegend.addListener(this);
    icLegend.setEnabled(bEnableUI);
    icLegend.setDefaultInsetsValue(DefaultValueProvider.defLegend().getInsets());
  }
}
Program: 66116
Project: 66116
Buggy source:
protected void createInsets(Composite cmpRight,boolean bEnableUI){
  icInsets=new InsetsComposite(cmpRight,SWT.NONE,getSeriesForProcessing().getLabel().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider());
{
    GridData gdICInsets=new GridData(GridData.FILL_HORIZONTAL);
    gdICInsets.grabExcessVerticalSpace=false;
    icInsets.setLayoutData(gdICInsets);
    icInsets.addListener(this);
    icInsets.setDefaultInsetsValue(DefaultValueProvider.defSeries().getLabel().getInsets());
    icInsets.setEnabled(bEnableUI);
  }
}

Fixed version (ground truth):
protected void createInsets(Composite cmpRight,boolean bEnableUI){
  icInsets=new InsetsComposite(cmpRight,SWT.NONE,getSeriesForProcessing().getLabel().getInsets(),getChart().getUnits(),getContext().getUIServiceProvider(),getContext());
{
    GridData gdICInsets=new GridData(GridData.FILL_HORIZONTAL);
    gdICInsets.grabExcessVerticalSpace=false;
    icInsets.setLayoutData(gdICInsets);
    icInsets.addListener(this);
    icInsets.setDefaultInsetsValue(DefaultValueProvider.defSeries().getLabel().getInsets());
    icInsets.setEnabled(bEnableUI);
  }
}
Program: 66120
Project: 66120
Buggy source:
protected Bounds getInnerRectangle(ArcRenderEvent are){
  Bounds rctInner;
  double innerRadius=are.getInnerRadius();
  if (innerRadius > 0) {
    if (innerRadius < 1d) {
      rctInner=BoundsImpl.create(are.getTopLeft().getX() + (are.getWidth() * (1 - are.getInnerRadius()) / 2),are.getTopLeft().getY() + (are.getHeight() * (1 - are.getInnerRadius()) / 2),are.getInnerRadius() * are.getWidth(),are.getInnerRadius() * are.getHeight());
    }
 else {
      double radio=are.getHeight() / are.getWidth();
      rctInner=BoundsImpl.create(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius() * radio) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius() * radio);
    }
  }
 else {
    rctInner=BoundsImpl.create(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius()) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius());
  }
  return rctInner;
}

Fixed version (ground truth):
protected Bounds getInnerRectangle(ArcRenderEvent are){
  Bounds rctInner;
  if (are.getInnerRadius() > 0) {
    double radio=are.getHeight() / are.getWidth();
    rctInner=BoundsImpl.create(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius() * radio) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius() * radio);
  }
 else {
    rctInner=BoundsImpl.create(are.getTopLeft().getX() + (are.getWidth() - 2 * are.getInnerRadius()) / 2,are.getTopLeft().getY() + (are.getHeight() - 2 * are.getInnerRadius()) / 2,2 * are.getInnerRadius(),2 * are.getInnerRadius());
  }
  return rctInner;
}
Program: 66121
Project: 66121
Buggy source:
protected Bounds getInnerRectangle(ArcRenderEvent are,double dTranslateX,double dTranslateY,double dScale,Bounds bo){
  Bounds rctInner;
  if (are.getInnerRadius() > 0) {
    if (are.getInnerRadius() < 1d) {
      rctInner=goFactory.createBounds(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getInnerRadius() * bo.getWidth() / 2d)) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getInnerRadius() * bo.getHeight() / 2)) * dScale),(are.getInnerRadius() * bo.getWidth() * dScale),(are.getInnerRadius() * bo.getHeight() * dScale));
    }
 else {
      double radio=bo.getHeight() / bo.getWidth();
      rctInner=goFactory.createBounds(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getInnerRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getInnerRadius() * radio)) * dScale),(2 * are.getInnerRadius() * dScale),(2 * are.getInnerRadius() * dScale) * radio);
    }
  }
 else {
    rctInner=goFactory.createBounds(((bo.getLeft() + dTranslateX + bo.getWidth() / 2d) * dScale),((bo.getTop() + dTranslateY + bo.getHeight() / 2d) * dScale),0,0);
  }
  return rctInner;
}

Fixed version (ground truth):
protected Bounds getInnerRectangle(ArcRenderEvent are,double dTranslateX,double dTranslateY,double dScale,Bounds bo){
  Bounds rctInner;
  if (are.getInnerRadius() > 0) {
    double radio=bo.getHeight() / bo.getWidth();
    rctInner=goFactory.createBounds(((bo.getLeft() + dTranslateX + (bo.getWidth() / 2d - are.getInnerRadius())) * dScale),((bo.getTop() + dTranslateY + (bo.getHeight() / 2d - are.getInnerRadius() * radio)) * dScale),(2 * are.getInnerRadius() * dScale),(2 * are.getInnerRadius() * dScale) * radio);
  }
 else {
    rctInner=goFactory.createBounds(((bo.getLeft() + dTranslateX + bo.getWidth() / 2d) * dScale),((bo.getTop() + dTranslateY + bo.getHeight() / 2d) * dScale),0,0);
  }
  return rctInner;
}
Program: 66123
Project: 66123
Buggy source:
public Tool createTool(){
  return new ReportCreationTool(factory,null){
    protected void performCreation(    int button){
      DNDService.getInstance().performDrop("String_Node_Str",getTargetEditPart(),DND.DROP_DEFAULT,new DNDLocation(getLocation()));
    }
    public void performCreation(    EditPart editPart){
      DNDService.getInstance().performDrop("String_Node_Str",editPart,DND.DROP_DEFAULT,new DNDLocation(getLocation()));
    }
    protected boolean handleMove(){
      updateTargetUnderMouse();
      boolean canMove=DNDService.getInstance().validDrop(getTemplate(),getTargetEditPart(),DND.DROP_DEFAULT,new DNDLocation(getLocation()));
      if (canMove) {
        updateTargetRequest();
        setCurrentCommand(getCommand());
        showTargetFeedback();
      }
 else {
        setCurrentCommand(null);
      }
      return canMove;
    }
  }
;
}

Fixed version (ground truth):
public Tool createTool(){
  return new ReportCreationTool(factory,null){
    protected void performCreation(    int button){
      DNDService.getInstance().performDrop(getTemplate(),getTargetEditPart(),DND.DROP_DEFAULT,new DNDLocation(getLocation()));
    }
    public void performCreation(    EditPart editPart){
      DNDService.getInstance().performDrop(getTemplate(),editPart,DND.DROP_DEFAULT,new DNDLocation(getLocation()));
    }
    protected boolean handleMove(){
      updateTargetUnderMouse();
      boolean canMove=DNDService.getInstance().validDrop(getTemplate(),getTargetEditPart(),DND.DROP_DEFAULT,new DNDLocation(getLocation()));
      if (canMove) {
        updateTargetRequest();
        setCurrentCommand(getCommand());
        showTargetFeedback();
      }
 else {
        setCurrentCommand(null);
      }
      return canMove;
    }
  }
;
}
Program: 66124
Project: 66124
Buggy source:
public void performCreation(EditPart editPart){
  DNDService.getInstance().performDrop("String_Node_Str",editPart,DND.DROP_DEFAULT,new DNDLocation(getLocation()));
}

Fixed version (ground truth):
public void performCreation(EditPart editPart){
  DNDService.getInstance().performDrop(getTemplate(),editPart,DND.DROP_DEFAULT,new DNDLocation(getLocation()));
}
Program: 66128
Project: 66128
Buggy source:
/** 
 * Returns the visible char count before the ellipsis, 0 if no ellipsis is used. e.g. if the text is "abcd..." then 4 will be returned. if the text is "abcdefg" then 0 will be returned.
 * @return
 */
public int getVisibleCharCount(){
  return iVisChar;
}

Fixed version (ground truth):
/** 
 * Returns the visible char count before the ellipsis, 0 if no ellipsis is used. e.g. if the text is "abcd..." then 4 will be returned. if the text is "abcdefg" then 0 will be returned.
 * @return count of visible chars.
 */
public int getVisibleCharCount(){
  return iVisChar;
}
Program: 66129
Project: 66129
Buggy source:
/** 
 * A convenience method provided to create a Text instance
 * @param sValue
 */
public static final Text createDefault(String sValue){
  final Text tx=AttributeFactory.eINSTANCE.createText();
  ((TextImpl)tx).initDefault();
  if (sValue == null) {
    sValue=IConstants.UNDEFINED_STRING;
  }
  tx.setValue(sValue);
  return tx;
}

Fixed version (ground truth):
/** 
 * A convenience method provided to create a Text instance
 * @param sValue
 */
public static final Text createDefault(String sValue){
  final Text tx=AttributeFactory.eINSTANCE.createText();
  ((TextImpl)tx).initDefault();
  tx.setValue(sValue);
  return tx;
}
Program: 66130
Project: 66130
Buggy source:
/** 
 * @return
 */
public static final Dial create(){
  final Dial dl=ComponentFactory.eINSTANCE.createDial();
  ((DialImpl)dl).initialize();
  return dl;
}

Fixed version (ground truth):
/** 
 * @return dial instance with setting 'isSet' flag.
 */
public static final Dial create(){
  final Dial dl=ComponentFactory.eINSTANCE.createDial();
  ((DialImpl)dl).initialize();
  return dl;
}
Program: 66131
Project: 66131
Buggy source:
/** 
 * @return
 */
public static final Dial createDefault(){
  final Dial dl=ComponentFactory.eINSTANCE.createDial();
  ((DialImpl)dl).initDefault();
  return dl;
}

Fixed version (ground truth):
/** 
 * @return dial instance without setting 'isSet' flag.
 */
public static final Dial createDefault(){
  final Dial dl=ComponentFactory.eINSTANCE.createDial();
  ((DialImpl)dl).initDefault();
  return dl;
}
Program: 66132
Project: 66132
Buggy source:
/** 
 * A convenience method to create an initialized 'Label' instance
 * @return
 */
public static final Label create(){
  final Label la=ComponentFactory.eINSTANCE.createLabel();
  ((LabelImpl)la).initialize();
  return la;
}

Fixed version (ground truth):
/** 
 * A convenience method to create an initialized 'Label' instance
 * @return label instance with setting 'isSet' flag.
 */
public static final Label create(){
  final Label la=ComponentFactory.eINSTANCE.createLabel();
  ((LabelImpl)la).initialize();
  return la;
}
Program: 66133
Project: 66133
Buggy source:
/** 
 * A convenience method to create an initialized 'Label' instance
 * @return
 */
public static final Label createDefault(boolean visible){
  final Label la=ComponentFactory.eINSTANCE.createLabel();
  ((LabelImpl)la).initDefault(visible);
  return la;
}

Fixed version (ground truth):
/** 
 * A convenience method to create an initialized 'Label' instance
 * @return label instance without setting 'isSet' flag.
 */
public static final Label createDefault(boolean visible){
  final Label la=ComponentFactory.eINSTANCE.createLabel();
  ((LabelImpl)la).initDefault(visible);
  return la;
}
Program: 66134
Project: 66134
Buggy source:
/** 
 * A convenient method to get an instance copy. This is much faster than the ECoreUtil.copy(). Note this method only copies those working properties of the label. e.g. which could affect renderer. This is different with the copyInstance() method, which copis all attribuetes.
 * @param src
 * @return
 */
public static Label copyCompactInstance(Label src){
  if (src == null) {
    return null;
  }
  LabelImpl lb=new LabelImpl();
  lb.visible=src.isVisible();
  lb.visibleESet=src.isSetVisible();
  if (src.getBackground() != null) {
    lb.background=FillUtil.copyOf(src.getBackground());
  }
  lb.caption=src.getCaption().copyInstance();
  lb.insets=src.getInsets().copyInstance();
  if (src.getOutline() != null && src.getOutline().isVisible()) {
    lb.outline=src.getOutline().copyInstance();
  }
  if (ChartUtil.isShadowDefined(src)) {
    lb.shadowColor=src.getShadowColor().copyInstance();
  }
  return lb;
}

Fixed version (ground truth):
/** 
 * A convenient method to get an instance copy. This is much faster than the ECoreUtil.copy(). Note this method only copies those working properties of the label. e.g. which could affect renderer. This is different with the copyInstance() method, which copies all attributes.
 * @param src
 * @return new label instance.
 */
public static Label copyCompactInstance(Label src){
  if (src == null) {
    return null;
  }
  LabelImpl lb=new LabelImpl();
  lb.visible=src.isVisible();
  lb.visibleESet=src.isSetVisible();
  if (src.getBackground() != null) {
    lb.background=FillUtil.copyOf(src.getBackground());
  }
  lb.caption=src.getCaption().copyInstance();
  lb.insets=src.getInsets().copyInstance();
  if (src.getOutline() != null && src.getOutline().isVisible()) {
    lb.outline=src.getOutline().copyInstance();
  }
  if (ChartUtil.isShadowDefined(src)) {
    lb.shadowColor=src.getShadowColor().copyInstance();
  }
  return lb;
}