nus-yam/ex-repair huggingface dataset:
Program: 65616
Project: 65616
Buggy source:
/** 
 * Updates the expression of column binding. The dimension and level names will be changed if necessary.
 * @param expr the expression of column binding
 * @param nameMap the name map
 * @param type the type of the expression
 * @return the updated expression, or null if it doesn't needs updating
 */
protected Map<String,String> getUpdateBindingMap(String expr,Map<String,String> nameMap,String type){
  Map<String,String> updateMap=new HashMap<String,String>();
  if (IExpressionType.JAVASCRIPT.equalsIgnoreCase(type)) {
    String measureName=null;
    try {
      measureName=ExpressionUtil.getReferencedMeasure(expr);
    }
 catch (    CoreException e) {
    }
    if (measureName != null) {
      String newName=nameMap.get(measureName);
      if (newName != null)       updateMap.put(measureName,newName);
    }
 else {
      Set<IDimLevel> tmpSet=null;
      try {
        tmpSet=ExpressionUtil.getReferencedDimLevel(expr);
      }
 catch (      CoreException e) {
        return null;
      }
      Iterator<IDimLevel> dimLevels=tmpSet.iterator();
      while (dimLevels.hasNext()) {
        IDimLevel tmpObj=dimLevels.next();
        String oldName=tmpObj.getDimensionName();
        String newName=nameMap.get(oldName);
        if (newName == null)         continue;
        if (!newName.equals(oldName))         updateMap.put(oldName,newName);
      }
    }
  }
  return updateMap;
}

Fixed version (ground truth):
/** 
 * Updates the expression of column binding. The dimension and level names will be changed if necessary.
 * @param expr the expression of column binding
 * @param nameMap the name map
 * @param type the type of the expression
 * @return the updated expression, or null if it doesn't needs updating
 */
protected Map<String,String> getUpdateBindingMap(String expr,Map<String,String> nameMap,String type){
  Map<String,String> updateMap=new HashMap<String,String>();
  if (IExpressionType.JAVASCRIPT.equalsIgnoreCase(type)) {
    Set<String> measureNameSet=null;
    try {
      measureNameSet=ExpressionUtil.getAllReferencedMeasures(expr);
    }
 catch (    CoreException e) {
    }
    if (measureNameSet != null && !measureNameSet.isEmpty()) {
      for (      String measureName : measureNameSet) {
        String newName=nameMap.get(measureName);
        if (newName != null)         updateMap.put(measureName,newName);
      }
    }
 else {
      Set<IDimLevel> tmpSet=null;
      try {
        tmpSet=ExpressionUtil.getReferencedDimLevel(expr);
      }
 catch (      CoreException e) {
        return null;
      }
      Iterator<IDimLevel> dimLevels=tmpSet.iterator();
      while (dimLevels.hasNext()) {
        IDimLevel tmpObj=dimLevels.next();
        String oldName=tmpObj.getDimensionName();
        String newName=nameMap.get(oldName);
        if (newName == null)         continue;
        if (!newName.equals(oldName))         updateMap.put(oldName,newName);
      }
    }
  }
  return updateMap;
}
Program: 65617
Project: 65617
Buggy source:
/** 
 * return all emitter info through BIRT engine emitter extension. If there are several emitters for a same format, then the default emitter specified by EngineConfig is used, if no default emitter is specified in EngineConfig, then the first emitter is used.
 * @return all emitter info through BIRT engine emitter extension
 */
public EmitterInfo[] getEmitterInfo(){
  if (emitterInfos == null) {
    EngineConfig config=engine.getConfig();
    Map<String,EmitterInfo> emitters=new HashMap<String,EmitterInfo>();
    EmitterInfo[] tempEmitterInfo=extensionMgr.getEmitterInfo();
    for (    EmitterInfo emitterInfo : tempEmitterInfo) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      if (!emitters.containsKey(format) || id.equals(config.getDefaultEmitter(format))) {
        emitters.put(format,emitterInfo);
      }
    }
    emitterInfos=new EmitterInfo[emitters.size()];
    emitters.values().toArray(emitterInfos);
    for (    EmitterInfo emitterInfo : emitterInfos) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      String defaultEmitter=config.getDefaultEmitter(format);
      if (defaultEmitter != null && !defaultEmitter.equals(id)) {
        logger.log(Level.WARNING,"String_Node_Str" + defaultEmitter + "String_Node_Str"+ id+ "String_Node_Str"+ format+ "String_Node_Str");
      }
    }
  }
  return emitterInfos;
}

Fixed version (ground truth):
/** 
 * return all emitter info through BIRT engine emitter extension. If there are several emitters for a same format, then the default emitter specified by EngineConfig is used, if no default emitter is specified in EngineConfig, then the first emitter is used.
 * @return all emitter info through BIRT engine emitter extension
 */
public synchronized EmitterInfo[] getEmitterInfo(){
  if (emitterInfos == null) {
    EngineConfig config=engine.getConfig();
    Map<String,EmitterInfo> emitters=new HashMap<String,EmitterInfo>();
    EmitterInfo[] tempEmitterInfo=extensionMgr.getEmitterInfo();
    for (    EmitterInfo emitterInfo : tempEmitterInfo) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      if (!emitters.containsKey(format) || id.equals(config.getDefaultEmitter(format))) {
        emitters.put(format,emitterInfo);
      }
    }
    emitterInfos=new EmitterInfo[emitters.size()];
    emitters.values().toArray(emitterInfos);
    for (    EmitterInfo emitterInfo : emitterInfos) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      String defaultEmitter=config.getDefaultEmitter(format);
      if (defaultEmitter != null && !defaultEmitter.equals(id)) {
        logger.log(Level.WARNING,"String_Node_Str" + defaultEmitter + "String_Node_Str"+ id+ "String_Node_Str"+ format+ "String_Node_Str");
      }
    }
  }
  return emitterInfos;
}
Program: 65619
Project: 65619
Buggy source:
/** 
 * @param expr
 * @return
 * @throws CoreException
 */
