nus-yam/ex-repair huggingface dataset:
Program: 66961
Project: 66961
Buggy source:
/** 
 * This function should only called by the main application that starts BIRT. It will add a new log handler to the global BIRT logger.
 * @param logger - the user defined logger.
 * @param directoryName - the directory name of the log file (e.g. C:\Log). The final file name will be the directory name plus an unique file name. For example, if the directory name is C:\Log, the log file name will be something like C:\Log\ReportEngine_2005_02_26_11_26_56.log
 * @param logLevel - the log level to be set. If logLevel is null, it will be ignored.
 * @param rollingSize
 * @param maxBackupIndex
 */
public static void startEngineLogging(Logger logger,String directoryName,String fileName,Level logLevel,int rollingSize,int maxBackupIndex){
  if (logger != null) {
    if (!isValidLogger(logger)) {
      logger.log(Level.WARNING,"String_Node_Str");
    }
 else {
      AdapterHandler adapter=getAdapterHandler();
      adapter.setUserLogger(logger);
    }
  }
  if (directoryName != null || fileName != null) {
    logFileName=generateUniqueLogFileName(directoryName,fileName);
    logRollingSize=rollingSize;
    logMaxBackupIndex=maxBackupIndex;
    if (logLevel != Level.OFF) {
      Handler fileHandler=createFileLogger(logFileName,logRollingSize,logMaxBackupIndex);
      if (fileHandler != null) {
        AdapterHandler adapter=getAdapterHandler();
        adapter.setUserLogger(logger);
      }
    }
  }
  ROOT_LOGGER.setLevel(logLevel);
}

Fixed version (ground truth):
/** 
 * This function should only called by the main application that starts BIRT. It will add a new log handler to the global BIRT logger.
 * @param logger - the user defined logger.
 * @param directoryName - the directory name of the log file (e.g. C:\Log). The final file name will be the directory name plus an unique file name. For example, if the directory name is C:\Log, the log file name will be something like C:\Log\ReportEngine_2005_02_26_11_26_56.log
 * @param logLevel - the log level to be set. If logLevel is null, it will be ignored.
 * @param rollingSize
 * @param maxBackupIndex
 */
public static void startEngineLogging(Logger logger,String directoryName,String fileName,Level logLevel,int rollingSize,int maxBackupIndex){
  if (logger != null) {
    if (!isValidLogger(logger)) {
      logger.log(Level.WARNING,"String_Node_Str");
    }
 else {
      AdapterHandler adapter=getAdapterHandler();
      adapter.setUserLogger(logger);
    }
  }
  if (directoryName != null || fileName != null) {
    logFileName=generateUniqueLogFileName(directoryName,fileName);
    logRollingSize=rollingSize;
    logMaxBackupIndex=maxBackupIndex;
    if (logLevel != Level.OFF) {
      FileHandler fileHandler=createFileLogger(logFileName,logRollingSize,logMaxBackupIndex);
      if (fileHandler != null) {
        AdapterHandler adapter=getAdapterHandler();
        adapter.setFileHandler(fileHandler);
      }
    }
  }
  ROOT_LOGGER.setLevel(logLevel);
}
Program: 66962
Project: 66962
Buggy source:
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null || expr.getStringExpression() == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setConstant(true);
    jsExpr.setConstantValue(expr.getExpression());
    return jsExpr;
  }
 else   jsExpr=new ExpressionAdapter(expr,el);
  return jsExpr;
}

Fixed version (ground truth):
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setConstant(true);
    jsExpr.setConstantValue(expr.getExpression());
    return jsExpr;
  }
 else {
    if (expr.getStringExpression() == null)     return null;
    jsExpr=new ExpressionAdapter(expr,el);
  }
  return jsExpr;
}
Program: 66963
Project: 66963
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    context.endInline();
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
    width=Math.min(width,context.getCurrentWidth());
    wordWriter.startTable(foreign.getComputedStyle(),width);
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    if (!"String_Node_Str".equalsIgnoreCase(foreign.getComputedStyle().getDisplay())) {
      adjustInline();
      inlineBrother=false;
    }
 else {
      context.endInline();
    }
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
    width=Math.min(width,context.getCurrentWidth());
    wordWriter.startTable(foreign.getComputedStyle(),width);
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}
Program: 66964
Project: 66964
Buggy source:
private String removeQuotes(String fontName){
  if (ptnWrappingQuotes.matcher(fontName).matches()) {
    return fontName.substring(1,fontName.length());
  }
  return fontName;
}

