nus-yam/ex-repair huggingface dataset:
Program: 71910
Project: 71910
Buggy source:
/** 
 * Returns the group breaks of specified group level. <code>null</code> means no group breaks.
 * @param groupExp
 * @return group breaks
 */
public int[] getGroupBreaks(int groupLevel);

Fixed version (ground truth):
/** 
 * Returns the group breaks of specified group level. <code>null</code> means no group breaks.
 * @param groupExp
 * @return group breaks
 */
int[] getGroupBreaks(int groupLevel);
Program: 71912
Project: 71912
Buggy source:
public int[] getGroupBreaks(int groupLevel){
  if (lstBreaks.size() <= 1) {
    if (bWithoutSub && iIndex > 0) {
      int[] breaks=new int[iIndex - 1];
      for (int i=0; i < breaks.length; i++) {
        breaks[i]=i + 1;
      }
      return breaks;
    }
    return new int[0];
  }
  int[] breaks=new int[lstBreaks.size() - 1];
  for (int i=0; i < breaks.length; i++) {
    breaks[i]=((Integer)lstBreaks.get(i)).intValue();
  }
  return breaks;
}

Fixed version (ground truth):
public int[] getGroupBreaks(int groupLevel){
  if (lstBreaks.size() <= 1) {
    if (bWithoutSub && iIndex > 0) {
      int[] breaks=new int[iIndex - 1];
      for (int i=0; i < breaks.length; i++) {
        breaks[i]=i + 1;
      }
      return breaks;
    }
    return new int[0];
  }
  int[] breaks=new int[lstBreaks.size() - 1];
  for (int i=0; i < breaks.length; i++) {
    breaks[i]=lstBreaks.get(i);
  }
  return breaks;
}
Program: 71913
Project: 71913
Buggy source:
protected void initCubeCursor() throws OLAPException, BirtException {
  if (cubeCursor == null) {
    if (rs != null) {
      cubeCursor=(ICubeCursor)rs.getCubeCursor();
    }
 else {
      cubeCursor=qr.getCubeCursor();
    }
    List edges=cubeCursor.getOrdinateEdge();
    if (edges.size() == 0) {
      throw new ChartException(ChartReportItemPlugin.ID,ChartException.DATA_BINDING,Messages.getString("String_Node_Str"));
    }
 else     if (edges.size() == 1) {
      this.mainEdgeCursor=(EdgeCursor)edges.get(0);
      this.subEdgeCursor=null;
    }
 else {
      this.mainEdgeCursor=(EdgeCursor)edges.get(0);
      this.subEdgeCursor=(EdgeCursor)edges.get(1);
      ;
    }
  }
}

Fixed version (ground truth):
protected void initCubeCursor() throws OLAPException, BirtException {
  if (cubeCursor == null) {
    if (rs != null) {
      cubeCursor=(ICubeCursor)rs.getCubeCursor();
    }
 else {
      cubeCursor=qr.getCubeCursor();
    }
    List<EdgeCursor> edges=cubeCursor.getOrdinateEdge();
    if (edges.size() == 0) {
      throw new ChartException(ChartReportItemPlugin.ID,ChartException.DATA_BINDING,Messages.getString("String_Node_Str"));
    }
 else     if (edges.size() == 1) {
      this.mainEdgeCursor=edges.get(0);
      this.subEdgeCursor=null;
    }
 else {
      this.mainEdgeCursor=edges.get(0);
      this.subEdgeCursor=edges.get(1);
      ;
    }
  }
}
Program: 71914
Project: 71914
Buggy source:
/** 
 * Returns format code according to format type and current locale
 */
public String getFormatCode(){
  String formatCode=null;
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getDateTimeInstance(com.ibm.icu.text.DateFormat.LONG,com.ibm.icu.text.DateFormat.LONG,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.LONG,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.MEDIUM,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.SHORT,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.LONG,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=(SimpleDateFormat)SimpleDateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.MEDIUM,locale);
    formatCode=dateFormat.toPattern();
  }
  if (formatPattern.equals("String_Node_Str")) {
    SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str",locale);
    formatCode=dateFormat.toPattern();
  }
  if (UNFORMATTED.equals(formatPattern) || DATETIME_UNFORMATTED.equals(formatPattern) || DATE_UNFORMATTED.equals(formatPattern)|| TIME_UNFORMATTED.equals(formatPattern)) {
    formatCode="String_Node_Str";
  }
  return formatCode;
}

Fixed version (ground truth):
/** 
 * Returns format code according to format type and current locale
 */
