nus-yam/ex-repair huggingface dataset:
Program: 76517
Project: 76517
Buggy source:
/** 
 * Gets the Java class used to represent the specified data type.
 * @return Class for the specified data type. If data type is unknown or ANY, returns null. 
 */
public static Class getClass(int typeCode){
  if (typeCode < 0 || typeCode >= classes.length) {
    return null;
  }
  return classes[typeCode];
}

Fixed version (ground truth):
/** 
 * Gets the Java class used to represent the specified data type.
 * @return Class for the specified data type. If data type is unknown orANY, returns null.
 */
public static Class getClass(int typeCode){
  if (typeCode < 0 || typeCode >= classes.length) {
    return null;
  }
  for (int i=0; i < typeCodes.length; i++) {
    if (typeCodes[i] == typeCode) {
      return classes[i];
    }
  }
  return null;
}
Program: 76518
Project: 76518
Buggy source:
/** 
 * Gets the description of a data type.
 * @param typeCode Data type enumeration value
 * @return Textual description of data type. "Unknown" if an undefined data type is passed in.
 */
public static String getName(int typeCode){
  if (typeCode < 0 || typeCode >= names.length) {
    return new String("String_Node_Str");
  }
  return names[typeCode];
}

Fixed version (ground truth):
/** 
 * Gets the description of a data type.
 * @param typeCode Data type enumeration value
 * @return Textual description of data type. "Unknown" if an undefined datatype is passed in.
 */
public static String getName(int typeCode){
  if (typeCode < 0 || typeCode >= typeCodes.length) {
    return new String("String_Node_Str");
  }
  for (int i=0; i < typeCodes.length; i++) {
    if (typeCodes[i] == typeCode) {
      return names[i];
    }
  }
  return null;
}
Program: 76519
Project: 76519
Buggy source:
public static int getDataType(Class objClass){
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return i;
    }
  }
  return UNKNOWN_TYPE;
}

Fixed version (ground truth):
/** 
 * @param objClass
 * @return
 */
public static int getDataType(Class objClass){
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return typeCodes[i];
    }
  }
  return UNKNOWN_TYPE;
}
Program: 76521
Project: 76521
Buggy source:
public void buildUI(Composite parent){
  super.buildUI(parent);
  container.setLayout(WidgetUtil.createGridLayout(1));
  OutputPropertyDescriptorProvider provider=new OutputPropertyDescriptorProvider();
  OutputSection output=new OutputSection(container,true);
  output.setProvider(provider);
  addSection(PageSectionId.VISIBILITY_OUTPUT,output);
  createSections();
  layoutSections();
}

Fixed version (ground truth):
public void buildUI(Composite parent){
  super.buildUI(parent);
  container.setLayout(WidgetUtil.createGridLayout(1));
  OutputPropertyDescriptorProvider provider=new OutputPropertyDescriptorProvider();
  OutputSection output=new OutputSection(container,true);
  output.setHeight(300);
  output.setProvider(provider);
  addSection(PageSectionId.VISIBILITY_OUTPUT,output);
  createSections();
  layoutSections();
}
Program: 76522
Project: 76522
Buggy source:
public void layout(){
  GridData gd=(GridData)output.getControl().getLayoutData();
  if (getLayoutNum() > 0)   gd.horizontalSpan=getLayoutNum() - placeholder;
 else   gd.horizontalSpan=((GridLayout)parent.getLayout()).numColumns - placeholder;
}

Fixed version (ground truth):
public void layout(){
  GridData gd=(GridData)output.getControl().getLayoutData();
  if (getLayoutNum() > 0)   gd.horizontalSpan=getLayoutNum() - placeholder;
 else   gd.horizontalSpan=((GridLayout)parent.getLayout()).numColumns - placeholder;
  if (height > -1) {
    gd.heightHint=height;
    gd.grabExcessVerticalSpace=false;
    if (displayLabel != null) {
      gd=(GridData)displayLabel.getLayoutData();
      gd.verticalAlignment=GridData.VERTICAL_ALIGN_FILL;
    }
  }
}
Program: 76523
Project: 76523
Buggy source:
/** 
 * Draws a chunk of text at the pdf.
 * @param text					the textArea to be drawed.
 * @param textX					the X position of the textArea relative to current page.
 * @param textY					the Y position of the textArea relative to current page.
 * @param contentByte			the content byte to draw the text.
 * @param contentByteHeight		the height of the content byte.
 */
protected void drawTextAt(ITextArea text,int textX,int textY,PdfContentByte contentByte,float contentByteHeight){
}

Fixed version (ground truth):
/** 
 * Draws a chunk of text at the pdf.
 * @param text					the textArea to be drawed.
 * @param tx					the X position of the textArea relative to current page.
 * @param ty					the Y position of the textArea relative to current page.
 * @param contentByte			the content byte to draw the text.
 * @param contentByteHeight		the height of the content byte.
 */