public static String getReferencedMeasure(String expr) throws CoreException {
  return OlapExpressionCompiler.getReferencedMeasure(expr);
}

Fixed version (ground truth):
/** 
 * @param expr
 * @deprecated replaced by getAllReferencedMeasure
 * @return get the first measure name in this expression
 * @throws CoreException
 */
public static String getReferencedMeasure(String expr) throws CoreException {
  Set<String> names=OlapExpressionCompiler.getReferencedMeasure(expr);
  return names.isEmpty() ? null : names.iterator().next();
}
Program: 65620
Project: 65620
Buggy source:
/** 
 * @param n
 * @param objectName
 * @return
 */
private static String getScriptObjectName(Node n,String objectName){
  if (n == null)   return null;
  String result=null;
  if (n.getType() == Token.NAME) {
    if (objectName.equals(n.getString())) {
      Node dimNameNode=n.getNext();
      if (dimNameNode == null || dimNameNode.getType() != Token.STRING)       return null;
      return dimNameNode.getString();
    }
  }
  result=getScriptObjectName(n.getFirstChild(),objectName);
  if (result == null)   result=getScriptObjectName(n.getLastChild(),objectName);
  return result;
}

Fixed version (ground truth):
/** 
 * @param n
 * @param objectName
 * @return
 */
private static void getScriptObjectName(Node n,String objectName,Set nameSet){
  if (n == null)   return;
  String result=null;
  if (n.getType() == Token.NAME) {
    if (objectName.equals(n.getString())) {
      Node dimNameNode=n.getNext();
      if (dimNameNode == null || dimNameNode.getType() != Token.STRING)       return;
      nameSet.add(dimNameNode.getString());
    }
  }
  getScriptObjectName(n.getFirstChild(),objectName,nameSet);
  getScriptObjectName(n.getNext(),objectName,nameSet);
  getScriptObjectName(n.getLastChild(),objectName,nameSet);
}
Program: 65621
Project: 65621
Buggy source:
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static String getReferencedMeasure(String expr){
  if (expr == null)   return null;
  try {
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    return getScriptObjectName(tree,"String_Node_Str");
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static Set<String> getReferencedMeasure(String expr){
  if (expr == null)   return Collections.EMPTY_SET;
  try {
    Set<String> result=new LinkedHashSet<String>();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    getScriptObjectName(tree,"String_Node_Str",result);
    return result;
  }
  finally {
    Context.exit();
  }
}
Program: 65623
Project: 65623
Buggy source:
/** 
 * Updates the expression of column binding. The dimension and level names will be changed if necessary.
 * @param expr the expression of column binding
 * @param nameMap the name map
 * @param type the type of the expression
 * @return the updated expression, or null if it doesn't needs updating
 */
protected Map<String,String> getUpdateBindingMap(String expr,Map<String,String> nameMap,String type){
  Map<String,String> updateMap=new HashMap<String,String>();
  if (IExpressionType.JAVASCRIPT.equalsIgnoreCase(type)) {
    String measureName=null;
    try {
      measureName=ExpressionUtil.getReferencedMeasure(expr);
    }
 catch (    CoreException e) {
    }
    if (measureName != null) {
      String newName=nameMap.get(measureName);
      if (newName != null)       updateMap.put(measureName,newName);
    }
 else {
      Set<IDimLevel> tmpSet=null;
      try {
        tmpSet=ExpressionUtil.getReferencedDimLevel(expr);
      }
 catch (      CoreException e) {
        return null;
      }
      Iterator<IDimLevel> dimLevels=tmpSet.iterator();
      while (dimLevels.hasNext()) {
        IDimLevel tmpObj=dimLevels.next();
        String oldName=tmpObj.getDimensionName();
        String newName=nameMap.get(oldName);
        if (newName == null)         continue;
        if (!newName.equals(oldName))         updateMap.put(oldName,newName);
      }
    }
  }
  return updateMap;
}

Fixed version (ground truth):
/** 
 * Updates the expression of column binding. The dimension and level names will be changed if necessary.
 * @param expr the expression of column binding
 * @param nameMap the name map
 * @param type the type of the expression
 * @return the updated expression, or null if it doesn't needs updating
 */
protected Map<String,String> getUpdateBindingMap(String expr,Map<String,String> nameMap,String type){
  Map<String,String> updateMap=new HashMap<String,String>();
  if (IExpressionType.JAVASCRIPT.equalsIgnoreCase(type)) {
    Set<String> measureNameSet=null;
    try {
      measureNameSet=ExpressionUtil.getAllReferencedMeasures(expr);
    }
 catch (    CoreException e) {
    }
    if (measureNameSet != null && !measureNameSet.isEmpty()) {
      for (      String measureName : measureNameSet) {
        String newName=nameMap.get(measureName);
        if (newName != null)         updateMap.put(measureName,newName);
      }
    }
 else {
      Set<IDimLevel> tmpSet=null;
      try {
        tmpSet=ExpressionUtil.getReferencedDimLevel(expr);
      }
 catch (      CoreException e) {
        return null;
      }
      Iterator<IDimLevel> dimLevels=tmpSet.iterator();
      while (dimLevels.hasNext()) {
        IDimLevel tmpObj=dimLevels.next();
        String oldName=tmpObj.getDimensionName();
        String newName=nameMap.get(oldName);
        if (newName == null)         continue;
        if (!newName.equals(oldName))         updateMap.put(oldName,newName);
      }
    }
  }
  return updateMap;
}
Program: 65624
Project: 65624
Buggy source:
/** 
 * Populate records to be retrieved when re-render resultSetTable
 * @param metaData
 * @param query
 * @throws BirtException
 */
private void populateRecords(IResultIterator iter){
  try {
    if (iter != null) {
      IResultMetaData meta=iter.getResultMetaData();
      if (meta.getColumnCount() > 0) {
        while (iter.next()) {
          CellValue[] record=new CellValue[meta.getColumnCount()];
          for (int n=0; n < record.length; n++) {
            CellValue cv=new CellValue();
            Object value=iter.getValue(meta.getColumnName(n + 1));
            String disp=null;
            if (value instanceof Number)             disp=value.toString();
 else             if (value instanceof byte[]) {
              disp=DataTypeUtil.toLimitedSizeString(value);
            }
 else             disp=iter.getString(meta.getColumnName(n + 1));
            cv.setDisplayValue(disp);
            cv.setRealValue(value);
            record[n]=cv;
          }
          recordList.add(record);
        }
      }
      setPromptLabelText();
      iter.close();
    }
  }
 catch (  RuntimeException e) {
    errorList.add(e);
  }
catch (  BirtException e) {
    errorList.add(e);
  }
}

Fixed version (ground truth):
/** 
 * Populate records to be retrieved when re-render resultSetTable
 * @param metaData
 * @param query
 * @throws BirtException
 */
private void populateRecords(IResultIterator iter){
  try {
    if (iter != null) {
      IResultMetaData meta=iter.getResultMetaData();
      if (meta.getColumnCount() > 0) {
        while (iter.next()) {
          CellValue[] record=new CellValue[meta.getColumnCount()];
          for (int n=0; n < record.length; n++) {
            CellValue cv=new CellValue();
            Object value=iter.getValue(meta.getColumnName(n + 1));
            String disp=null;
            if (value instanceof Number)             disp=value.toString();
 else             disp=iter.getString(meta.getColumnName(n + 1));
            cv.setDisplayValue(disp);
            cv.setRealValue(value);
            record[n]=cv;
          }
          recordList.add(record);
        }
      }
      setPromptLabelText();
      iter.close();
    }
  }
 catch (  RuntimeException e) {
    errorList.add(e);
  }
catch (  BirtException e) {
    errorList.add(e);
  }
}
Program: 65625
Project: 65625
Buggy source:
/** 
 * Convert an object to an locale neutral String value. For Date values we will convert to ISO8601 format.
 * @param source
 * @return
 * @throws BirtException
 */
public static String toLocaleNeutralString(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Time) {
    return ((Time)source).toString();
  }
 else   if (source instanceof java.sql.Date) {
    return ((java.sql.Date)source).toString();
  }
 else   if (source instanceof Timestamp) {
    return ((java.sql.Timestamp)source).toString();
  }
 else   if (source instanceof Date) {
    return DateFormatISO8601.format((Date)source);
  }
 else   if (source instanceof Number) {
    return ((Number)source).toString();
  }
 else   if (source instanceof byte[]) {
    return new String((byte[])source);
  }
 else {
    return source.toString();
  }
}

Fixed version (ground truth):
/** 
 * Convert an object to an locale neutral String value. For Date values we will convert to ISO8601 format.
 * @param source
 * @return
 * @throws BirtException
 */
public static String toLocaleNeutralString(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Time) {
    return ((Time)source).toString();
  }
 else   if (source instanceof java.sql.Date) {
    return ((java.sql.Date)source).toString();
  }
 else   if (source instanceof Timestamp) {
    return ((java.sql.Timestamp)source).toString();
  }
 else   if (source instanceof Date) {
    return DateFormatISO8601.format((Date)source);
  }
 else   if (source instanceof Number) {
    return ((Number)source).toString();
  }
 else {
    return toLimitedSizeString(source);
  }
}
Program: 65626
Project: 65626
Buggy source:
/** 
 * Only for display usage
 * @param source
 * @return
 */