public String getFormatCode(){
  if (UNFORMATTED.equals(formatPattern) || DATETIME_UNFORMATTED.equals(formatPattern) || DATE_UNFORMATTED.equals(formatPattern)|| TIME_UNFORMATTED.equals(formatPattern)) {
    return "String_Node_Str";
  }
  SimpleDateFormat dateFormat=getFormatter();
  return dateFormat.toPattern();
}
Program: 71915
Project: 71915
Buggy source:
protected AbstractParseState versionConditionalJumpTo(){
  if (element instanceof OdaDataSource) {
    if (PRIVATE_DRIVER_PROPERTIES_PROP == nameValue || PUBLIC_DRIVER_PROPERTIES_PROP == nameValue) {
      if (handler.isVersion(VersionUtil.VERSION_0)) {
        CompatibleOdaDriverPropertyStructureListState state=new CompatibleOdaDriverPropertyStructureListState(handler,element);
        state.setName(name);
        return state;
      }
    }
  }
 else   if (handler.versionNumber < VersionUtil.VERSION_3_2_0 && BOUND_DATA_COLUMNS_PROP == nameValue && element instanceof ReportItem) {
    CompatibleBoundColumnState state=new CompatibleBoundColumnState(handler,element);
    state.setName(name);
    return state;
  }
  if (handler.versionNumber > VersionUtil.VERSION_3_0_0 && handler.versionNumber <= VersionUtil.VERSION_3_2_1 && ("String_Node_Str".equals(name)) && (element instanceof GroupElement)) {
    CompatibleGroupBoundColumnsState state=new CompatibleGroupBoundColumnsState(handler,element.getContainer(),(GroupElement)element);
    state.setName(name);
    return state;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_2_4 && element instanceof ScriptDataSet && RESULT_SET_PROP == nameValue) {
    CompatibleRenameListPropertyState state=new CompatibleRenameListPropertyState(handler,element,name);
    state.setName(IDataSetModel.RESULT_SET_HINTS_PROP);
    return state;
  }
  return super.versionConditionalJumpTo();
}

Fixed version (ground truth):
protected AbstractParseState versionConditionalJumpTo(){
  if (element instanceof OdaDataSource) {
    if (PRIVATE_DRIVER_PROPERTIES_PROP == nameValue || PUBLIC_DRIVER_PROPERTIES_PROP == nameValue) {
      if (handler.isVersion(VersionUtil.VERSION_0)) {
        CompatibleOdaDriverPropertyStructureListState state=new CompatibleOdaDriverPropertyStructureListState(handler,element);
        state.setName(name);
        return state;
      }
    }
  }
 else   if (handler.versionNumber < VersionUtil.VERSION_3_2_0 && BOUND_DATA_COLUMNS_PROP == nameValue && element instanceof ReportItem) {
    CompatibleBoundColumnState state=new CompatibleBoundColumnState(handler,element);
    state.setName(name);
    return state;
  }
  if (handler.versionNumber > VersionUtil.VERSION_3_0_0 && handler.versionNumber <= VersionUtil.VERSION_3_2_1 && ("String_Node_Str".equals(name)) && (element instanceof GroupElement)) {
    CompatibleGroupBoundColumnsState state=new CompatibleGroupBoundColumnsState(handler,element.getContainer(),(GroupElement)element);
    state.setName(name);
    return state;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_2_4 && element instanceof ScriptDataSet && RESULT_SET_PROP == nameValue && struct == null) {
    CompatibleRenameListPropertyState state=new CompatibleRenameListPropertyState(handler,element,name);
    state.setName(IDataSetModel.RESULT_SET_HINTS_PROP);
    return state;
  }
  return super.versionConditionalJumpTo();
}
Program: 71917
Project: 71917
Buggy source:
public void testImportExternalCssStyleSheet() throws Exception {
  designHandle.setBase(PLUGIN_PATH);
  CssStyleSheetHandle stylesheet=loadStyleSheet(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ fileName);
  assertNotNull(stylesheet);
  SharedStyleHandle style1=stylesheet.findStyle("String_Node_Str");
  SharedStyleHandle style2=stylesheet.findStyle("String_Node_Str");
  SharedStyleHandle style3=stylesheet.findStyle("String_Node_Str");
  assertNotNull(style1);
  assertNull(style2);
  assertNotNull(style3);
  ArrayList styleList=new ArrayList();
  styleList.add(0,style1);
  styleList.add(1,style3);
  assertEquals(2,styleList.size());
  designHandle.importCssStyles(stylesheet,styleList);
  assertEquals(2,designHandle.getStyles().getCount());
}