protected void drawTextAt(ITextArea text,int tx,int ty,PdfContentByte contentByte,float contentByteHeight){
}
Program: 76525
Project: 76525
Buggy source:
public IBasePreparedQuery prepare(IDataQueryDefinition query,Map appContext) throws AdapterException {
  try {
    if (query instanceof IQueryDefinition)     return prepare((IQueryDefinition)query,appContext == null ? this.sessionContext.getAppContext() : appContext);
 else     if (query instanceof ICubeQueryDefinition)     return prepare((ICubeQueryDefinition)query);
 else     return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public IBasePreparedQuery prepare(IDataQueryDefinition query,Map appContext) throws AdapterException {
  try {
    if (query instanceof IQueryDefinition)     return prepare((IQueryDefinition)query,appContext);
 else     if (query instanceof ICubeQueryDefinition)     return prepare((ICubeQueryDefinition)query);
 else     return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}
Program: 76526
Project: 76526
Buggy source:
/** 
 * convert path from System Properties Definition. For example: ${java.io.tmpdir}
 * @param path
 * @return
 */
protected static String convertSystemPath(String path){
  if (path == null)   return path;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(path);
  if (m.find()) {
    String sysPath=trimSep(System.getProperty(m.group(1).trim()));
    return DataUtil.trimString(sysPath) + m.group(2).trim();
  }
  return path;
}

Fixed version (ground truth):
/** 
 * convert path from System Properties Definition. For example: ${java.io.tmpdir}
 * @param path
 * @return
 */
protected static String convertSystemPath(String path){
  if (path == null)   return path;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(path);
  if (m.find()) {
    String sysPath=DataUtil.trimSepEnd(System.getProperty(m.group(1).trim()));
    return DataUtil.trimString(sysPath) + m.group(2).trim();
  }
  return path;
}
Program: 76527
Project: 76527
Buggy source:
/** 
 * If set isWorkingFolderAccessOnly as true, check the file if exist in working folder.
 * @param filePath
 * @return boolean
 */
public static boolean isValidFilePath(String filePath){
  if (filePath == null)   return false;
  if (isWorkingFolderAccessOnly) {
    File docFile=new File(filePath);
    if (!docFile.isAbsolute())     return true;
    File docFolder=new File(workingFolder);
    if (docFolder.isAbsolute()) {
      String absolutePath=docFile.getAbsolutePath();
      String docFolderPath=docFolder.getAbsolutePath();
      if (isWindowsPlatform()) {
        absolutePath=absolutePath.toLowerCase();
        docFolderPath=docFolderPath.toLowerCase();
      }
      return absolutePath.startsWith(docFolderPath);
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * If set isWorkingFolderAccessOnly as true, check the file if exist in working folder.
 * @param filePath
 * @return boolean
 */
public static boolean isValidFilePath(String filePath){
  if (filePath == null)   return false;
  if (isWorkingFolderAccessOnly) {
    File docFile=new File(filePath);
    if (!docFile.isAbsolute()) {
      if (filePath.indexOf("String_Node_Str") != -1)       return false;
      return true;
    }
    File docFolder=new File(workingFolder);
    if (docFolder.isAbsolute()) {
      String absolutePath=docFile.getAbsolutePath();
      String docFolderPath=docFolder.getAbsolutePath();
      if (isWindowsPlatform()) {
        absolutePath=absolutePath.toLowerCase();
        docFolderPath=docFolderPath.toLowerCase();
      }
      return absolutePath.startsWith(docFolderPath);
    }
 else {
      return false;
    }
  }
  return true;
}
Program: 76528
Project: 76528
Buggy source:
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  path=convertSystemPath(path);
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=trimSep(getRealPath(path,context));
  }
 else {
    realPath=trimSep(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=trimSep(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}

Fixed version (ground truth):
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  path=convertSystemPath(path);
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=DataUtil.trimSepEnd(getRealPath(path,context));
  }
 else {
    realPath=DataUtil.trimSepEnd(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=DataUtil.trimSepEnd(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}
Program: 76529
Project: 76529
Buggy source:
/** 
 * Process working folder setting. If path is a relative path, first relative to context.
 * @param context
 * @param path
 * @return
 */
public static String processWorkingFolder(ServletContext context,String path){
  path=convertSystemPath(DataUtil.trimString(path));
  String realPath=null;
  if (isRelativePath(path)) {
    realPath=getRealPath(path,context);
    makeDir(realPath);
    return trimSep(path);
  }
 else {
    realPath=path;
  }
  makeDir(realPath);
  return trimSep(realPath);
}

Fixed version (ground truth):
/** 
 * Process working folder setting. If path is a relative path, first relative to context.
 * @param context
 * @param path
 * @return
 */
public static String processWorkingFolder(ServletContext context,String path){
  path=convertSystemPath(DataUtil.trimString(path));
  String realPath=null;
  if (isRelativePath(path)) {
    realPath=getRealPath(path,context);
    makeDir(realPath);
    return DataUtil.trimSepEnd(path);
  }
 else {
    realPath=path;
  }
  makeDir(realPath);
  return DataUtil.trimSepEnd(realPath);
}
Program: 76531
Project: 76531
Buggy source:
protected boolean needPageBreakBefore(String pageBreak){
  boolean ret=hasMasterPageChanged();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak) {
    return true;
  }
  return ret;
}

Fixed version (ground truth):
protected boolean needPageBreakBefore(String pageBreak){
  boolean ret=hasMasterPageChanged();
  if (IStyle.CSS_ALWAYS_VALUE == pageBreak || IStyle.CSS_LEFT_VALUE == pageBreak || IStyle.CSS_RIGHT_VALUE == pageBreak || IStyle.CSS_SOFT_VALUE == pageBreak) {
    return true;
  }
  return ret;
}
Program: 76532
Project: 76532
Buggy source:
/** 
 * Gets the proper expression for the given model
 * @param model the given model
 * @return Returns the proper expression for the given model, or null if noproper one exists
 */
public static String getExpression(Object model){
  if (model instanceof ParameterHandle) {
    return ExpressionUtil.createJSParameterExpression(((ParameterHandle)model).getQualifiedName());
  }
  if (model instanceof DataSetItemModel) {
    String colName=((DataSetItemModel)model).getAlias();
    if (colName == null || colName.trim().length() == 0) {
      colName=((DataSetItemModel)model).getName();
    }
    return getColumnExpression(colName);
  }
  if (model instanceof ComputedColumnHandle) {
    return getColumnExpression(((ComputedColumnHandle)model).getName());
  }
  if (model instanceof ResultSetColumnHandle) {
    return getResultSetColumnExpression(((ResultSetColumnHandle)model).getColumnName());
  }
  if (model instanceof DataSetParameterHandle) {
    return IReportElementConstants.STOREDPROCUDURE_OUTPUT_PREFIX + "String_Node_Str" + escape(((DataSetParameterHandle)model).getName())+ "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the proper expression for the given model
 * @param model the given model
 * @return Returns the proper expression for the given model, or null if noproper one exists
 */
public static String getExpression(Object model){
  if (model instanceof ParameterHandle) {
    return ExpressionUtil.createJSParameterExpression(((ParameterHandle)model).getQualifiedName());
  }
  if (model instanceof LevelHandle) {
    LevelHandle handle=(LevelHandle)model;
    DesignElementHandle temp=handle.getContainer();
    String dimensionName="String_Node_Str";
    while (temp != null) {
      if (temp instanceof org.eclipse.birt.report.model.api.olap.DimensionHandle) {
        dimensionName=((org.eclipse.birt.report.model.api.olap.DimensionHandle)temp).getName();
        break;
      }
      temp=temp.getContainer();
    }
    return ExpressionUtil.createJSDimensionExpression(dimensionName,handle.getName());
  }
  if (model instanceof MeasureHandle) {
    return ExpressionUtil.createJSMeasureExpression((((MeasureHandle)model)).getName());
  }
  if (model instanceof DataSetItemModel) {
    String colName=((DataSetItemModel)model).getAlias();
    if (colName == null || colName.trim().length() == 0) {
      colName=((DataSetItemModel)model).getName();
    }
    return getColumnExpression(colName);
  }
  if (model instanceof ComputedColumnHandle) {
    return getColumnExpression(((ComputedColumnHandle)model).getName());
  }
  if (model instanceof ResultSetColumnHandle) {
    return getResultSetColumnExpression(((ResultSetColumnHandle)model).getColumnName());
  }
  if (model instanceof DataSetParameterHandle) {
    return IReportElementConstants.STOREDPROCUDURE_OUTPUT_PREFIX + "String_Node_Str" + escape(((DataSetParameterHandle)model).getName())+ "String_Node_Str";
  }
  return null;
}
Program: 76533
Project: 76533
Buggy source:
public List convertSelectionToModelLisr(List list){
  List retValue=new ArrayList();
  int size=list.size();
  boolean isDummy=false;
  for (int i=0; i < size; i++) {
    Object object=list.get(i);
    if (!(object instanceof EditPart)) {
      continue;
    }
    EditPart part=(EditPart)object;
    if (part instanceof DummyEditpart) {
      retValue.add(part.getModel());
      isDummy=true;
    }
 else     if (isDummy) {
      break;
    }
 else     if (part.getModel() instanceof ListBandProxy) {
      retValue.add(((ListBandProxy)part.getModel()).getSlotHandle());
    }
 else {
      retValue.add(part.getModel());
    }
  }
  return retValue;
}

Fixed version (ground truth):
public List convertSelectionToModelLisr(List list){
  List retValue=new ArrayList();
  int size=list.size();
  boolean isDummy=false;
  for (int i=0; i < size; i++) {
    Object object=list.get(i);
    if (!(object instanceof EditPart)) {
      continue;
    }
    EditPart part=(EditPart)object;
    if (part instanceof DummyEditpart) {
      retValue.add(part.getModel());
      isDummy=true;
    }
 else     if (isDummy) {
      break;
    }
 else     if (part.getModel() instanceof ListBandProxy) {
      retValue.add(((ListBandProxy)part.getModel()).getSlotHandle());
    }
 else {
      Object model=part.getModel();
      if (model instanceof IAdaptable) {
        Object temp=((IAdaptable)model).getAdapter(DesignElementHandle.class);
        model=temp == null ? model : temp;
      }
      retValue.add(model);
    }
  }
  return retValue;
}
Program: 76534
Project: 76534
Buggy source:
/** 
 * Get the default width.
 * @param colNumber The column number.
 * @return The default width.
 */
public int getDefaultWidth(int colNumber){
  Dimension size=getFigure().getPreferredSize().shrink(getFigure().getInsets().getWidth(),getFigure().getInsets().getHeight());
  ;
  if (getRowCount() == 0) {
    return size.width;
  }
  int allNumbers=getColumnCount();
  if (allNumbers <= 0) {
    return size.width;
  }
  if (colNumber <= 0) {
    return size.width;
  }
  int width=size.width;
  int columnNumber=allNumbers;
  for (int i=1; i < columnNumber + 1; i++) {
    DimensionHandle dimHandle=getCrosstabHandleAdapter().getColumnWidth(colNumber);
    if (dimHandle != null && dimHandle.getMeasure() > 0) {
      allNumbers=allNumbers - 1;
      width=width - getColumnWidthValue(colNumber);
    }
 else     if (dimHandle == null) {
      ITableLayoutOwner.DimensionInfomation info=getColumnWidth(colNumber);
      if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(info.getUnits())) {
        Dimension dim=getFigure().getParent().getClientArea().getSize();
        int containerWidth=dim.width;
        width=width - ((int)(info.getMeasure() * containerWidth / 100));
      }
    }
  }
  if (colNumber == allNumbers) {
    return width / allNumbers + width % allNumbers;
  }
  return (width / allNumbers);
}

Fixed version (ground truth):
/** 
 * Get the default width.
 * @param colNumber The column number.
 * @return The default width.
 */
public int getDefaultWidth(int colNumber){
  Dimension size=getPreferredSize().shrink(getFigure().getInsets().getWidth(),getFigure().getInsets().getHeight());
  ;
  if (getRowCount() == 0) {
    return size.width;
  }
  int allNumbers=getColumnCount();
  if (allNumbers <= 0) {
    return size.width;
  }
  if (colNumber <= 0) {
    return size.width;
  }
  int width=size.width;
  int columnNumber=allNumbers;
  for (int i=1; i < columnNumber + 1; i++) {
    DimensionHandle dimHandle=getCrosstabHandleAdapter().getColumnWidth(colNumber);
    if (dimHandle != null && dimHandle.getMeasure() > 0) {
      allNumbers=allNumbers - 1;
      width=width - getColumnWidthValue(colNumber);
    }
 else     if (dimHandle == null) {
      ITableLayoutOwner.DimensionInfomation info=getColumnWidth(colNumber);
      if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(info.getUnits())) {
        Dimension dim=getFigure().getParent().getClientArea().getSize();
        int containerWidth=dim.width;
        width=width - ((int)(info.getMeasure() * containerWidth / 100));
      }
    }
  }
  if (colNumber == allNumbers) {
    return width / allNumbers + width % allNumbers;
  }
  return (width / allNumbers);
}
Program: 76535
Project: 76535
Buggy source:
/** 
 * @param ob1
 * @param ob2
 * @return
 */
public static int compareObjects(Object ob1,Object ob2){
  int result=0;
  if (ob1 == ob2) {
    return result;
  }
  if (ob1 == null || ob2 == null) {
    if (ob1 == null) {
      result=-1;
    }
 else {
      result=1;
    }
    return result;
  }
  if (ob1.equals(ob2)) {
    return result;
  }
 else   if (ob1 instanceof Comparable && ob2 instanceof Comparable) {
    Comparable comp1=(Comparable)ob1;
    Comparable comp2=(Comparable)ob2;
    if (ob1.getClass() != ob2.getClass() && ob1 instanceof Number && ob2 instanceof Number) {
      try {
        comp1=(Comparable)DataTypeUtil.toDouble(ob1);
        comp2=(Comparable)DataTypeUtil.toDouble(ob2);
      }
 catch (      BirtException ex) {
      }
    }
    result=comp1.compareTo(comp2);
  }
 else   if (ob1 instanceof Boolean && ob2 instanceof Boolean) {
    Boolean bool=(Boolean)ob1;
    if (bool.equals(Boolean.TRUE))     result=1;
 else     result=-1;
  }
 else {
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param ob1
 * @param ob2
 * @return
 */
public static int compareObjects(Object ob1,Object ob2){
  int result=0;
  if (ob1 == ob2) {
    return result;
  }
  if (ob1 == null || ob2 == null) {
    if (ob1 == null) {
      result=-1;
    }
 else {
      result=1;
    }
    return result;
  }
  if (ob1.equals(ob2)) {
    return result;
  }
 else   if (ob1 instanceof Comparable && ob2 instanceof Comparable) {
    Comparable comp1=(Comparable)ob1;
    Comparable comp2=(Comparable)ob2;
    if (ob1.getClass() != ob2.getClass()) {
      try {
        if (ob1 instanceof Number && ob2 instanceof Number) {
          comp1=DataTypeUtil.toDouble(ob1);
          comp2=DataTypeUtil.toDouble(ob2);
        }
 else         if (ob1 instanceof Date && ob2 instanceof Date) {
          comp1=DataTypeUtil.toDate(ob1);
          comp2=DataTypeUtil.toDate(ob1);
        }
      }
 catch (      BirtException ex) {
      }
    }
    result=comp1.compareTo(comp2);
  }
 else   if (ob1 instanceof Boolean && ob2 instanceof Boolean) {
    Boolean bool=(Boolean)ob1;
    if (bool.equals(Boolean.TRUE))     result=1;
 else     result=-1;
  }
 else {
  }
  return result;
}
Program: 76537
Project: 76537
Buggy source:
/** 
 * convert path from System Properties Definition. For example: ${java.io.tmpdir}
 * @param path
 * @return
 */
protected static String convertSystemPath(String path){
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(path);
  if (m.find()) {
    String sysPath=trimSep(System.getProperty(m.group(1).trim()));
    return DataUtil.trimString(sysPath) + m.group(2).trim();
  }
  return path;
}

Fixed version (ground truth):
/** 
 * convert path from System Properties Definition. For example: ${java.io.tmpdir}
 * @param path
 * @return
 */
protected static String convertSystemPath(String path){
  if (path == null)   return path;
  Pattern p=Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE);
  Matcher m=p.matcher(path);
  if (m.find()) {
    String sysPath=trimSep(System.getProperty(m.group(1).trim()));
    return DataUtil.trimString(sysPath) + m.group(2).trim();
  }
  return path;
}
Program: 76538
Project: 76538
Buggy source:
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  path=convertSystemPath(path);
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=trimSep(getRealPath(path,context));
  }
 else {
    realPath=trimSep(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=trimSep(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}

Fixed version (ground truth):
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  path=convertSystemPath(path);
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=trimSep(getRealPath(path,context));
  }
 else {
    realPath=trimSep(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=trimSep(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}
Program: 76539
Project: 76539
Buggy source:
public void testDesignStream(){
  try {
    IReportRunnable runnable=engine.openReportDesign(new FileInputStream(new File(REPORT_DESIGN)));
    IRunTask runTask=engine.createRunTask(runnable);
    runTask.run(REPORT_DOCUMENT);
    IReportDocument rptDoc=engine.openReportDocument(REPORT_DOCUMENT);
    InputStream inputStream=rptDoc.getDesignStream();
    assertTrue(inputStream != null);
    int streamLength=((RAFileInputStream)inputStream).available();
    assertTrue(streamLength > 0);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
public void testDesignStream(){
  try {
    IReportRunnable runnable=engine.openReportDesign(new FileInputStream(new File(REPORT_DESIGN)));
    IRunTask runTask=engine.createRunTask(runnable);
    runTask.run(REPORT_DOCUMENT);
    IReportDocument rptDoc=engine.openReportDocument(REPORT_DOCUMENT);
    InputStream inputStream=rptDoc.getDesignStream();
    assertTrue(inputStream != null);
    int streamLength=((RAInputStream)inputStream).available();
    assertTrue(streamLength > 0);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 76540
Project: 76540
Buggy source:
private void checkChartLengend(ContainerArea map,int x,int y,int width,int height,String hyperlink,String bookmark,String targetWindow){
  IContent mapContent=(IContent)map.getContent();
  IHyperlinkAction link=mapContent.getHyperlinkAction();
  assertEquals(x,map.getX());
  assertEquals(y,map.getY());
  assertEquals(width,map.getWidth());
  assertEquals(height,map.getHeight());
  assertEquals(hyperlink,link.getHyperlink());
  assertEquals(bookmark,link.getBookmark());
  assertEquals(targetWindow,link.getTargetWindow());
}

Fixed version (ground truth):
private void checkChartLengend(ContainerArea map,int x,int y,int width,int height,String hyperlink,String bookmark,String targetWindow){
  IContent mapContent=(IContent)map.getContent();
  IHyperlinkAction link=mapContent.getHyperlinkAction();
  assertEquals(x,map.getX());
  assertEquals(y,map.getY());
  assertEquals(width,map.getWidth());
  assertEquals(height,map.getHeight());
  assertTrue(link.getHyperlink().matches(hyperlink));
  assertEquals(bookmark,link.getBookmark());
  assertEquals(targetWindow,link.getTargetWindow());
}
Program: 76541
Project: 76541
Buggy source:
/** 
 * Can not store objects of this list property type directly. Call to this method will always throw an exception.
 */
public Object validateValue(Module module,PropertyDefn defn,Object value) throws PropertyValueException {
  if (value == null) {
    logger.log(Level.WARNING,"String_Node_Str");
    return null;
  }
  if (defn.isList()) {
    if (value instanceof List) {
      if (((List)value).isEmpty()) {
        return value;
      }
    }
    throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,STRUCT_TYPE);
  }
  if (value instanceof Structure) {
    logger.log(Level.INFO,"String_Node_Str");
    Iterator iter=((Structure)value).getDefn().propertiesIterator();
    while (iter.hasNext()) {
      PropertyDefn memberDefn=(PropertyDefn)iter.next();
      if (!memberDefn.isList()) {
        Object propValue=((Structure)value).getProperty(module,memberDefn);
        memberDefn.validateValue(module,propValue);
      }
    }
    return value;
  }
  logger.log(Level.WARNING,"String_Node_Str");
  throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,STRUCT_TYPE);
}

Fixed version (ground truth):
/** 
 * Can not store objects of this list property type directly. Call to this method will always throw an exception.
 */
public Object validateValue(Module module,PropertyDefn defn,Object value) throws PropertyValueException {
  if (value == null)   return null;
  if (defn.isList()) {
    if (value instanceof List) {
      if (((List)value).isEmpty()) {
        return value;
      }
    }
    throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,STRUCT_TYPE);
  }
  if (value instanceof Structure) {
    Iterator iter=((Structure)value).getDefn().propertiesIterator();
    while (iter.hasNext()) {
      PropertyDefn memberDefn=(PropertyDefn)iter.next();
      if (!memberDefn.isList()) {
        Object propValue=((Structure)value).getProperty(module,memberDefn);
        memberDefn.validateValue(module,propValue);
      }
    }
    return value;
  }
  logger.log(Level.WARNING,"String_Node_Str");
  throw new PropertyValueException(value,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE,STRUCT_TYPE);
}
Program: 76543
Project: 76543
Buggy source:
/** 
 */
protected void __checkDocumentExists() throws RemoteException {
  File file=new File(__docName);
  if (!file.exists()) {
    IActionHandler handler=new BirtRunReportActionHandler(context,operation,response);
    handler.execute();
  }
  file=new File(__docName);
  if (!file.exists()) {
    AxisFault fault=new AxisFault();
    fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_NO_REPORT_DOCUMENT));
    throw fault;
  }
 else {
    ViewerAttributeBean bean=(ViewerAttributeBean)context.getBean();
    if (bean.isDocumentProcessing()) {
      AxisFault fault=new AxisFault();
      fault.setFaultReason(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_FILE_PROCESSING));
      throw fault;
    }
  }
}

Fixed version (ground truth):
/** 
 */
protected void __checkDocumentExists() throws RemoteException {
  File file=new File(__docName);
  if (!file.exists()) {
    IActionHandler handler=new BirtRunReportActionHandler(context,operation,response);
    handler.execute();
  }
  file=new File(__docName);
  if (!file.exists()) {
    AxisFault fault=new AxisFault();
    fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_NO_REPORT_DOCUMENT));
    throw fault;
  }
 else {
    BaseAttributeBean bean=(BaseAttributeBean)context.getBean();
    if (bean.isDocumentProcessing()) {
      AxisFault fault=new AxisFault();
      fault.setFaultReason(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_FILE_PROCESSING));
      throw fault;
    }
  }
}
Program: 76544
Project: 76544
Buggy source:
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  path=convertSystemPath(path);
  if (isRelativePath(path)) {
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=getRealPath(path,context);
    if (realPath != null && makeDir(realPath)) {
      if (!canWrite)       return trimSep(realPath);
      try {
        if (canWrite && new File(realPath).canWrite())         return trimSep(realPath);
      }
 catch (      Exception e) {
      }
    }
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    realPath=trimSep(path);
  }
  makeDir(realPath);
  return realPath;
}

Fixed version (ground truth):
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  boolean isRelative=false;
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  path=convertSystemPath(path);
  if (isRelativePath(path)) {
    isRelative=true;
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=trimSep(getRealPath(path,context));
  }
 else {
    realPath=trimSep(path);
  }
  boolean flag=makeDir(realPath);
  if (!canWrite)   return realPath;
  if (flag) {
    try {
      if (canWrite && new File(realPath).canWrite())       return realPath;
    }
 catch (    Exception e) {
    }
  }
  if (isRelative) {
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    if (defaultPath != null)     realPath=trimSep(System.getProperty("String_Node_Str")) + File.separator + defaultPath;
  }
  makeDir(realPath);
  return realPath;
}
Program: 76545
Project: 76545
Buggy source:
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException 
 */
public void test_regression_155943() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libA=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY;
  sessionHandle=new DesignEngine(new DesignConfig()).newSessionHandle(ULocale.ENGLISH);
  designHandle=sessionHandle.openDesign(report);
  ExtendedItemHandle chart=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(chart);
  assertEquals("String_Node_Str",chart.getName());
  List list=new ArrayList();
  list.add(chart);
  SimpleGroupElementHandle group=new SimpleGroupElementHandle(designHandle,list);
  assertFalse(group.hasLocalPropertiesForExtendedElements());
  chart.setProperty(ReportItemHandle.WIDTH_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",chart.getProperty(ReportItemHandle.WIDTH_PROP).toString());
  assertTrue(group.hasLocalPropertiesForExtendedElements());
  group.clearLocalProperties();
  assertFalse(group.hasLocalPropertiesForExtendedElements());
}

Fixed version (ground truth):
/** 
 * @throws DesignFileException
 * @throws SemanticException
 * @throws IOException
 */
public void test_regression_155943() throws DesignFileException, SemanticException, IOException {
  String report=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ INPUT;
  String libA=getTempFolder() + "String_Node_Str" + INPUT_FOLDER+ "String_Node_Str"+ LIBRARY;
  openDesign(INPUT);
  ExtendedItemHandle chart=(ExtendedItemHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(chart);
  assertEquals("String_Node_Str",chart.getName());
  List elements=new ArrayList();
  elements.add(chart);
  GroupElementHandle group=new SimpleGroupElementHandle(designHandle,elements);
  assertEquals("String_Node_Str",chart.getProperty(ReportItemHandle.WIDTH_PROP).toString());
  assertFalse(group.hasLocalPropertiesForExtendedElements());
  chart.setProperty(ReportItemHandle.WIDTH_PROP,"String_Node_Str");
  assertFalse(group.hasLocalPropertiesForExtendedElements());
  group.clearLocalProperties();
  assertFalse(group.hasLocalPropertiesForExtendedElements());
}
Program: 76546
Project: 76546
Buggy source:
protected void handleSelectedEvent(){
  BigDecimal bigValue=new BigDecimal(spinner.getSelection());
  bigValue=bigValue.movePointLeft(spinner.getDigits());
  String value=bigValue.toString();
  if (provider.getUnit(combo.getText()) != null)   value+=provider.getUnit(combo.getText());
  try {
    save(value);
  }
 catch (  SemanticException e) {
    WidgetUtil.processError(combo.getShell(),e);
  }
}

Fixed version (ground truth):
protected void handleSelectedEvent(){
  if (isKeyPressed == true) {
    isKeyPressed=false;
    return;
  }
  BigDecimal bigValue=new BigDecimal(spinner.getSelection());
  bigValue=bigValue.movePointLeft(spinner.getDigits());
  String value=bigValue.toString();
  if (provider.getUnit(combo.getText()) != null)   value+=provider.getUnit(combo.getText());
  try {
    save(value);
  }
 catch (  SemanticException e) {
    WidgetUtil.processError(combo.getShell(),e);
  }
}
Program: 76548
Project: 76548
Buggy source:
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  if (isRelativePath(path)) {
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=getRealPath(path,context);
    if (realPath != null && makeDir(realPath)) {
      if (!canWrite)       return trimSep(realPath);
      try {
        if (canWrite && new File(realPath).canWrite())         return trimSep(realPath);
      }
 catch (      Exception e) {
      }
    }
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    realPath=trimSep(path);
  }
  makeDir(realPath);
  return realPath;
}

Fixed version (ground truth):
/** 
 * Process folder settings with absolute path. If path is a relative path, first relative to context. If set canWrite to true, then check the folder if writable.If not, relative to ${java.io.tmpdir} folder.
 * @param context
 * @param path
 * @param defaultPath
 * @param canWrite
 * @return
 */
public static String processRealPath(ServletContext context,String path,String defaultPath,boolean canWrite){
  String realPath=null;
  if (path == null || path.trim().length() <= 0) {
    path=DataUtil.trimString(defaultPath);
  }
  path=convertSystemPath(path);
  if (isRelativePath(path)) {
    if (!path.startsWith("String_Node_Str"))     path="String_Node_Str" + path;
    realPath=getRealPath(path,context);
    if (realPath != null && makeDir(realPath)) {
      if (!canWrite)       return trimSep(realPath);
      try {
        if (canWrite && new File(realPath).canWrite())         return trimSep(realPath);
      }
 catch (      Exception e) {
      }
    }
    realPath=trimSep(System.getProperty("String_Node_Str")) + path;
  }
 else {
    realPath=trimSep(path);
  }
  makeDir(realPath);
  return realPath;
}
Program: 76549
Project: 76549
Buggy source:
/** 
 * Process working folder setting. If path is a relative path, first relative to context.
 * @param context
 * @param path
 * @return
 */
public static String processWorkingFolder(ServletContext context,String path){
  path=DataUtil.trimString(path);
  String realPath=null;
  if (isRelativePath(path)) {
    realPath=getRealPath(path,context);
    makeDir(realPath);
    return trimSep(path);
  }
 else {
    realPath=path;
  }
  makeDir(realPath);
  return trimSep(realPath);
}

Fixed version (ground truth):
/** 
 * Process working folder setting. If path is a relative path, first relative to context.
 * @param context
 * @param path
 * @return
 */
public static String processWorkingFolder(ServletContext context,String path){
  path=convertSystemPath(DataUtil.trimString(path));
  String realPath=null;
  if (isRelativePath(path)) {
    realPath=getRealPath(path,context);
    makeDir(realPath);
    return trimSep(path);
  }
 else {
    realPath=path;
  }
  makeDir(realPath);
  return trimSep(realPath);
}
Program: 76550
Project: 76550
Buggy source:
public void buildUI(Composite parent){
  container=new ScrolledComposite(parent,SWT.V_SCROLL);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  ((ScrolledComposite)container).setExpandHorizontal(true);
  ((ScrolledComposite)container).setExpandVertical(true);
  container.addControlListener(new ControlAdapter(){
    public void controlResized(    ControlEvent e){
      computeSize();
    }
  }
);
  container.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      deRegisterEventManager();
    }
  }
);
  composite=new Composite(container,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (sections == null)   sections=new SortMap();
  composite.setLayout(WidgetUtil.createGridLayout(1));
  formSection=new FormSection(provider.getDisplayName(),composite,true,isTabbed);
  formSection.setProvider(provider);
  formSection.setButtonWithDialog(withDialog);
  formSection.setStyle(style);
  formSection.setFillForm(true);
  addSection(PageSectionId.FORM_FORM,formSection);
  createSections();
  layoutSections();
  ((ScrolledComposite)container).setContent(composite);
}

Fixed version (ground truth):
public void buildUI(Composite parent){
  container=new ScrolledComposite(parent,SWT.V_SCROLL | SWT.H_SCROLL);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  ((ScrolledComposite)container).setExpandHorizontal(true);
  ((ScrolledComposite)container).setExpandVertical(true);
  container.addControlListener(new ControlAdapter(){
    public void controlResized(    ControlEvent e){
      computeSize();
    }
  }
);
  container.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      deRegisterEventManager();
    }
  }
);
  composite=new Composite(container,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  if (sections == null)   sections=new SortMap();
  composite.setLayout(WidgetUtil.createGridLayout(1));
  formSection=new FormSection(provider.getDisplayName(),composite,true,isTabbed);
  formSection.setProvider(provider);
  formSection.setButtonWithDialog(withDialog);
  formSection.setStyle(style);
  formSection.setFillForm(true);
  addSection(PageSectionId.FORM_FORM,formSection);
  createSections();
  layoutSections();
  ((ScrolledComposite)container).setContent(composite);
}
Program: 76551
Project: 76551
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 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.
 */