Fixed version (ground truth):
private String removeQuotes(String fontName){
  if (ptnWrappingQuotes.matcher(fontName).matches()) {
    return fontName.substring(1,fontName.length() - 1);
  }
  return fontName;
}
Program: 66965
Project: 66965
Buggy source:
public IAggregationResultSet[] execute(IAggregationResultSet[] rs,BirtCubeView view,CubeQueryExecutorHelper cubeQueryExecutorHelper) throws IOException, DataException {
  ICubeQueryDefinition query=view.getCubeQueryDefinition();
  IEdgeDefinition columnEdge=query.getEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IEdgeDefinition rowEdge=query.getEdge(ICubeQueryDefinition.ROW_EDGE);
  IMirroredDefinition columnMirror=null, rowMirror=null;
  if (columnEdge != null)   columnMirror=columnEdge.getMirroredDefinition();
  if (rowEdge != null)   rowMirror=rowEdge.getMirroredDefinition();
  int index=0;
  if (columnEdge != null) {
    if (columnMirror != null) {
      rs[index]=new MirroredAggregationResultSet(rs[index],new MirrorMetaInfo(columnMirror,columnEdge,view),cubeQueryExecutorHelper.getColumnSort());
    }
    index++;
  }
  if (rowMirror != null) {
    rs[index]=new MirroredAggregationResultSet(rs[index],new MirrorMetaInfo(rowMirror,rowEdge,view),cubeQueryExecutorHelper.getRowSort());
  }
  if (rowMirror != null || columnMirror != null) {
    boolean hasAggregationSort=false;
    List sort=cubeQueryExecutorHelper.getColumnSort();
    for (int i=0; i < sort.size(); i++) {
      if (sort.get(i) instanceof AggrSortDefinition && ((AggrSortDefinition)sort.get(i)).getAxisQualifierLevel().length > 0) {
        hasAggregationSort=true;
        break;
      }
    }
    if (!hasAggregationSort) {
      sort=cubeQueryExecutorHelper.getRowSort();
      for (int i=0; i < sort.size(); i++) {
        if (sort.get(i) instanceof AggrSortDefinition && ((AggrSortDefinition)sort.get(i)).getAxisQualifierLevel().length > 0) {
          hasAggregationSort=true;
          break;
        }
      }
    }
    if (hasAggregationSort) {
      for (int i=0; i < rs.length; i++) {
        if (rs[i].getAggregationCount() == 0) {
          rs[i]=sortAggregationResultSet(rs[i]);
        }
      }
      cubeQueryExecutorHelper.applyAggrSort(rs);
    }
  }
  return rs;
}