Fixed version (ground truth):
public void testImportExternalCssStyleSheet() throws Exception {
  designHandle.setBase(PLUGIN_PATH);
  CssStyleSheetHandle stylesheet=loadStyleSheet(getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ fileName);
  assertNotNull(stylesheet);
  SharedStyleHandle style1=stylesheet.findStyle("String_Node_Str");
  SharedStyleHandle style2=stylesheet.findStyle("String_Node_Str");
  SharedStyleHandle style3=stylesheet.findStyle("String_Node_Str");
  assertNotNull(style1);
  assertNull(style2);
  assertNotNull(style3);
  ArrayList styleList=new ArrayList();
  styleList.add(0,style1);
  styleList.add(1,style3);
  assertEquals(2,styleList.size());
  designHandle.importCssStyles(stylesheet,styleList);
  assertEquals(4,designHandle.getStyles().getCount());
}
Program: 71918
Project: 71918
Buggy source:
public void test_regression_162718() throws Exception {
  createDesign();
  ElementFactory factory=designHandle.getElementFactory();
  TableGroupHandle group=factory.newTableGroup();
  group.setPageBreakAfter(DesignChoiceConstants.PAGE_BREAK_AFTER_AVOID);
  assertEquals(DesignChoiceConstants.PAGE_BREAK_AFTER_AVOID,group.getPageBreakAfter());
  group.setPageBreakBefore(DesignChoiceConstants.PAGE_BREAK_BEFORE_ALWAYS);
  assertEquals(DesignChoiceConstants.PAGE_BREAK_BEFORE_ALWAYS,group.getPageBreakBefore());
  group.setPageBreakInside(DesignChoiceConstants.PAGE_BREAK_INSIDE_AVOID);
  assertEquals(DesignChoiceConstants.PAGE_BREAK_INSIDE_AVOID,group.getPageBreakInside());
}

Fixed version (ground truth):
public void test_regression_162718() throws Exception {
}
Program: 71919
Project: 71919
Buggy source:
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
  }
  if (files == null || files.isEmpty()) {
    return;
  }
  SelectionDialog dialog=new MoveResourceDialog();
  if (dialog.open() == Window.OK) {
    Object[] selected=dialog.getResult();
    if (selected != null && selected.length == 1) {
      ResourceEntry entry=(ResourceEntry)selected[0];
      IPath targetPath=null;
      try {
        targetPath=new Path(convertToFile(entry.getURL()).getAbsolutePath());
      }
 catch (      IOException e) {
        ExceptionHandler.handle(e);
      }
      for (      File file : files) {
        File srcFile=file;
        File targetFile=targetPath.append(file.getName()).toFile();
        if (targetFile.exists()) {
          if (!MessageDialog.openQuestion(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
            return;
          }
          try {
            new ProgressMonitorDialog(getShell()).run(true,true,createDeleteRunnable(Arrays.asList(new File[]{targetFile})));
          }
 catch (          InvocationTargetException e) {
            ExceptionHandler.handle(e);
          }
catch (          InterruptedException e) {
            ExceptionHandler.handle(e);
          }
        }
        if (srcFile.renameTo(targetFile)) {
          fireResourceChanged(targetFile.getAbsolutePath());
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
  }
  if (files == null || files.isEmpty()) {
    return;
  }
  SelectionDialog dialog=new MoveResourceDialog();
  if (dialog.open() == Window.OK) {
    Object[] selected=dialog.getResult();
    if (selected != null && selected.length == 1) {
      ResourceEntry entry=(ResourceEntry)selected[0];
      IPath targetPath=null;
      try {
        targetPath=new Path(convertToFile(entry.getURL()).getAbsolutePath());
      }
 catch (      IOException e) {
        ExceptionHandler.handle(e);
      }
      for (      File file : files) {
        File srcFile=file;
        File targetFile=targetPath.append(file.getName()).toFile();
        if (targetFile.exists()) {
          if (!MessageDialog.openQuestion(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
            return;
          }
          try {
            new ProgressMonitorDialog(getShell()).run(true,true,createDeleteRunnable(Arrays.asList(new File[]{targetFile})));
          }
 catch (          InvocationTargetException e) {
            ExceptionHandler.handle(e);
          }
catch (          InterruptedException e) {
            ExceptionHandler.handle(e);
          }
        }
        if (srcFile.renameTo(targetFile)) {
          fireResourceChanged(targetFile.getAbsolutePath());
          refreshWorkspace(srcFile.getAbsolutePath());
        }
      }
    }
  }
}
Program: 71920
Project: 71920
Buggy source:
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
    return;
  }
  if (files == null || files.size() != 1) {
    return;
  }
  File file=files.iterator().next();
  String newName=queryNewResourceName(file);
  if (newName == null || newName.length() <= 0) {
    return;
  }
  File newFile=new Path(file.getAbsolutePath()).removeLastSegments(1).append(newName).toFile();
  if (file.renameTo(newFile)) {
    fireResourceChanged(newFile.getAbsolutePath());
  }
}

Fixed version (ground truth):
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
    return;
  }
  if (files == null || files.size() != 1) {
    return;
  }
  File file=files.iterator().next();
  String newName=queryNewResourceName(file);
  if (newName == null || newName.length() <= 0) {
    return;
  }
  File newFile=new Path(file.getAbsolutePath()).removeLastSegments(1).append(newName).toFile();
  if (file.renameTo(newFile)) {
    fireResourceChanged(newFile.getAbsolutePath());
    refreshWorkspace(file.getAbsolutePath());
  }
}
Program: 71921
Project: 71921
Buggy source:
/** 
 * Notifies model for the reource chang.
 * @param fileName the resource's file name.
 */