public static void startEngineLogging(String directoryName,Level logLevel){
  dirName=directoryName;
  Logger logger=Logger.getLogger(BIRT_NAME_SPACE);
  assert(logger != null);
  if (logLevel != null)   logger.setLevel(logLevel);
  createLogFile(logger);
}

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 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.
 */
public static void startEngineLogging(String directoryName,Level logLevel){
  dirName=directoryName;
  Logger logger=Logger.getLogger(BIRT_NAME_SPACE);
  assert(logger != null);
  if (logLevel != null)   logger.setLevel(logLevel);
  if (logger.getLevel() != Level.OFF) {
    createLogFile(logger);
  }
}
Program: 76552
Project: 76552
Buggy source:
private void initValueArea(){
  if (isStatic()) {
    if (DesignChoiceConstants.PARAM_CONTROL_CHECK_BOX.equals(getSelectedControlType())) {
      if (isValidValue(defaultValue) != null) {
        defaultValue=null;
        defaultValueChooser.select(0);
      }
 else {
        if (Boolean.valueOf(defaultValue).booleanValue()) {
          defaultValueChooser.select(1);
        }
 else {
          defaultValueChooser.select(2);
        }
      }
    }
 else     if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) && defaultValue != null) {
      if (defaultValue.equals(Boolean.toString(true)) || defaultValue.equals(Boolean.toString(false))) {
        defaultValue=null;
      }
 else {
        defaultValueEditor.setText(defaultValue);
      }
    }
 else {
      defaultValue=null;
    }
    refreshValueTable();
  }
 else {
    refreshDataSets();
    if (inputParameter.getDataSetName() != null) {
      dataSetChooser.setText(inputParameter.getDataSetName());
    }
    refreshColumns(false);
    String columnName=getColumnName(inputParameter.getValueExpr());
    if (columnName != null) {
      columnChooser.setText(columnName);
    }
    columnName=getColumnName(inputParameter.getLabelExpr());
    if (columnName != null) {
      displayTextChooser.setText(columnName);
    }
    if (defaultValue != null) {
      defaultValueEditor.setText(defaultValue);
    }
  }
  updateMessageLine();
}