Fixed version (ground truth):
public IAggregationResultSet[] execute(IAggregationResultSet[] rs,BirtCubeView view,CubeQueryExecutorHelper cubeQueryExecutorHelper) throws IOException, DataException {
  ICubeQueryDefinition query=view.getCubeQueryDefinition();
  IEdgeDefinition columnEdge=query.getEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IEdgeDefinition rowEdge=query.getEdge(ICubeQueryDefinition.ROW_EDGE);
  IMirroredDefinition columnMirror=null, rowMirror=null;
  if (columnEdge != null)   columnMirror=columnEdge.getMirroredDefinition();
  if (rowEdge != null)   rowMirror=rowEdge.getMirroredDefinition();
  int index=0;
  if (columnEdge != null) {
    if (columnMirror != null) {
      rs[index]=new MirroredAggregationResultSet(rs[index],new MirrorMetaInfo(columnMirror,columnEdge,view),cubeQueryExecutorHelper.getColumnSort());
    }
    index++;
  }
  if (rowMirror != null) {
    rs[index]=new MirroredAggregationResultSet(rs[index],new MirrorMetaInfo(rowMirror,rowEdge,view),cubeQueryExecutorHelper.getRowSort());
  }
  return rs;
}
Program: 66967
Project: 66967
Buggy source:
private IAggregationResultSet[] processOperationOnQuery(BirtCubeView view,StopSign stopSign,IAggregationResultSet[] rs,AggregationDefinition[] aggrDefns) throws DataException, IOException, BirtException {
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  DrillOperationExecutor drillOp=new DrillOperationExecutor();
  IAggregationResultSet[] baseRs=new IAggregationResultSet[aggrDefns.length];
  System.arraycopy(rs,0,baseRs,0,aggrDefns.length);
  IAggregationResultSet[] drillRs=new IAggregationResultSet[rs.length - aggrDefns.length];
  System.arraycopy(rs,aggrDefns.length,drillRs,0,drillRs.length);
  rs=drillOp.execute(baseRs,drillRs,view.getCubeQueryDefinition());
  CubeOperationsExecutor coe=new CubeOperationsExecutor(view.getCubeQueryDefinition(),view.getPreparedCubeOperations(),view.getCubeQueryExecutor().getScope(),view.getCubeQueryExecutor().getSession().getEngineContext().getScriptContext());
  rs=coe.execute(rs,stopSign);
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] processOperationOnQuery(BirtCubeView view,StopSign stopSign,IAggregationResultSet[] rs,AggregationDefinition[] aggrDefns) throws DataException, IOException, BirtException {
  DrillOperationExecutor drillOp=new DrillOperationExecutor();
  IAggregationResultSet[] baseRs=new IAggregationResultSet[aggrDefns.length];
  System.arraycopy(rs,0,baseRs,0,aggrDefns.length);
  IAggregationResultSet[] drillRs=new IAggregationResultSet[rs.length - aggrDefns.length];
  System.arraycopy(rs,aggrDefns.length,drillRs,0,drillRs.length);
  rs=drillOp.execute(baseRs,drillRs,view.getCubeQueryDefinition());
  CubeOperationsExecutor coe=new CubeOperationsExecutor(view.getCubeQueryDefinition(),view.getPreparedCubeOperations(),view.getCubeQueryExecutor().getScope(),view.getCubeQueryExecutor().getSession().getEngineContext().getScriptContext());
  rs=coe.execute(rs,stopSign);
  return rs;
}
Program: 66972
Project: 66972
Buggy source:
private void init() throws DataException {
  try {
    if (this.keys == null || this.indexs == null) {
      List keyList=new ArrayList();
      List<Set<Integer>> indexList=new ArrayList<Set<Integer>>();
      this.raIn.seek(offset);
      DataInputStream din=new DataInputStream(this.raIn);
      int size=IOUtil.readInt(this.raIn);
      for (int i=0; i < size; i++) {
        keyList.add(IOUtil.readObject(din));
        indexList.add(new HashSet(IOUtil.readList(din)));
      }
      this.keys=keyList;
      this.indexs=indexList;
    }
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
private void init() throws DataException {
  try {
    if (!initialized) {
synchronized (this) {
        if (!initialized) {
          List keyList=new ArrayList();
          List<Set<Integer>> indexList=new ArrayList<Set<Integer>>();
          this.raIn.seek(offset);
          DataInputStream din=new DataInputStream(this.raIn);
          int size=IOUtil.readInt(this.raIn);
          for (int i=0; i < size; i++) {
            keyList.add(IOUtil.readObject(din));
            indexList.add(new HashSet(IOUtil.readList(din)));
          }
          this.keys=keyList;
          this.indexs=indexList;
          this.initialized=true;
        }
      }
    }
  }
 catch (  Exception e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}
Program: 66973
Project: 66973
Buggy source:
public Seg(RAInputStream raIn,long offset){
  this.raIn=raIn;
  this.offset=offset;
}

Fixed version (ground truth):
public Seg(RAInputStream raIn,long offset){
  this.raIn=raIn;
  this.offset=offset;
  this.initialized=false;
}
Program: 66974
Project: 66974
Buggy source:
private String generateUniqueJSKey(Action ac){
  if (ac == null) {
    return "String_Node_Str";
  }
  if (ac instanceof MultipleActions) {
    List<Action> subActions=((MultipleActions)ac).getActions();
    if (subActions.size() <= 1) {
      return generateJSContent(subActions.get(0));
    }
    return MultiActionValuesScriptGenerator.getJSKey((MultipleActions)ac) + this.hashCode();
  }
 else   if (ac.getValue() instanceof MultiURLValues) {
    MultiURLValues values=(MultiURLValues)ac.getValue();
    if (values.getURLValues().size() <= 1) {
      return generateJSContent(ac);
    }
    return MultiActionValuesScriptGenerator.getJSKey(values) + this.hashCode();
  }
  return generateJSContent(ac);
}

Fixed version (ground truth):
private String generateUniqueJSKey(Action ac){
  if (ac == null) {
    return "String_Node_Str";
  }
  if (ac instanceof MultipleActions) {
    List<Action> subActions=((MultipleActions)ac).getActions();
    if (subActions.size() <= 1) {
      return generateJSContent(subActions.get(0));
    }
    return MultiActionValuesScriptGenerator.getJSKey((MultipleActions)ac,getULocale()) + this.hashCode();
  }
 else   if (ac.getValue() instanceof MultiURLValues) {
    MultiURLValues values=(MultiURLValues)ac.getValue();
    if (values.getURLValues().size() <= 1) {
      return generateJSContent(ac);
    }
    return MultiActionValuesScriptGenerator.getJSKey(values) + this.hashCode();
  }
  return generateJSContent(ac);
}
Program: 66976
Project: 66976
Buggy source:
private static StringBuilder getJSContext(MultipleActions actions){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  EMap<String,String> propMap=actions.getPropertiesMap();
  sb.append(getPropertiesJS(propMap).toString());
  int i=0;
  for (  Action subAction : getValidActions(actions)) {
    ActionValue av=subAction.getValue();
    if (av instanceof URLValue) {
      sb=getURLValueJS(sb,i,(URLValue)av,HTMLEncoderAdapter.getInstance());
    }
 else     if (av instanceof ScriptValue) {
      sb=getScriptValueJS(sb,i,(ScriptValue)av);
    }
    i++;
  }
  appendInteractivityVariables(sb);
  return sb;
}

Fixed version (ground truth):
private static StringBuilder getJSContext(MultipleActions actions,ULocale locale){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  EMap<String,String> propMap=actions.getPropertiesMap();
  sb.append(getPropertiesJS(propMap).toString());
  int i=0;
  for (  Action subAction : getValidActions(actions)) {
    ActionValue av=subAction.getValue();
    if (av instanceof URLValue) {
      sb=getURLValueJS(sb,i,(URLValue)av,HTMLEncoderAdapter.getInstance());
    }
 else     if (av instanceof ScriptValue) {
      sb=getScriptValueJS(sb,i,(ScriptValue)av,locale);
    }
    i++;
  }
  appendInteractivityVariables(sb);
  return sb;
}
Program: 66977
Project: 66977
Buggy source:
/** 
 * Check if the specified action contains redirection items.
 * @param action
 * @return
 * @since 2.5.2
 */
public static boolean containsRedirection(Action action){
  if (action instanceof MultipleActions) {
    return getValidActions((MultipleActions)action).size() > 0;
  }
 else   if (action.getType().getValue() == ActionType.URL_REDIRECT) {
    ActionValue av=action.getValue();
    if (av instanceof URLValue) {
      return isValidURLValue((URLValue)av);
    }
 else     if (av instanceof MultiURLValues) {
      return getValidURLValues((MultiURLValues)av).size() > 0;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the specified action contains redirection items.
 * @param action
 * @return boolean
 * @since 2.5.2
 */
public static boolean containsRedirection(Action action){
  if (action instanceof MultipleActions) {
    return getValidActions((MultipleActions)action).size() > 0;
  }
 else   if (action.getType().getValue() == ActionType.URL_REDIRECT) {
    ActionValue av=action.getValue();
    if (av instanceof URLValue) {
      return isValidURLValue((URLValue)av);
    }
 else     if (av instanceof MultiURLValues) {
      return getValidURLValues((MultiURLValues)av).size() > 0;
    }
  }
  return false;
}
Program: 66978
Project: 66978
Buggy source:
public static String getJSContent(MultipleActions actions){
  StringBuilder sb=getJSContext(actions);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public static String getJSContent(MultipleActions actions,ULocale locale){
  StringBuilder sb=getJSContext(actions,locale);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 66979
Project: 66979
Buggy source:
/** 
 * @param multiUrlValue
 * @return
 */
public static List<URLValue> getValidURLValues(MultiURLValues multiUrlValue){
  List<URLValue> validURLValues=new ArrayList<URLValue>();
  if (multiUrlValue == null) {
    return validURLValues;
  }
  for (  URLValue uv : multiUrlValue.getURLValues()) {
    if (!isValidURLValue(uv)) {
      continue;
    }
    validURLValues.add(uv);
  }
  return validURLValues;
}

Fixed version (ground truth):
/** 
 * @param multiUrlValue
 * @return list valid url values
 */
public static List<URLValue> getValidURLValues(MultiURLValues multiUrlValue){
  List<URLValue> validURLValues=new ArrayList<URLValue>();
  if (multiUrlValue == null) {
    return validURLValues;
  }
  for (  URLValue uv : multiUrlValue.getURLValues()) {
    if (!isValidURLValue(uv)) {
      continue;
    }
    validURLValues.add(uv);
  }
  return validURLValues;
}
Program: 66980
Project: 66980
Buggy source:
/** 
 * @param multiActions
 * @return
 */
public static List<Action> getValidActions(MultipleActions multiActions){
  List<Action> validActions=new ArrayList<Action>();
  if (multiActions == null) {
    return validActions;
  }
  for (  Action subAction : multiActions.getActions()) {
    ActionValue av=subAction.getValue();
    if (av instanceof URLValue) {
      URLValue uv=(URLValue)av;
      if (!isValidURLValue(uv)) {
        continue;
      }
    }
 else     if (av instanceof ScriptValue) {
      ScriptValue sv=(ScriptValue)av;
      if (!isValidScripts(sv)) {
        continue;
      }
    }
    validActions.add(subAction);
  }
  return validActions;
}

Fixed version (ground truth):
/** 
 * @param multiActions
 * @return list valid actions
 */
public static List<Action> getValidActions(MultipleActions multiActions){
  List<Action> validActions=new ArrayList<Action>();
  if (multiActions == null) {
    return validActions;
  }
  for (  Action subAction : multiActions.getActions()) {
    ActionValue av=subAction.getValue();
    if (av instanceof URLValue) {
      URLValue uv=(URLValue)av;
      if (!isValidURLValue(uv)) {
        continue;
      }
    }
 else     if (av instanceof ScriptValue) {
      ScriptValue sv=(ScriptValue)av;
      if (!isValidScripts(sv)) {
        continue;
      }
    }
    validActions.add(subAction);
  }
  return validActions;
}
Program: 66981
Project: 66981
Buggy source:
/** 
 * @param sv
 * @return
 */
public static StringBuilder getVisualJS(StringBuilder sb,int index,ActionValue av,String scriptActionType){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  String text=av.getLabel().getCaption().getValue();
  if (av instanceof TooltipValue) {
    text=((TooltipValue)av).getText();
  }
  sb.append("String_Node_Str" + text + "String_Node_Str");
  sb.append("String_Node_Str" + scriptActionType + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
/** 
 * @param sv
 * @return visual js
 */
public static StringBuilder getVisualJS(StringBuilder sb,int index,ActionValue av,String scriptActionType){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  String text=av.getLabel().getCaption().getValue();
  if (av instanceof TooltipValue) {
    text=((TooltipValue)av).getText();
  }
  sb.append("String_Node_Str" + text + "String_Node_Str");
  sb.append("String_Node_Str" + scriptActionType + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}
Program: 66982
Project: 66982
Buggy source:
public static String getJSKey(MultipleActions actions){
  return getJSContext(actions).toString();
}

Fixed version (ground truth):
public static String getJSKey(MultipleActions actions,ULocale locale){
  return getJSContext(actions,locale).toString();
}
Program: 66983
Project: 66983
Buggy source:
/** 
 * @param sv
 * @return
 */
public static StringBuilder getScriptValueJS(StringBuilder sb,int index,ScriptValue sv){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append(SCRIPT_MENU_HELPER.getScriptValueJS(index,sv));
  return sb;
}

Fixed version (ground truth):
/** 
 * @param sv
 * @return sb script value js
 */
public static StringBuilder getScriptValueJS(StringBuilder sb,int index,ScriptValue sv,ULocale locale){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  sb.append(SCRIPT_MENU_HELPER.getScriptValueJS(index,sv,locale));
  return sb;
}
Program: 66984
Project: 66984
Buggy source:
/** 
 * @param index
 * @param uv
 * @return
 */
public static StringBuilder getURLValueJS(StringBuilder sb,int index,URLValue uv,ICharacterEncoderAdapter transferAdapter){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  String text=transferAdapter.transformToJsConstants(transferAdapter.escape(uv.getLabel().getCaption().getValue()));
  sb.append("String_Node_Str" + text + "String_Node_Str");
  String url=uv.getBaseUrl();
  if (!(url.startsWith("String_Node_Str") || url.endsWith("String_Node_Str"))) {
    url="String_Node_Str" + url + "String_Node_Str";
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + url + "String_Node_Str");
  String target=uv.getTarget() == null ? "String_Node_Str" : uv.getTarget();
  sb.append("String_Node_Str" + target + "String_Node_Str");
  if (uv.getTooltip() != null && uv.getTooltip().trim().length() > 0) {
    String tooltip=transferAdapter.transformToJsConstants(uv.getTooltip());
    if (tooltip.startsWith("String_Node_Str") || tooltip.startsWith("String_Node_Str"))     sb.append("String_Node_Str" + tooltip + "String_Node_Str");
 else     sb.append("String_Node_Str" + tooltip + "String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
/** 
 * @param index
 * @param uv
 * @return sb url value js
 */
public static StringBuilder getURLValueJS(StringBuilder sb,int index,URLValue uv,ICharacterEncoderAdapter transferAdapter){
  if (index == 0) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  String text=transferAdapter.transformToJsConstants(transferAdapter.escape(uv.getLabel().getCaption().getValue()));
  sb.append("String_Node_Str" + text + "String_Node_Str");
  String url=uv.getBaseUrl();
  if (!(url.startsWith("String_Node_Str") || url.endsWith("String_Node_Str"))) {
    url="String_Node_Str" + url + "String_Node_Str";
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + url + "String_Node_Str");
  String target=uv.getTarget() == null ? "String_Node_Str" : uv.getTarget();
  sb.append("String_Node_Str" + target + "String_Node_Str");
  if (uv.getTooltip() != null && uv.getTooltip().trim().length() > 0) {
    String tooltip=transferAdapter.transformToJsConstants(uv.getTooltip());
    if (tooltip.startsWith("String_Node_Str") || tooltip.startsWith("String_Node_Str"))     sb.append("String_Node_Str" + tooltip + "String_Node_Str");
 else     sb.append("String_Node_Str" + tooltip + "String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb;
}
Program: 66986
Project: 66986
Buggy source:
/** 
 * Returns scripts of 'Invoke Script' action.
 * @param index index of action.
 * @param sv script action.
 * @return
 */
public String getScriptValueJS(int index,ScriptValue sv);

Fixed version (ground truth):
/** 
 * Returns scripts of 'Invoke Script' action.
 * @param index index of action.
 * @param sv script action.
 * @param locale
 * @return string script value js
 */
public String getScriptValueJS(int index,ScriptValue sv,ULocale locale);
Program: 66987
Project: 66987
Buggy source:
/** 
 * Returns instance of this object.
 * @return
 */
public static IScriptMenuHelper instance(){
  return factory;
}

Fixed version (ground truth):
/** 
 * Returns instance of this object.
 * @return IScriptMenuHelper instance
 */
public static IScriptMenuHelper instance(){
  return factory;
}
Program: 66988
Project: 66988
Buggy source:
/** 
 * Wraps specified script into a function for the calling by using eval function.
 * @param script
 * @return
 */
public static String wrapScriptsAsFunction(String script){
  String f="String_Node_Str" + ScriptHandler.BASE_VALUE + "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str"+ JavascriptEvalUtil.transformToJsConstants(script)+ "String_Node_Str"+ ScriptHandler.BASE_VALUE+ "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str";
  return f;
}

Fixed version (ground truth):
/** 
 * Wraps specified script into a function for the calling by using eval function.
 * @param script
 * @return string script
 */
public static String wrapScriptsAsFunction(String script){
  String f="String_Node_Str" + ScriptHandler.BASE_VALUE + "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str"+ JavascriptEvalUtil.transformToJsConstants(script)+ "String_Node_Str"+ ScriptHandler.BASE_VALUE+ "String_Node_Str"+ ScriptHandler.ORTHOGONAL_VALUE+ "String_Node_Str"+ ScriptHandler.SERIES_VALUE+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_TEXT+ "String_Node_Str"+ IActionRenderer.LEGEND_ITEM_VALUE+ "String_Node_Str"+ IActionRenderer.AXIS_LABEL+ "String_Node_Str";
  return f;
}
Program: 66989
Project: 66989
Buggy source:
public String getScriptValueJS(int index,ScriptValue sv){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + sv.getLabel().getCaption().getValue() + "String_Node_Str");
  sb.append("String_Node_Str");
  String script=sv.getScript();
  sb.append("String_Node_Str" + wrapScriptsAsFunction(script) + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String getScriptValueJS(int index,ScriptValue sv,ULocale locale){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + sv.getLabel().getCaption().getValue() + "String_Node_Str");
  sb.append("String_Node_Str");
  String script=sv.getScript();
  sb.append("String_Node_Str" + wrapScriptsAsFunction(script) + "String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 66991
Project: 66991
Buggy source:
/** 
 * clear unused column hints
 * @throws BirtException
 */
private final void clearUnusedColumnHints(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  PropertyHandle handle=dataSetHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (handle != null && handle.getListValue() != null) {
    ArrayList list=handle.getListValue();
    int count=list.size();
    for (int n=count - 1; n >= 0; n--) {
      ColumnHint hint=(ColumnHint)list.get(n);
      String columnName=(String)hint.getProperty(handle.getModule(),ColumnHint.COLUMN_NAME_MEMBER);
      boolean found=false;
      if (!isEmpty(hint,handle.getModule().getModuleHandle())) {
        for (int m=0; m < metaData.getColumnCount() && !found; m++) {
          found=columnName.equals(metaData.getColumnName(m + 1));
        }
      }
      if (!found) {
        try {
          handle.removeItem(hint);
        }
 catch (        PropertyValueException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * clear unused column hints
 * @throws BirtException
 */
private final void clearUnusedColumnHints(DataSetHandle dataSetHandle,IResultMetaData metaData) throws BirtException {
  PropertyHandle handle=dataSetHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (handle != null && handle.getListValue() != null) {
    ArrayList list=handle.getListValue();
    int count=list.size();
    for (int n=count - 1; n >= 0; n--) {
      ColumnHint hint=(ColumnHint)list.get(n);
      String columnName=(String)hint.getProperty(handle.getModule(),ColumnHint.COLUMN_NAME_MEMBER);
      boolean found=false;
      if (!isEmpty(hint,handle.getModule().getModuleHandle())) {
        for (int m=0; m < metaData.getColumnCount() && !found; m++) {
          found=columnName.equals(metaData.getColumnName(m + 1));
        }
        if (!found) {
          try {
            handle.removeItem(hint);
          }
 catch (          PropertyValueException e) {
          }
        }
      }
    }
  }
}
Program: 66992
Project: 66992
Buggy source:
public void dispose(){
  super.dispose();
  reportXMLEditor.dispose();
  reportXMLEditor=null;
  unhookModelEventManager(getModel());
  SessionHandleAdapter.getInstance().getMediator(getModel()).removeColleague(this);
}

Fixed version (ground truth):
public void dispose(){
  super.dispose();
  ((MultiPageEditorSite)getSite()).dispose();
  reportXMLEditor.dispose();
  reportXMLEditor=null;
  unhookModelEventManager(getModel());
  SessionHandleAdapter.getInstance().getMediator(getModel()).removeColleague(this);
}
Program: 66993
Project: 66993
Buggy source:
FormPageDef(IConfigurationElement element){
  this.element=element;
  id=loadStringAttribute(element,ATTRIBUTE_ID);
  displayName=loadStringAttribute(element,ATTRIBUTE_DISPLAY_NAME);
  pageClass=loadStringAttribute(element,ATTRIBUTE_CLASS);
  visible=loadBooleanAttribute(element,ATTRIBUTE_VISIBLE);
  relative=loadStringAttribute(element,ATTRIBUTE_RELATIVE);
  position=loadPosition(element,ATTRIBUTE_POSITION);
  this.priority=loadPriority(element,ATTRIBUTE_PRIORITY);
  if (loadStringAttribute(element,ATTRIBUTE_PAGE_ACTION) != null) {
    pageAction=(IAction)loadClass(element,ATTRIBUTE_PAGE_ACTION);
  }
  if (pageAction == null) {
    pageAction=new PageSetAction(displayName,id);
  }
  actionBarContributor=(IEditorActionBarContributor)loadClass(element,ATTRIBUTE_ACTION_BAR_CONTRIBUTOR);
}

Fixed version (ground truth):
FormPageDef(IConfigurationElement element){
  this.element=element;
  id=loadStringAttribute(element,ATTRIBUTE_ID);
  displayName=loadStringAttribute(element,ATTRIBUTE_DISPLAY_NAME);
  pageClass=loadStringAttribute(element,ATTRIBUTE_CLASS);
  visible=loadBooleanAttribute(element,ATTRIBUTE_VISIBLE);
  relative=loadStringAttribute(element,ATTRIBUTE_RELATIVE);
  position=loadPosition(element,ATTRIBUTE_POSITION);
  this.priority=loadPriority(element,ATTRIBUTE_PRIORITY);
  if (loadStringAttribute(element,ATTRIBUTE_PAGE_ACTION) != null) {
    pageAction=(IAction)loadClass(element,ATTRIBUTE_PAGE_ACTION);
  }
  if (pageAction == null) {
    pageAction=new PageSetAction(displayName,id);
  }
}
Program: 66995
Project: 66995
Buggy source:
public void propertyChange(PropertyChangeEvent event){
  if (note == null || note.isDisposed()) {
    ViewerPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
    return;
  }
  if (WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
    note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
    buttonTray.layout();
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent event){
  if (note != null && !note.isDisposed() && WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
    note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
    buttonTray.layout();
  }
}
Program: 66999
Project: 66999
Buggy source:
private boolean isDrilledElement(IAggregationResultRow row,IEdgeDrillFilter drill){
  List comparableLevels=CubeQueryDefinitionUtil.getDrilledTargetLevels(drill);
  boolean matched=true;
  Object[] tuple=drill.getTuple().toArray();
  for (int j=0; j < tuple.length; j++) {
    if (tuple[j] == null)     continue;
    int levelIndex=-1;
    for (int t=0; t < this.dimLevel.length; t++) {
      if (this.dimLevel[t].equals(comparableLevels.get(j))) {
        levelIndex=t;
        break;
      }
    }
    if (levelIndex == -1)     return false;
    if (!containMember(row.getLevelMembers()[levelIndex].getKeyValues(),(Object[])tuple[j])) {
      matched=false;
      break;
    }
  }
  return matched;
}

Fixed version (ground truth):
private boolean isDrilledElement(IAggregationResultRow row,IEdgeDrillFilter drill){
  List comparableLevels=drillFilterTargetLevels.get(drill);
  boolean matched=true;
  Object[] tuple=drill.getTuple().toArray();
  for (int j=0; j < tuple.length; j++) {
    if (tuple[j] == null)     continue;
    int levelIndex=-1;
    for (int t=0; t < this.dimLevel.length; t++) {
      if (this.dimLevel[t].equals(comparableLevels.get(j))) {
        levelIndex=t;
        break;
      }
    }
    if (levelIndex == -1)     return false;
    if (!containMember(row.getLevelMembers()[levelIndex].getKeyValues(),(Object[])tuple[j])) {
      matched=false;
      break;
    }
  }
  return matched;
}
Program: 67000
Project: 67000
Buggy source:
public static String ellipsisString(String str,int iVisChar){
  if (iVisChar > 0) {
    return str.substring(0,iVisChar) + ELLIPSIS_STRING;
  }
 else {
    return str;
  }
}

Fixed version (ground truth):
public static String ellipsisString(String str,int iVisChar){
  if (iVisChar > 0 && iVisChar < str.length()) {
    return str.substring(0,iVisChar) + ELLIPSIS_STRING;
  }
 else {
    return str;
  }
}
Program: 67001
Project: 67001
Buggy source:
private void updateReportParameterValue(int index){
}

Fixed version (ground truth):
private void updateReportParameterValue(int index,String bindedReportParameterName){
}
Program: 67002
Project: 67002
Buggy source:
private void updateReportParameter(int index){
  String setting=UIPlugin.getDefault().getPreferenceStore().getString("String_Node_Str");
  if (MessageDialogWithToggle.ALWAYS.equals(setting)) {
    updateReportParameterValue(index);
  }
 else {
    OdaDataSetParameterHandle datasetParameter=(OdaDataSetParameterHandle)viewer.getViewer().getTable().getItem(index).getData();
    if (datasetParameter != null && datasetParameter.getParamName() != null) {
      MessageDialogWithToggle dialog=MessageDialogWithToggle.openYesNoQuestion(Workbench.getInstance().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,UIPlugin.getDefault().getPreferenceStore(),"String_Node_Str");
      if (dialog.getReturnCode() == MessageDialogWithToggle.INFORMATION) {
        updateReportParameterValue(index);
      }
    }
  }
}

Fixed version (ground truth):
private void updateReportParameter(int index,String bindedReportParameterName){
  String setting=UIPlugin.getDefault().getPreferenceStore().getString("String_Node_Str");
  if (MessageDialogWithToggle.ALWAYS.equals(setting)) {
    updateReportParameterValue(index,bindedReportParameterName);
  }
 else {
    OdaDataSetParameterHandle datasetParameter=(OdaDataSetParameterHandle)viewer.getViewer().getTable().getItem(index).getData();
    if (datasetParameter != null && datasetParameter.getParamName() != null) {
      MessageDialogWithToggle dialog=MessageDialogWithToggle.openYesNoQuestion(Workbench.getInstance().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,UIPlugin.getDefault().getPreferenceStore(),"String_Node_Str");
      if (dialog.getReturnCode() == MessageDialogWithToggle.INFORMATION) {
        updateReportParameterValue(index,bindedReportParameterName);
      }
    }
 else     if (datasetParameter.getParamName() == null && (!bindedReportParameterName.equals(Messages.getString("String_Node_Str")))) {
      MessageDialogWithToggle dialog=MessageDialogWithToggle.openYesNoQuestion(Workbench.getInstance().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,UIPlugin.getDefault().getPreferenceStore(),"String_Node_Str");
      if (dialog.getReturnCode() == MessageDialogWithToggle.INFORMATION) {
        ScalarParameterHandle reportParameter=ParameterPageUtil.getScalarParameter(bindedReportParameterName,false);
        if (reportParameter != null) {
          try {
            reportParameter.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);
            reportParameter.setControlType(DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX);
            reportParameter.setDefaultValue(datasetParameter.getDefaultValue());
          }
 catch (          SemanticException e) {
          }
        }
      }
    }
  }
}
Program: 67003
Project: 67003
Buggy source:
private void doNew(){
  DataSetParameter newParam=null;
  if (isOdaDataSetHandle)   newParam=new OdaDataSetParameter();
 else   newParam=new DataSetParameter();
  int position=viewer.getViewer().getTable().getItemCount();
  newParam.setName(getUniqueName());
  newParam.setIsInput(true);
  newParam.setPosition(new Integer(position + 1));
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(newParam,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    updateReportParameter(position);
    refreshMessage();
    refreshLinkedReportParamStatus();
    stack.commit();
  }
 else {
    stack.rollback();
  }
}

Fixed version (ground truth):
private void doNew(){
  DataSetParameter newParam=null;
  if (isOdaDataSetHandle)   newParam=new OdaDataSetParameter();
 else   newParam=new DataSetParameter();
  int position=viewer.getViewer().getTable().getItemCount();
  newParam.setName(getUniqueName());
  newParam.setIsInput(true);
  newParam.setPosition(new Integer(position + 1));
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(newParam,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    refreshMessage();
    refreshLinkedReportParamStatus();
    stack.commit();
    updateReportParameter(position,Messages.getString("String_Node_Str"));
  }
 else {
    stack.rollback();
  }
}
Program: 67005
Project: 67005
Buggy source:
private void doEdit(){
  int index=viewer.getViewer().getTable().getSelectionIndex();
  if (index == -1)   return;
  DataSetParameterHandle handle=(DataSetParameterHandle)viewer.getViewer().getTable().getItem(index).getData();
  originalStructure=(DataSetParameter)handle.getStructure().copy();
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(handle,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    updateReportParameter(index);
    refreshMessage();
    refreshLinkedReportParamStatus();
    stack.commit();
  }
 else {
    stack.rollback();
  }
}

Fixed version (ground truth):
private void doEdit(){
  int index=viewer.getViewer().getTable().getSelectionIndex();
  if (index == -1)   return;
  DataSetParameterHandle handle=(DataSetParameterHandle)viewer.getViewer().getTable().getItem(index).getData();
  originalStructure=(DataSetParameter)handle.getStructure().copy();
  CommandStack stack=Utility.getCommandStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  ParameterInputDialog dlg=new ParameterInputDialog(handle,isOdaDataSetHandle);
  if (dlg.open() == Window.OK) {
    viewer.getViewer().refresh();
    refreshMessage();
    refreshLinkedReportParamStatus();
    String bindedReportParameterName=dlg.bindedReportParameterName;
    updateReportParameter(index,bindedReportParameterName);
    stack.commit();
  }
 else {
    stack.rollback();
  }
}
Program: 67008
Project: 67008
Buggy source:
private void prepareChildren(){
  currentChangeType=ColumnEvent.UNKNOWN_CHANGE;
  currentColIndex=-1;
  currentEdgePosition=-1;
  blankStarted=false;
  hasColumnGroups=columnGroups != null && columnGroups.size() > 0;
  totalMeasureCount=crosstabItem.getMeasureCount();
  rowSpan=1;
  colSpan=0;
  lastMeasureIndex=-1;
  lastDimensionIndex=-1;
  lastLevelIndex=-1;
  hasLast=false;
  walker.reload();
}

Fixed version (ground truth):
private void prepareChildren(){
  isFirst=true;
  currentChangeType=ColumnEvent.UNKNOWN_CHANGE;
  currentColIndex=-1;
  currentEdgePosition=-1;
  blankStarted=false;
  hasColumnGroups=columnGroups != null && columnGroups.size() > 0;
  totalMeasureCount=crosstabItem.getMeasureCount();
  rowSpan=1;
  colSpan=0;
  lastMeasureIndex=-1;
  lastDimensionIndex=-1;
  lastLevelIndex=-1;
  hasLast=false;
  walker.reload();
}
Program: 67009
Project: 67009
Buggy source:
public boolean hasNextChild(){
  try {
    return walker.hasNext() || hasLast;
  }
 catch (  OLAPException e) {
    logger.log(Level.SEVERE,Messages.getString("String_Node_Str"),e);
  }
  return false;
}

Fixed version (ground truth):
public boolean hasNextChild(){
  if (isFirst) {
    isFirst=false;
    advance();
  }
  return nextExecutor != null;
}
Program: 67011
Project: 67011
Buggy source:
protected void writeContent(int type,String txt,IContent content){
  if (inForeign) {
    hasPInside=true;
  }
  context.addContainer(false);
  InlineFlag inlineFlag=InlineFlag.BLOCK;
  IStyle computedStyle=content.getComputedStyle();
  IStyle inlineStyle=null;
  if ("String_Node_Str".equalsIgnoreCase(content.getComputedStyle().getDisplay())) {
    if (context.isFirstInline()) {
      context.startInline();
      inlineFlag=InlineFlag.FIRST_INLINE;
      computedStyle=computeStyle(computedStyle);
    }
 else     inlineFlag=InlineFlag.MIDDLE_INLINE;
    if (!inlineStyles.isEmpty()) {
      inlineStyle=mergeStyles(inlineStyles);
    }
  }
 else {
    adjustInline();
  }
  writeBookmark(content);
  writeToc(content);
  writeText(type,txt,content,inlineFlag,computedStyle,inlineStyle);
  context.setLastIsTable(false);
}

Fixed version (ground truth):
protected void writeContent(int type,String txt,IContent content){
  if (inForeign) {
    hasPInside=true;
  }
  context.addContainer(false);
  InlineFlag inlineFlag=InlineFlag.BLOCK;
  IStyle computedStyle=content.getComputedStyle();
  IStyle inlineStyle=null;
  if ("String_Node_Str".equalsIgnoreCase(content.getComputedStyle().getDisplay())) {
    if (context.isFirstInline()) {
      context.startInline();
      inlineFlag=InlineFlag.FIRST_INLINE;
      if (!styles.isEmpty()) {
        computedStyle=new CompositeStyle(styles.peek(),content.getStyle());
      }
    }
 else     inlineFlag=InlineFlag.MIDDLE_INLINE;
    if (!inlineStyles.isEmpty()) {
      inlineStyle=mergeStyles(inlineStyles);
    }
  }
 else {
    adjustInline();
  }
  writeBookmark(content);
  writeToc(content);
  writeText(type,txt,content,inlineFlag,computedStyle,inlineStyle);
  context.setLastIsTable(false);
}
Program: 67012
Project: 67012
Buggy source:
public boolean isAggregationFilter(){
  return this.dimName == null;
}

Fixed version (ground truth):
public boolean isAggregationFilter(){
  if (this.isAxisFilter)   return true;
  return this.dimName == null;
}
Program: 67023
Project: 67023
Buggy source:
/** 
 * @param name
 * @param factTableJointColumnNames
 * @param DimJointColumnNames
 * @param dimensions
 * @param factTable
 * @param measureColumns
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void createCube(String name,String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDimension[] dimensions,IDatasetIterator factTable,String[] measureColumns,long cacheSize,StopSign stopSign,boolean suppressInvalidFacttableRow) throws IOException, BirtException {
  if (dimensions.length == 0) {
    throw new DataException(ResourceConstants.MISSING_DIMENSION_IN_CUBE,name);
  }
  Cube cube=new Cube(name,documentManager);
  cube.create(factTableJointColumnNames,DimJointColumnNames,dimensions,factTable,measureColumns,cacheSize,stopSign,suppressInvalidFacttableRow);
  cube.close();
  documentManager.flush();
}

Fixed version (ground truth):
/** 
 * @param name
 * @param factTableJointColumnNames
 * @param DimJointColumnNames
 * @param dimensions
 * @param factTable
 * @param measureColumns
 * @param stopSign
 * @throws IOException
 * @throws BirtException
 */
public void createCube(String name,String[][] factTableJointColumnNames,String[][] DimJointColumnNames,IDimension[] dimensions,IDatasetIterator factTable,String[] measureColumns,long cacheSize,StopSign stopSign) throws IOException, BirtException {
  if (dimensions.length == 0) {
    throw new DataException(ResourceConstants.MISSING_DIMENSION_IN_CUBE,name);
  }
  Cube cube=new Cube(name,documentManager);
  cube.create(factTableJointColumnNames,DimJointColumnNames,dimensions,factTable,measureColumns,cacheSize,stopSign);
  cube.close();
  documentManager.flush();
}