protected void fireResourceChanged(String fileName){
  SessionHandleAdapter.getInstance().getSessionHandle().fireResourceChange(new LibraryChangeEvent(fileName));
}

Fixed version (ground truth):
/** 
 * Notifies model for the reource chang.
 * @param fileName the resource's file name.
 */
protected void fireResourceChanged(String fileName){
  SessionHandleAdapter.getInstance().getSessionHandle().fireResourceChange(new LibraryChangeEvent(fileName));
  refreshWorkspace(fileName);
}
Program: 71922
Project: 71922
Buggy source:
private Time getTime(int hour,int minute,int second){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.set(Calendar.HOUR_OF_DAY,hour);
  calendar.set(Calendar.MINUTE,minute);
  calendar.set(Calendar.SECOND,second);
  return new java.sql.Time(calendar.getTimeInMillis());
}

Fixed version (ground truth):
private Time getTime(int hour,int minute,int second,int millis){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.set(Calendar.HOUR_OF_DAY,hour);
  calendar.set(Calendar.MINUTE,minute);
  calendar.set(Calendar.SECOND,second);
  return new java.sql.Time(calendar.getTimeInMillis());
}
Program: 71923
Project: 71923
Buggy source:
public void testToSqlTime() throws BirtException {
  Time temp=getTime(11,11,25);
  Time time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  temp=getTime(18,11,25);
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time,temp);
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time,temp);
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
}

Fixed version (ground truth):
public void testToSqlTime() throws BirtException {
  Time temp=getTime(11,11,25,0);
  Time time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  temp=getTime(18,11,25,0);
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  temp=getTime(18,11,25,12);
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time.toString(),temp.toString());
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time,temp);
  time=DataTypeUtil.toSqlTime("String_Node_Str");
  assertEquals(time,temp);
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
  failSqlTimeString("String_Node_Str");
}
Program: 71924
Project: 71924
Buggy source:
/** 
 */
public void testCompare(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,false,false,false,false,false,true,true,false,false,false,true,false,true,true,false,false,true,false,true,false,true,true,false,true,false,true,true,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}

Fixed version (ground truth):
/** 
 */
public void testCompare(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,true,false,false,false,false,false,true,true,false,false,false,true,false,true,true,false,false,true,false,true,false,true,true,false,true,false,true,true,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}
Program: 71925
Project: 71925
Buggy source:
/** 
 * @param date
 * @return
 */
private static java.sql.Time toSqlTime(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.YEAR,1970);
  calendar.set(Calendar.MONTH,0);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  calendar.set(Calendar.MILLISECOND,0);
  return new java.sql.Time(calendar.getTimeInMillis());
}

Fixed version (ground truth):
/** 
 * @param date
 * @return
 */