Fixed version (ground truth):
private void initValueArea(){
  if (isStatic()) {
    if (DesignChoiceConstants.PARAM_CONTROL_CHECK_BOX.equals(getSelectedControlType())) {
      if (isValidValue(defaultValue) != null) {
        defaultValue=null;
        defaultValueChooser.select(0);
      }
 else {
        if (Boolean.valueOf(defaultValue).booleanValue()) {
          defaultValueChooser.select(1);
        }
 else {
          defaultValueChooser.select(2);
        }
      }
    }
 else     if (DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX.equals(getSelectedControlType()) && defaultValue != null) {
      if (defaultValue.equals(Boolean.toString(true)) || defaultValue.equals(Boolean.toString(false))) {
        defaultValue=null;
      }
 else {
        defaultValueEditor.setText(defaultValue);
      }
    }
    refreshValueTable();
  }
 else {
    refreshDataSets();
    if (inputParameter.getDataSetName() != null) {
      dataSetChooser.setText(inputParameter.getDataSetName());
    }
    refreshColumns(false);
    String columnName=getColumnName(inputParameter.getValueExpr());
    if (columnName != null) {
      columnChooser.setText(columnName);
    }
    columnName=getColumnName(inputParameter.getLabelExpr());
    if (columnName != null) {
      displayTextChooser.setText(columnName);
    }
    if (defaultValue != null) {
      defaultValueEditor.setText(defaultValue);
    }
  }
  updateMessageLine();
}