public static String toLimitedSizeString(Object source){
  if (source instanceof byte[]) {
    StringBuffer buf=new StringBuffer();
    final int strLength=8;
    byte[] sourceValue=(byte[])source;
    int length=Math.min(sourceValue.length,strLength);
    for (int i=0; i < length; i++) {
      buf.append(Integer.toHexString(sourceValue[i]).toUpperCase());
      buf.append("String_Node_Str");
    }
    if (sourceValue.length > strLength) {
      buf.append("String_Node_Str");
    }
    return buf.toString();
  }
 else {
    return source.toString();
  }
}

Fixed version (ground truth):
/** 
 * @param source
 * @return
 */
private static String toLimitedSizeString(Object source){
  if (source instanceof byte[]) {
    StringBuffer buf=new StringBuffer();
    final int strLength=8;
    byte[] sourceValue=(byte[])source;
    int length=Math.min(sourceValue.length,strLength);
    for (int i=0; i < length; i++) {
      buf.append(Integer.toHexString(sourceValue[i]).toUpperCase());
      buf.append("String_Node_Str");
    }
    if (sourceValue.length > strLength) {
      buf.append("String_Node_Str");
    }
    return buf.toString();
  }
 else {
    return source.toString();
  }
}
Program: 65627
Project: 65627
Buggy source:
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   if (source instanceof Blob) {
    try {
      return ((Blob)source).getBytes((long)1,(int)((Blob)source).length());
    }
 catch (    SQLException e) {
      throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
    }
  }
 else   if (source instanceof String) {
    return ((String)source).getBytes();
  }
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}