private static java.sql.Time toSqlTime(Date date){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(date.getTime());
  calendar.set(Calendar.YEAR,1970);
  calendar.set(Calendar.MONTH,0);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  return new java.sql.Time(calendar.getTimeInMillis());
}
Program: 71926
Project: 71926
Buggy source:
protected Object initialValue(){
  HashMap value=new HashMap();
  String[] dateFormatPattern={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  SimpleDateFormat simpleDateFormatter=null;
  PatternKey patterKey=null;
  for (int i=0; i < dateFormatPattern.length; i++) {
    patterKey=PatternKey.getPatterKey(dateFormatPattern[i]);
    simpleDateFormatter=new SimpleDateFormat(dateFormatPattern[i]);
    simpleDateFormatter.setLenient(false);
    value.put(patterKey,simpleDateFormatter);
  }
  return value;
}

Fixed version (ground truth):
protected Object initialValue(){
  HashMap value=new HashMap();
  String[] dateFormatPattern={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  SimpleDateFormat simpleDateFormatter=null;
  PatternKey patterKey=null;
  for (int i=0; i < dateFormatPattern.length; i++) {
    patterKey=PatternKey.getPatterKey(dateFormatPattern[i]);
    simpleDateFormatter=new SimpleDateFormat(dateFormatPattern[i]);
    simpleDateFormatter.setLenient(false);
    value.put(patterKey,simpleDateFormatter);
  }
  return value;
}
Program: 71927
Project: 71927
Buggy source:
private boolean isDeprecatedEntry(Map.Entry entry){
  Object key=entry.getKey();
  if (EngineConstants.APPCONTEXT_CLASSLOADER_KEY.equals(key) || EngineConstants.WEBAPP_CLASSPATH_KEY.equals(key) || EngineConstants.PROJECT_CLASSPATH_KEY.equals(key)|| EngineConstants.WORKSPACE_CLASSPATH_KEY.equals(key)) {
    log.log(Level.WARNING,key + "String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isDeprecatedEntry(Map.Entry entry){
  Object key=entry.getKey();
  if (EngineConstants.APPCONTEXT_CLASSLOADER_KEY.equals(key) || EngineConstants.WEBAPP_CLASSPATH_KEY.equals(key) || EngineConstants.PROJECT_CLASSPATH_KEY.equals(key)|| EngineConstants.WORKSPACE_CLASSPATH_KEY.equals(key)) {
    if (entry.getValue() != getAppContext().get(key)) {
      log.log(Level.WARNING,key + "String_Node_Str");
      return true;
    }
  }
  return false;
}
Program: 71928
Project: 71928
Buggy source:
/** 
 * This map stores font name - Font pairs, used to quickly lookup a Font of a predefined font.
 */
public static Font getFont(String family,int size,int style){
  Font font=null;
  if (size < 0) {
    size=0;
  }
  String key=family + Integer.toString(size) + Integer.toString(style);
  if (JFaceResources.getFontRegistry().hasValueFor(key)) {
    font=JFaceResources.getFontRegistry().get(key);
  }
 else {
    JFaceResources.getFontRegistry().put(key,new FontData[]{new FontData(family,size,style)});
    font=JFaceResources.getFontRegistry().get(key);
  }
  return font;
}

Fixed version (ground truth):
/** 
 * Gets font by FontData, the font will be cached and disposed automatically.
 */
public static Font getFont(FontData fd){
  if (fd == null) {
    return null;
  }
  Font font=null;
  String key=fd.toString();
  if (JFaceResources.getFontRegistry().hasValueFor(key)) {
    font=JFaceResources.getFontRegistry().get(key);
  }
 else {
    JFaceResources.getFontRegistry().put(key,new FontData[]{fd});
    font=JFaceResources.getFontRegistry().get(key);
  }
  return font;
}
Program: 71929
Project: 71929
Buggy source:
/** 
 * Sets the background and foreground color when the  Column is  deselected.
 */
public void setDeselectedColors(){
  this.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
  this.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
}

Fixed version (ground truth):
/** 
 * Sets the background and foreground color when the Column is deselected.
 */
public void setDeselectedColors(){
  this.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
  this.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
}
Program: 71930
Project: 71930
Buggy source:
/** 
 * Sets the background and foreground color when the  Column is selected.
 */
public void setSelectedColors(){
  this.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
  this.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION));
}

Fixed version (ground truth):
/** 
 * Sets the background and foreground color when the Column is selected.
 */
public void setSelectedColors(){
  this.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
  this.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION));
}
Program: 71934
Project: 71934
Buggy source:
/** 
 * Initializes the list. Sets the list data.
 */
private void initList(){
  list.setFont(new Font(Display.getCurrent(),"String_Node_Str",8,SWT.NORMAL));
  for (Iterator itor=contents.iterator(); itor.hasNext(); ) {
    IElementDefn defn=(IElementDefn)itor.next();
    list.add(defn.getDisplayName());
  }
}

Fixed version (ground truth):
/** 
 * Initializes the list. Sets the list data.
 */
private void initList(){
  list.setFont(FontManager.getFont("String_Node_Str",8,SWT.NORMAL));
  for (Iterator itor=contents.iterator(); itor.hasNext(); ) {
    IElementDefn defn=(IElementDefn)itor.next();
    list.add(defn.getDisplayName());
  }
}
Program: 71936
Project: 71936
Buggy source:
/** 
 */
public void testCompare(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,true,false,false,false,false,false,true,true,false,false,false,true,false,true,true,false,false,true,false,true,false,true,true,false,true,false,true,true,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}

Fixed version (ground truth):
/** 
 */
public void testCompare(){
  String[] script=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] result=new boolean[]{true,true,true,true,true,false,true,true,false,false,false,false,false,true,true,false,false,false,true,false,true,true,false,false,true,false,true,false,true,true,false,true,false,true,true,true,false,true};
  for (int i=0; i < script.length; i++) {
    assertTrue(((Boolean)cx.evaluateString(scope,script[i],"String_Node_Str",1,null)).booleanValue() == result[i]);
  }
}
Program: 71938
Project: 71938
Buggy source:
/** 
 * Create <code>IFilterCondition</code>
 * @return instance
 */
public static IFilterCondition createFilterCondition(){
  FilterCondition c=new FilterCondition();
  IFilterCondition condition=new FilterConditionImpl(c);
  return condition;
}

Fixed version (ground truth):
/** 
 * Create <code>IFilterCondition</code>
 * @return instance
 */
public static IFilterCondition createFilterCondition(){
  return ScriptAPIFactory.getInstance().createFilterCondition();
}
Program: 71939
Project: 71939
Buggy source:
/** 
 * Create <code>IHighLightRule</code>
 * @return instance
 */
public static IHighlightRule createHighLightRule(){
  HighlightRule h=new HighlightRule();
  IHighlightRule rule=new HighlightRuleImpl(h);
  return rule;
}

Fixed version (ground truth):
/** 
 * Create <code>IHighLightRule</code>
 * @return instance
 */
public static IHighlightRule createHighLightRule(){
  return ScriptAPIFactory.getInstance().createHighLightRule();
}
Program: 71940
Project: 71940
Buggy source:
/** 
 * Create <code>IHideRule</code> instance
 * @return IHideRule
 */
public static IHideRule createHideRule(){
  HideRule r=new HideRule();
  IHideRule rule=new HideRuleImpl(r);
  return rule;
}

Fixed version (ground truth):
/** 
 * Create <code>IHideRule</code> instance
 * @return IHideRule
 */
public static IHideRule createHideRule(){
  return ScriptAPIFactory.getInstance().createHideRule();
}
Program: 71941
Project: 71941
Buggy source:
/** 
 * Create <code>ISortCondition</code>
 * @return instance
 */
public static ISortCondition createSortCondition(){
  SortKey s=new SortKey();
  ISortCondition sort=new SortConditionImpl(s);
  return sort;
}

Fixed version (ground truth):
/** 
 * Create <code>ISortCondition</code>
 * @return instance
 */
public static ISortCondition createSortCondition(){
  return ScriptAPIFactory.getInstance().createSortCondition();
}
Program: 71942
Project: 71942
Buggy source:
/** 
 * Create <code>IDataBinding</code>
 * @return instance
 */
public static IDataBinding createDataBinding(){
  ComputedColumn c=new ComputedColumn();
  IDataBinding binding=new DataBindingImpl(c);
  return binding;
}

Fixed version (ground truth):
/** 
 * Create <code>IDataBinding</code>
 * @return instance
 */
public static IDataBinding createDataBinding(){
  return ScriptAPIFactory.getInstance().createDataBinding();
}
Program: 71943
Project: 71943
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  ScriptAPIFactory.initeTheFactory(new ScriptAPIBaseFactory());
}
Program: 71944
Project: 71944
Buggy source:
/** 
 * Write a list to an output stream
 * @param dos
 * @param dataMap
 * @throws IOException
 * @throws BirtException
 */
public final static void writeList(DataOutputStream dos,List list) throws IOException {
  if (list == null) {
    writeInt(dos,TYPE_NULL);
    return;
  }
 else {
    writeInt(dos,TYPE_MAP);
  }
  int size=list.size();
  writeInt(dos,size);
  if (size == 0)   return;
  for (int i=0; i < size; i++)   writeObject(dos,list.get(i));
}

Fixed version (ground truth):
/** 
 * Write a list to an output stream
 * @param dos
 * @param dataMap
 * @throws IOException
 * @throws BirtException
 */
public final static void writeList(DataOutputStream dos,List list) throws IOException {
  if (list == null) {
    writeInt(dos,TYPE_NULL);
    return;
  }
 else {
    writeInt(dos,TYPE_LIST);
  }
  int size=list.size();
  writeInt(dos,size);
  if (size == 0)   return;
  for (int i=0; i < size; i++)   writeObject(dos,list.get(i));
}
Program: 71945
Project: 71945
Buggy source:
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(String tempDir,String queryResultID,IPreparedQuery preparedQuery) throws DataException {
  Object[] params={tempDir,queryResultID};
  logger.entering(CachedQueryResults.class.getName(),"String_Node_Str",params);
  this.queryResultID=queryResultID;
  this.resultIterator=new CacheResultIterator(tempDir,this);
  this.pQuery=preparedQuery;
  logger.exiting(CachedQueryResults.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param context
 * @param queryResultID
 * @throws DataException
 */
public CachedQueryResults(DataEngineSession session,String queryResultID,IPreparedQuery preparedQuery) throws DataException {
  this.session=session;
  String tempDir=session.getTempDir();
  Object[] params={tempDir,queryResultID};
  logger.entering(CachedQueryResults.class.getName(),"String_Node_Str",params);
  this.queryResultID=queryResultID;
  this.resultIterator=new CacheResultIterator(tempDir,this);
  this.pQuery=preparedQuery;
  logger.exiting(CachedQueryResults.class.getName(),"String_Node_Str");
}
Program: 71946
Project: 71946
Buggy source:
public void close() throws BirtException {
  if (resultIterator != null)   resultIterator.close();
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (resultIterator != null)   resultIterator.close();
  NamingRelationUtil.merge(this.session,this.getPreparedQuery().getReportQueryDefn(),this);
}
Program: 71947
Project: 71947
Buggy source:
public IQueryResults getQueryResults(String queryResultID) throws DataException {
  if (context.getMode() == DataEngineContext.MODE_PRESENTATION || (context.getMode() == DataEngineContext.MODE_UPDATE && context.getDocWriter() == null)) {
    return new QueryResults(this.session.getTempDir(),this.context,queryResultID);
  }
  if (context.getMode() == DataEngineContext.MODE_GENERATION || context.getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    return new CachedQueryResults(session.getTempDir(),queryResultID,null);
  }
  return null;
}

Fixed version (ground truth):
public IQueryResults getQueryResults(String queryResultID) throws DataException {
  if (context.getMode() == DataEngineContext.MODE_PRESENTATION || (context.getMode() == DataEngineContext.MODE_UPDATE && context.getDocWriter() == null)) {
    return new QueryResults(this.session.getTempDir(),this.context,queryResultID);
  }
  if (context.getMode() == DataEngineContext.MODE_GENERATION || context.getMode() == DataEngineContext.DIRECT_PRESENTATION) {
    return new CachedQueryResults(session,queryResultID,null);
  }
  return null;
}
Program: 71948
Project: 71948
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  try {
    Context cx=Context.enter();
    if (this.scope == null) {
      this.scope=new ImporterTopLevel(cx);
    }
    new CoreJavaScriptInitializer().initialize(cx,scope);
  }
  finally {
    Context.exit();
  }
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
    }
  }
);
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  try {
    Context cx=Context.enter();
    if (this.scope == null) {
      this.scope=new ImporterTopLevel(cx);
    }
    new CoreJavaScriptInitializer().initialize(cx,scope);
  }
  finally {
    Context.exit();
  }
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 71949
Project: 71949
Buggy source:
public void dataEngineShutdown(){
  classLoaderHolder.set(null);
}