Fixed version (ground truth):
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   if (source instanceof Blob) {
    try {
      return ((Blob)source).getBytes((long)1,(int)((Blob)source).length());
    }
 catch (    SQLException e) {
      throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
    }
  }
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}
Program: 65628
Project: 65628
Buggy source:
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader) throws IOException, DataException {
  Object obj=null;
  if (dis.readByte() == 0) {
    obj=null;
    return obj;
  }
  if (fieldType.equals(Integer.class))   obj=Integer.valueOf(dis.readInt());
 else   if (fieldType.equals(Double.class))   obj=new Double(dis.readDouble());
 else   if (fieldType.equals(BigDecimal.class))   obj=new BigDecimal(dis.readUTF());
 else   if (fieldType.equals(Time.class))   obj=new Time(dis.readLong());
 else   if (fieldType.equals(Timestamp.class))   obj=new Timestamp(dis.readLong());
 else   if (fieldType.equals(java.sql.Date.class))   obj=new java.sql.Date(dis.readLong());
 else   if (Date.class.isAssignableFrom(fieldType))   obj=new Date(dis.readLong());
 else   if (fieldType.equals(Boolean.class))   obj=Boolean.valueOf(dis.readBoolean());
 else   if (fieldType.equals(String.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IClob.class) || fieldType.equals(Clob.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IBlob.class) || fieldType.equals(Blob.class)) {
    int len=IOUtil.readInt(dis);
    if (len == 0) {
      obj=null;
    }
 else {
      byte[] bytes=new byte[len];
      dis.read(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(Object.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE))) {
    obj=IOUtil.readObject(dis,classLoader);
  }
 else {
    throw new DataException(ResourceConstants.BAD_DATA_TYPE,fieldType.toString());
  }
  return obj;
}

Fixed version (ground truth):
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader) throws IOException, DataException {
  Object obj=null;
  if (dis.readByte() == 0) {
    obj=null;
    return obj;
  }
  if (fieldType.equals(Integer.class))   obj=Integer.valueOf(dis.readInt());
 else   if (fieldType.equals(Double.class))   obj=new Double(dis.readDouble());
 else   if (fieldType.equals(BigDecimal.class))   obj=new BigDecimal(dis.readUTF());
 else   if (fieldType.equals(Time.class))   obj=new Time(dis.readLong());
 else   if (fieldType.equals(Timestamp.class))   obj=new Timestamp(dis.readLong());
 else   if (fieldType.equals(java.sql.Date.class))   obj=new java.sql.Date(dis.readLong());
 else   if (Date.class.isAssignableFrom(fieldType))   obj=new Date(dis.readLong());
 else   if (fieldType.equals(Boolean.class))   obj=Boolean.valueOf(dis.readBoolean());
 else   if (fieldType.equals(String.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IClob.class) || fieldType.equals(Clob.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IBlob.class) || fieldType.equals(Blob.class)) {
    int len=IOUtil.readInt(dis);
    if (len == 0) {
      obj=null;
    }
 else {
      byte[] bytes=new byte[len];
      dis.readFully(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(Object.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE))) {
    obj=IOUtil.readObject(dis,classLoader);
  }
 else {
    throw new DataException(ResourceConstants.BAD_DATA_TYPE,fieldType.toString());
  }
  return obj;
}
Program: 65631
Project: 65631
Buggy source:
private void updateAnalysisTypes(DataSetViewData[] viewDatas,boolean updateFlag){
  for (int i=0; i < viewDatas.length; i++) {
    DataSetViewData item=viewDatas[i];
    ColumnHintHandle hint=findColumnHint(item);
    if (hint != null) {
      try {
        String analysis=hint.getAnalysis();
        if (analysis == null && getDefaultAnalysisForNullValue && updateFlag) {
          hint.setAnalysis(ExternalUIUtil.getDefaultAnalysisType(item.getDataTypeName()));
        }
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
      item.setAnalysis(hint.getAnalysis());
    }
  }
}

Fixed version (ground truth):
private void updateAnalysisTypes(DataSetViewData[] viewDatas,boolean updateFlag){
  for (int i=0; i < viewDatas.length; i++) {
    DataSetViewData item=viewDatas[i];
    ColumnHintHandle hint=findColumnHint(item);
    if (hint != null) {
      try {
        String analysis=hint.getAnalysis();
        if (analysis == null && getDefaultAnalysisForNullValue && updateFlag) {
          hint.setAnalysis(DataSetUIUtility.getDefaultAnalysisType(item.getDataTypeName()));
        }
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
      item.setAnalysis(hint.getAnalysis());
    }
  }
}
Program: 65632
Project: 65632
Buggy source:
protected void setAnalysisTypeForColumn(){
  if (!isNewlyCreated) {
    DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
    DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
    PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
    Iterator iter=handle.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        ColumnHintHandle hint=(ColumnHintHandle)iter.next();
        for (int i=0; i < viewData.length; i++) {
          if (viewData[i].getName().equals(hint.getColumnName())) {
            if (hint.getAnalysis() == null) {
              try {
                hint.setAnalysis(ExternalUIUtil.getDefaultAnalysisType(viewData[i].getDataTypeName()));
              }
 catch (              SemanticException e) {
                ExceptionHandler.handle(e);
              }
            }
            continue;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void setAnalysisTypeForColumn(){
  if (!isNewlyCreated) {
    DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
    DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
    PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
    Iterator iter=handle.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        ColumnHintHandle hint=(ColumnHintHandle)iter.next();
        for (int i=0; i < viewData.length; i++) {
          if (viewData[i].getName().equals(hint.getColumnName())) {
            if (hint.getAnalysis() == null) {
              try {
                hint.setAnalysis(DataSetUIUtility.getDefaultAnalysisType(viewData[i].getDataTypeName()));
              }
 catch (              SemanticException e) {
                ExceptionHandler.handle(e);
              }
            }
            continue;
          }
        }
      }
    }
  }
}
Program: 65635
Project: 65635
Buggy source:
private IResultClass mergeResultHint(List modelResultHints,IResultClass meta){
  if (modelResultHints == null || modelResultHints.isEmpty())   return meta;
  IResultClass newResultClass;
  try {
    newResultClass=copyResultClass(meta);
  }
 catch (  Exception ex) {
    return meta;
  }
  int count=newResultClass.getFieldCount();
  try {
    for (int i=1; i <= count; i++) {
      String fieldName=newResultClass.getFieldName(i);
      Class odaType=newResultClass.getFieldMetaData(i).getDataType();
      for (int j=0; j < modelResultHints.size(); j++) {
        if (((IColumnDefinition)modelResultHints.get(j)).getColumnName().equals(fieldName)) {
          int apiType=((IColumnDefinition)modelResultHints.get(j)).getDataType();
          if (apiType > 0 && DataTypeUtil.toApiDataType(odaType) != apiType) {
            newResultClass.getFieldMetaData(i).setDataType(DataType.getClass(apiType));
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  return newResultClass;
}

Fixed version (ground truth):
private IResultClass mergeResultHint(List modelResultHints,IResultClass meta){
  if (modelResultHints == null || modelResultHints.isEmpty())   return meta;
  IResultClass newResultClass;
  try {
    newResultClass=copyResultClass(meta);
  }
 catch (  Exception ex) {
    return meta;
  }
  boolean changed=false;
  int count=newResultClass.getFieldCount();
  try {
    for (int i=1; i <= count; i++) {
      String fieldName=newResultClass.getFieldName(i);
      Class odaType=newResultClass.getFieldMetaData(i).getDataType();
      for (int j=0; j < modelResultHints.size(); j++) {
        if (((IColumnDefinition)modelResultHints.get(j)).getColumnName().equals(fieldName)) {
          int apiType=((IColumnDefinition)modelResultHints.get(j)).getDataType();
          if (apiType > 0 && DataTypeUtil.toApiDataType(odaType) != apiType) {
            newResultClass.getFieldMetaData(i).setDataType(DataType.getClass(apiType));
            changed=true;
          }
          break;
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  if (changed)   return newResultClass;
 else   return meta;
}
Program: 65636
Project: 65636
Buggy source:
private AggregationFunctionDefinition getSimpleFunction(AggregationDefinition[] aggregations) throws DataException {
  AggregationFunctionDefinition func=null;
  for (int i=0; i < aggregations.length; i++) {
    AggregationFunctionDefinition[] aggrFunc=aggregations[i].getAggregationFunctions();
    if (aggrFunc == null)     continue;
    for (int j=0; j < aggrFunc.length; j++) {
      if (func == null && aggrFunc[j].getFilterEvalHelper() == null) {
        func=aggrFunc[j];
      }
 else {
        if (func != null && !equal(func,aggrFunc[j]))         return null;
      }
    }
  }
  if (func != null && isSimepleFunction(func.getFunctionName()) && !existReferenceDate)   return func;
 else   return null;
}

Fixed version (ground truth):
private AggregationFunctionDefinition getSimpleFunction(AggregationDefinition[] aggregations) throws DataException {
  AggregationFunctionDefinition func=null;
  for (int i=0; i < aggregations.length; i++) {
    AggregationFunctionDefinition[] aggrFunc=aggregations[i].getAggregationFunctions();
    if (aggrFunc == null)     continue;
    for (int j=0; j < aggrFunc.length; j++) {
      if (func == null && aggrFunc[j].getFilterEvalHelper() == null) {
        func=aggrFunc[j];
      }
 else {
        if (func != null && !equal(func,aggrFunc[j]))         return null;
      }
    }
  }
  if (func != null && isSimepleFunction(func.getFunctionName()) && !existReferenceDate) {
    String mesureName=func.getMeasureName();
    try {
      MeasureInfo[] infos=dataSet4Aggregation.getMetaInfo().getMeasureInfos();
      for (      MeasureInfo info : infos) {
        if (info.getMeasureName().equals(mesureName) && "String_Node_Str".equals(func.getFunctionName()) && DataType.DOUBLE_TYPE == info.getDataType()) {
          return null;
        }
      }
    }
 catch (    Exception e) {
    }
    return func;
  }
 else   return null;
}
Program: 65637
Project: 65637
Buggy source:
private void updateAnalysisTypes(DataSetViewData[] viewDatas,boolean updateFlag){
  for (int i=0; i < viewDatas.length; i++) {
    DataSetViewData item=viewDatas[i];
    ColumnHintHandle hint=findColumnHint(item);
    if (hint != null) {
      try {
        String analysis=hint.getAnalysis();
        String defaultAnalysis=getDefaultAnalysisType(item.getName(),item.getDataTypeName());
        if (analysis == null && getDefaultAnalysisForNullValue && updateFlag) {
          hint.setAnalysis(defaultAnalysis);
        }
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
      item.setAnalysis(hint.getAnalysis());
    }
  }
}

Fixed version (ground truth):
private void updateAnalysisTypes(DataSetViewData[] viewDatas,boolean updateFlag){
  for (int i=0; i < viewDatas.length; i++) {
    DataSetViewData item=viewDatas[i];
    ColumnHintHandle hint=findColumnHint(item);
    if (hint != null) {
      try {
        String analysis=hint.getAnalysis();
        if (analysis == null && getDefaultAnalysisForNullValue && updateFlag) {
          hint.setAnalysis(ExternalUIUtil.getDefaultAnalysisType(item.getDataTypeName()));
        }
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
      item.setAnalysis(hint.getAnalysis());
    }
  }
}
Program: 65638
Project: 65638
Buggy source:
protected void setAnalysisTypeForColumn(){
  if (!isNewlyCreated) {
    DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
    DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
    PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
    Iterator iter=handle.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        ColumnHintHandle hint=(ColumnHintHandle)iter.next();
        for (int i=0; i < viewData.length; i++) {
          if (viewData[i].getName().equals(hint.getColumnName())) {
            if (hint.getAnalysis() == null) {
              try {
                hint.setAnalysis(getDefaultAnalysisType(viewData[i].getName(),viewData[i].getDataTypeName()));
              }
 catch (              SemanticException e) {
              }
            }
            continue;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void setAnalysisTypeForColumn(){
  if (!isNewlyCreated) {
    DataSetHandle ds=((DataSetEditor)getContainer()).getHandle();
    DataSetViewData[] viewData=DataSetProvider.getCurrentInstance().getColumns(ds,true);
    PropertyHandle handle=ds.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
    Iterator iter=handle.iterator();
    if (iter != null) {
      while (iter.hasNext()) {
        ColumnHintHandle hint=(ColumnHintHandle)iter.next();
        for (int i=0; i < viewData.length; i++) {
          if (viewData[i].getName().equals(hint.getColumnName())) {
            if (hint.getAnalysis() == null) {
              try {
                hint.setAnalysis(ExternalUIUtil.getDefaultAnalysisType(viewData[i].getDataTypeName()));
              }
 catch (              SemanticException e) {
                ExceptionHandler.handle(e);
              }
            }
            continue;
          }
        }
      }
    }
  }
}
Program: 65640
Project: 65640
Buggy source:
/** 
 * Populate records to be retrieved when re-render resultSetTable
 * @param metaData
 * @param query
 * @throws BirtException
 */
private void populateRecords(IResultIterator iter){
  try {
    if (iter != null) {
      IResultMetaData meta=iter.getResultMetaData();
      if (meta.getColumnCount() > 0) {
        while (iter.next()) {
          CellValue[] record=new CellValue[meta.getColumnCount()];
          for (int n=0; n < record.length; n++) {
            CellValue cv=new CellValue();
            Object value=iter.getValue(meta.getColumnName(n + 1));
            String disp=null;
            if (value instanceof Number)             disp=value.toString();
 else             disp=iter.getString(meta.getColumnName(n + 1));
            cv.setDisplayValue(disp);
            cv.setRealValue(value);
            record[n]=cv;
          }
          recordList.add(record);
        }
      }
      setPromptLabelText();
      iter.close();
    }
  }
 catch (  RuntimeException e) {
    errorList.add(e);
  }
catch (  BirtException e) {
    errorList.add(e);
  }
}

Fixed version (ground truth):
/** 
 * Populate records to be retrieved when re-render resultSetTable
 * @param metaData
 * @param query
 * @throws BirtException
 */
private void populateRecords(IResultIterator iter){
  try {
    if (iter != null) {
      IResultMetaData meta=iter.getResultMetaData();
      if (meta.getColumnCount() > 0) {
        while (iter.next()) {
          CellValue[] record=new CellValue[meta.getColumnCount()];
          for (int n=0; n < record.length; n++) {
            CellValue cv=new CellValue();
            Object value=iter.getValue(meta.getColumnName(n + 1));
            String disp=null;
            if (value instanceof Number)             disp=value.toString();
 else             if (value instanceof byte[]) {
              disp=DataTypeUtil.toLimitedSizeString(value);
            }
 else             disp=iter.getString(meta.getColumnName(n + 1));
            cv.setDisplayValue(disp);
            cv.setRealValue(value);
            record[n]=cv;
          }
          recordList.add(record);
        }
      }
      setPromptLabelText();
      iter.close();
    }
  }
 catch (  RuntimeException e) {
    errorList.add(e);
  }
catch (  BirtException e) {
    errorList.add(e);
  }
}
Program: 65641
Project: 65641
Buggy source:
/** 
 * Convert an object to an locale neutral String value. For Date values we will convert to ISO8601 format.
 * @param source
 * @return
 * @throws BirtException
 */
public static String toLocaleNeutralString(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Time) {
    return ((Time)source).toString();
  }
 else   if (source instanceof java.sql.Date) {
    return ((java.sql.Date)source).toString();
  }
 else   if (source instanceof Timestamp) {
    return ((java.sql.Timestamp)source).toString();
  }
 else   if (source instanceof Date) {
    return DateFormatISO8601.format((Date)source);
  }
 else   if (source instanceof Number) {
    return ((Number)source).toString();
  }
 else {
    return toLimitedSizeString(source);
  }
}

Fixed version (ground truth):
/** 
 * Convert an object to an locale neutral String value. For Date values we will convert to ISO8601 format.
 * @param source
 * @return
 * @throws BirtException
 */
public static String toLocaleNeutralString(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Time) {
    return ((Time)source).toString();
  }
 else   if (source instanceof java.sql.Date) {
    return ((java.sql.Date)source).toString();
  }
 else   if (source instanceof Timestamp) {
    return ((java.sql.Timestamp)source).toString();
  }
 else   if (source instanceof Date) {
    return DateFormatISO8601.format((Date)source);
  }
 else   if (source instanceof Number) {
    return ((Number)source).toString();
  }
 else   if (source instanceof byte[]) {
    return new String((byte[])source);
  }
 else {
    return source.toString();
  }
}
Program: 65642
Project: 65642
Buggy source:
/** 
 * @param source
 * @return
 */
private static String toLimitedSizeString(Object source){
  if (source instanceof byte[]) {
    StringBuffer buf=new StringBuffer();
    final int strLength=8;
    byte[] sourceValue=(byte[])source;
    int length=Math.min(sourceValue.length,strLength);
    for (int i=0; i < length; i++) {
      buf.append(Integer.toHexString(sourceValue[i]).toUpperCase());
      buf.append("String_Node_Str");
    }
    if (sourceValue.length > strLength) {
      buf.append("String_Node_Str");
    }
    return buf.toString();
  }
 else {
    return source.toString();
  }
}

Fixed version (ground truth):
/** 
 * Only for display usage
 * @param source
 * @return
 */
public static String toLimitedSizeString(Object source){
  if (source instanceof byte[]) {
    StringBuffer buf=new StringBuffer();
    final int strLength=8;
    byte[] sourceValue=(byte[])source;
    int length=Math.min(sourceValue.length,strLength);
    for (int i=0; i < length; i++) {
      buf.append(Integer.toHexString(sourceValue[i]).toUpperCase());
      buf.append("String_Node_Str");
    }
    if (sourceValue.length > strLength) {
      buf.append("String_Node_Str");
    }
    return buf.toString();
  }
 else {
    return source.toString();
  }
}
Program: 65643
Project: 65643
Buggy source:
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   if (source instanceof Blob) {
    try {
      return ((Blob)source).getBytes((long)1,(int)((Blob)source).length());
    }
 catch (    SQLException e) {
      throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
    }
  }
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}

Fixed version (ground truth):
/** 
 * @param source
 * @return byte array
 * @throws BirtException
 */
public static byte[] toBytes(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof byte[])   return (byte[])source;
 else   if (source instanceof Blob) {
    try {
      return ((Blob)source).getBytes((long)1,(int)((Blob)source).length());
    }
 catch (    SQLException e) {
      throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
    }
  }
 else   if (source instanceof String) {
    return ((String)source).getBytes();
  }
 else   throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
}
Program: 65644
Project: 65644
Buggy source:
public String getPattern(){
  String numStr="String_Node_Str";
  String decStr="String_Node_Str";
  String positivePatt=numStr;
  String negativePatt=null;
  String pattern;
  if (useSep) {
    positivePatt="String_Node_Str";
  }
  decStr=DEUtil.getDecmalStr(decPlaces);
  if (decStr != "String_Node_Str") {
    positivePatt=positivePatt + "String_Node_Str" + decStr;
  }
  if (useBracket) {
    negativePatt="String_Node_Str" + positivePatt + "String_Node_Str";
  }
  if (symbol.length() != 0 && !symbol.equalsIgnoreCase(FormatNumberPattern.TEXT_CURRENCY_SYMBOL_NONE)) {
    if (symPos.equalsIgnoreCase(FormatNumberPattern.SYMBOL_POSITION_BEFORE)) {
      positivePatt=symbol + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + positivePatt;
      if (negativePatt != null) {
        negativePatt=symbol + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + negativePatt;
      }
    }
 else     if (symPos.equalsIgnoreCase(FormatNumberPattern.SYMBOL_POSITION_AFTER)) {
      positivePatt=positivePatt + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + symbol;
      if (negativePatt != null) {
        negativePatt=negativePatt + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + symbol;
      }
    }
  }
  if (negativePatt != null) {
    pattern=positivePatt + "String_Node_Str" + negativePatt;
  }
 else {
    pattern=positivePatt;
  }
  pattern=applyRoundingMode(pattern);
  return pattern;
}

Fixed version (ground truth):
public String getPattern(){
  String numStr="String_Node_Str";
  String decStr="String_Node_Str";
  String positivePatt=numStr;
  String negativePatt=null;
  String pattern;
  if (useSep) {
    positivePatt="String_Node_Str";
  }
  decStr=DEUtil.getDecmalStr(decPlaces);
  if (!StringUtil.isEmpty(decStr)) {
    positivePatt=positivePatt + "String_Node_Str" + decStr;
  }
  if (useBracket) {
    negativePatt="String_Node_Str" + positivePatt + "String_Node_Str";
  }
  if (symbol.length() != 0 && !symbol.equalsIgnoreCase(FormatNumberPattern.TEXT_CURRENCY_SYMBOL_NONE)) {
    if (symPos.equalsIgnoreCase(FormatNumberPattern.SYMBOL_POSITION_BEFORE)) {
      positivePatt=symbol + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + positivePatt;
      if (negativePatt != null) {
        negativePatt=symbol + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + negativePatt;
      }
    }
 else     if (symPos.equalsIgnoreCase(FormatNumberPattern.SYMBOL_POSITION_AFTER)) {
      positivePatt=positivePatt + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + symbol;
      if (negativePatt != null) {
        negativePatt=negativePatt + (getUseSpace() ? "String_Node_Str" : "String_Node_Str") + symbol;
      }
    }
  }
  if (negativePatt != null) {
    pattern=positivePatt + "String_Node_Str" + negativePatt;
  }
 else {
    pattern=positivePatt;
  }
  pattern=applyRoundingMode(pattern);
  return pattern;
}
Program: 65645
Project: 65645
Buggy source:
protected boolean performInsert(Object model,SlotHandle slotHandle,String type,String position,Map extendedData) throws Exception {
  Assert.isLegal(ReportDesignConstants.ROW_ELEMENT.equals(type));
  TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getRoot(model));
  if (position != InsertAction.CURRENT) {
    int rowNumber=HandleAdapterFactory.getInstance().getRowHandleAdapter(model).getRowNumber();
    if (position == InsertAction.ABOVE) {
      adapter.insertRow(-1,rowNumber);
    }
 else     if (position == InsertAction.BELOW) {
      adapter.insertRow(1,rowNumber);
    }
 else {
      return false;
    }
  }
 else {
    adapter.insertRowInSlotHandle(slotHandle.getSlotID());
  }
  return true;
}

Fixed version (ground truth):
protected boolean performInsert(Object model,SlotHandle slotHandle,String type,String position,Map extendedData) throws Exception {
  Assert.isLegal(ReportDesignConstants.ROW_ELEMENT.equals(type));
  TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getRoot(model));
  if (!StringUtil.isEqual(position,InsertAction.CURRENT)) {
    int rowNumber=HandleAdapterFactory.getInstance().getRowHandleAdapter(model).getRowNumber();
    if (StringUtil.isEqual(position,InsertAction.ABOVE)) {
      adapter.insertRow(-1,rowNumber);
    }
 else     if (StringUtil.isEqual(position,InsertAction.BELOW)) {
      adapter.insertRow(1,rowNumber);
    }
 else {
      return false;
    }
  }
 else {
    adapter.insertRowInSlotHandle(slotHandle.getSlotID());
  }
  return true;
}
Program: 65646
Project: 65646
Buggy source:
/** 
 * @param composite
 */
private void createMeasureField(Composite composite){
  new Label(composite,SWT.NONE).setText(LABEL_MEASURE);
  measure=new Text(composite,SWT.SINGLE | SWT.BORDER);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gridData.horizontalSpan=2;
  measure.setLayoutData(gridData);
  measure.setFont(composite.getFont());
  if (measureData != null && measureData != "String_Node_Str") {
    measure.setText(NumberUtil.double2LocaleNum(((Double)measureData).doubleValue()));
  }
  measure.addVerifyListener(new VerifyListener(){
    public void verifyText(    VerifyEvent e){
      boolean doit=false;
      char eChar=e.character;
      System.out.print(eChar + 0);
      String validChars="String_Node_Str";
      if (e.keyCode == SWT.DEL || validChars.indexOf(eChar) >= 0) {
        doit=true;
      }
      e.doit=doit;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param composite
 */
private void createMeasureField(Composite composite){
  new Label(composite,SWT.NONE).setText(LABEL_MEASURE);
  measure=new Text(composite,SWT.SINGLE | SWT.BORDER);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gridData.horizontalSpan=2;
  measure.setLayoutData(gridData);
  measure.setFont(composite.getFont());
  if (measureData != null && !measureData.equals("String_Node_Str")) {
    measure.setText(NumberUtil.double2LocaleNum(((Double)measureData).doubleValue()));
  }
  measure.addVerifyListener(new VerifyListener(){
    public void verifyText(    VerifyEvent e){
      boolean doit=false;
      char eChar=e.character;
      System.out.print(eChar + 0);
      String validChars="String_Node_Str";
      if (e.keyCode == SWT.DEL || validChars.indexOf(eChar) >= 0) {
        doit=true;
      }
      e.doit=doit;
    }
  }
);
}
Program: 65647
Project: 65647
Buggy source:
public boolean equals(Object obj){
  if (!(obj instanceof SubTotalInfo)) {
    return false;
  }
  SubTotalInfo temp=(SubTotalInfo)obj;
  return temp.getLevel() == level && temp.getAggregateOnMeasureName().equals(measureQualifiedName) && temp.getFunction() == function && temp.isAggregationOn() == aggregationOn && ((temp == null && expectedView == null) || temp.getExpectedView().equals(expectedView)) && temp.getPosition().equals(levelView.getAggregationHeaderLocation());
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (!(obj instanceof SubTotalInfo)) {
    return false;
  }
  SubTotalInfo temp=(SubTotalInfo)obj;
  return temp.getLevel() == level && StringUtil.isEqual(temp.getAggregateOnMeasureName(),measureQualifiedName) && StringUtil.isEqual(temp.getFunction(),function) && temp.isAggregationOn() == aggregationOn && StringUtil.isEqual(temp.getExpectedView(),expectedView) && temp.getPosition().equals(levelView.getAggregationHeaderLocation());
}
Program: 65648
Project: 65648
Buggy source:
public boolean equals(Object obj){
  if (!(obj instanceof MeasureInfo)) {
    return false;
  }
  MeasureInfo temp=(MeasureInfo)obj;
  return temp.getMeasureName().equals(measureName) && temp.isShow() == isShow && temp.getExpectedView() == expectedView;
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (!(obj instanceof MeasureInfo)) {
    return false;
  }
  MeasureInfo temp=(MeasureInfo)obj;
  return StringUtil.isEqual(temp.getMeasureName(),measureName) && temp.isShow() == isShow && StringUtil.isEqual(temp.getExpectedView(),expectedView);
}
Program: 65650
Project: 65650
Buggy source:
public void setAction(String actionID,IAction action){
  super.setAction(actionID,action);
  if (action.getId() == null) {
    action.setId(actionID);
  }
  getActionRegistry().registerAction(action);
}

Fixed version (ground truth):
public void setAction(String actionID,IAction action){
  super.setAction(actionID,action);
  if (action != null) {
    if (action.getId() == null) {
      action.setId(actionID);
    }
    getActionRegistry().registerAction(action);
  }
}
Program: 65651
Project: 65651
Buggy source:
public void setAction(String actionID,IAction action){
  super.setAction(actionID,action);
  if (action.getId() == null) {
    action.setId(actionID);
  }
  getActionRegistry().registerAction(action);
}

Fixed version (ground truth):
public void setAction(String actionID,IAction action){
  super.setAction(actionID,action);
  if (action != null) {
    if (action.getId() == null) {
      action.setId(actionID);
    }
    getActionRegistry().registerAction(action);
  }
}
Program: 65652
Project: 65652
Buggy source:
/** 
 * @param cacheID
 * @throws BirtException
 */
public void clearCache(String cacheID) throws BirtException {
  DataSetCacheManager dscManager=this.getSession().getDataSetCacheManager();
  if (dscManager == null)   return;
 else   dscManager.clearCache(cacheID);
}

Fixed version (ground truth):
/** 
 * @param cacheID
 * @throws BirtException
 */
public void clearCache(String cacheID) throws BirtException {
  DataSetCacheManager dscManager=this.getSession().getDataSetCacheManager();
  if (dscManager == null || cacheID == null)   return;
 else   dscManager.clearCache(cacheID);
}