Fixed version (ground truth):
public void dataEngineShutdown(){
  if (session.getNamingRelation() == null) {
    return;
  }
  final int mode=session.getEngineContext().getMode();
  if (mode == DataEngineContext.MODE_GENERATION || mode == DataEngineContext.MODE_UPDATE) {
    try {
      saveNamingRelation(session.getNamingRelation());
    }
 catch (    DataException e1) {
      e1.printStackTrace();
    }
  }
}
Program: 71950
Project: 71950
Buggy source:
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (IPathEditorInputFactory.class.equals(adapterType)) {
    return new IPathEditorInputFactory(){
      public IEditorInput create(      IPath path){
        IFileStore fileStore=EFS.getLocalFileSystem().getStore(path);
        return new FileStoreEditorInput(fileStore);
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (IPathEditorInputFactory.class.equals(adapterType)) {
    return new IPathEditorInputFactory(){
      public IEditorInput create(      IPath path){
        return new PathEditorInput(path);
      }
    }
;
  }
  return null;
}
Program: 71951
Project: 71951
Buggy source:
public IEditorInput create(IPath path){
  IFileStore fileStore=EFS.getLocalFileSystem().getStore(path);
  return new FileStoreEditorInput(fileStore);
}

Fixed version (ground truth):
public IEditorInput create(IPath path){
  return new PathEditorInput(path);
}
Program: 71952
Project: 71952
Buggy source:
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
  }
  if (files == null || files.isEmpty()) {
    return;
  }
  SelectionDialog dialog=new MoveResourceDialog();
  if (dialog.open() == Window.OK) {
    Object[] selected=dialog.getResult();
    if (selected != null && selected.length == 1) {
      ResourceEntry entry=(ResourceEntry)selected[0];
      IPath targetPath=null;
      try {
        targetPath=new Path(convertToFile(entry.getURL()).getAbsolutePath());
      }
 catch (      IOException e) {
        ExceptionHandler.handle(e);
      }
      for (      File file : files) {
        File srcFile=file;
        File targetFile=targetPath.append(file.getName()).toFile();
        if (targetFile.exists()) {
          if (!MessageDialog.openQuestion(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"))) {
            return;
          }
          try {
            new ProgressMonitorDialog(getShell()).run(true,true,createDeleteRunnable(Arrays.asList(new File[]{targetFile})));
          }
 catch (          InvocationTargetException e) {
            ExceptionHandler.handle(e);
          }
catch (          InterruptedException e) {
            ExceptionHandler.handle(e);
          }
        }
        if (srcFile.renameTo(targetFile)) {
          fireResourceChanged(targetFile.getAbsolutePath());
          refreshWorkspace(srcFile.getAbsolutePath());
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
  }
  if (files == null || files.isEmpty()) {
    return;
  }
  SelectionDialog dialog=new MoveResourceDialog();
  if (dialog.open() == Window.OK) {
    Object[] selected=dialog.getResult();
    if (selected != null && selected.length == 1) {
      try {
        ResourceEntry entry=(ResourceEntry)selected[0];
        IPath targetPath=new Path(convertToFile(entry.getURL()).getAbsolutePath());
        for (        File file : files) {
          moveFile(file,targetPath.append(file.getName()).toFile());
        }
      }
 catch (      IOException e) {
        ExceptionHandler.handle(e);
      }
catch (      InvocationTargetException e) {
        ExceptionHandler.handle(e);
      }
catch (      InterruptedException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
}
Program: 71953
Project: 71953
Buggy source:
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
    return;
  }
  if (files == null || files.size() != 1) {
    return;
  }
  File file=files.iterator().next();
  String newName=queryNewResourceName(file);
  if (newName == null || newName.length() <= 0) {
    return;
  }
  File newFile=new Path(file.getAbsolutePath()).removeLastSegments(1).append(newName).toFile();
  if (file.renameTo(newFile)) {
    fireResourceChanged(newFile.getAbsolutePath());
    refreshWorkspace(file.getAbsolutePath());
  }
}

Fixed version (ground truth):
@Override public void run(){
  Collection<File> files=null;
  try {
    files=getSelectedFiles();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
    return;
  }
  if (files == null || files.size() != 1) {
    return;
  }
  File file=files.iterator().next();
  String newName=queryNewResourceName(file);
  if (newName == null || newName.length() <= 0) {
    return;
  }
  File newFile=new Path(file.getAbsolutePath()).removeLastSegments(1).append(newName).toFile();
  try {
    new ProgressMonitorDialog(getShell()).run(true,true,createRenameFileRunnable(file,newFile));
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.handle(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 71954
Project: 71954
Buggy source:
/** 
 * Refresh swt browser
 */
public void display(){
  if (browser != null) {
    String uri=getFileUri();
    if (uri != null && uri.length() > 0) {
      if (this.options == null) {
        this.options=new HashMap<String,String>();
        this.options.put(WebViewer.SERVLET_NAME_KEY,InputParameterHtmlDialog.VIEWER_RUN);
        this.options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
      }
      this.options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
      this.options.put(WebViewer.MAX_ROWS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
      this.options.put(WebViewer.MAX_CUBE_ROW_LEVELS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXCUBEROWLEVEL));
      this.options.put(WebViewer.MAX_CUBE_COLUMN_LEVELS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXCUBECOLUMNLEVEL));
      String extKey=ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.APPCONTEXT_EXTENSION_KEY);
      if (extKey != null && extKey.length() > 0)       this.options.put(WebViewer.APPCONTEXT_EXTENSION_KEY,extKey);
      WebViewer.display(uri,browser,this.options);
    }
  }
}

Fixed version (ground truth):
/** 
 * Refresh swt browser
 */
public void display(){
  if (browser != null && !browser.isDisposed()) {
    String uri=getFileUri();
    if (uri != null && uri.length() > 0) {
      if (this.options == null) {
        this.options=new HashMap<String,String>();
        this.options.put(WebViewer.SERVLET_NAME_KEY,InputParameterHtmlDialog.VIEWER_RUN);
        this.options.put(WebViewer.FORMAT_KEY,WebViewer.HTML);
      }
      this.options.put(WebViewer.RESOURCE_FOLDER_KEY,ReportPlugin.getDefault().getResourceFolder());
      this.options.put(WebViewer.MAX_ROWS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
      this.options.put(WebViewer.MAX_CUBE_ROW_LEVELS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXCUBEROWLEVEL));
      this.options.put(WebViewer.MAX_CUBE_COLUMN_LEVELS_KEY,ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXCUBECOLUMNLEVEL));
      String extKey=ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.APPCONTEXT_EXTENSION_KEY);
      if (extKey != null && extKey.length() > 0)       this.options.put(WebViewer.APPCONTEXT_EXTENSION_KEY,extKey);
      WebViewer.display(uri,browser,this.options);
    }
  }
}
Program: 71956
Project: 71956
Buggy source:
private String getFullPath(IPath path,IResource project){
  String curPath=path.toOSString();
  String directPath=project.getLocation().toOSString();
  int index=directPath.lastIndexOf(File.separator);
  String absPath=directPath.substring(0,index) + curPath;
  return absPath;
}

Fixed version (ground truth):
private String getFullPath(IPath path,IProject project){
  String directPath;
  try {
    directPath=project.getDescription().getLocationURI().toURL().getPath();
  }
 catch (  Exception e) {
    directPath=project.getLocation().toOSString();
  }
  String curPath=path.toOSString();
  int index=curPath.substring(1).indexOf(File.separator);
  String absPath=directPath + curPath.substring(index + 1);
  return absPath;
}
Program: 71958
Project: 71958
Buggy source:
public void createControl(Composite parent,Object input){
  setCategoryProvider(CubeCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
  createTabItems((List)input);
}

Fixed version (ground truth):
public void createControl(Composite parent,Object input){
  setCategoryProvider(CubeCategoryProviderFactory.getInstance().getCategoryProvider(input));
  super.createControl(parent,input);
}