nus-yam/ex-repair huggingface dataset:
Program: 77396
Project: 77396
Buggy source:
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (this.isDesigner && !IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()))   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (documentInUrl)   this.missingParameter=false;
 else   this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
  this.parametersAsString=getParsedParametersAsStringWithDefaultValue(this.parametersAsString,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
  this.displayTexts=getDisplayTexts(this.displayTexts,request);
}

Fixed version (ground truth):
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  if (this.reportDesignHandle == null)   return;
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=getParameterList();
  if (this.isDesigner && !IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath()))   parseConfigVars(request,parameterList);
  this.parametersAsString=getParsedParametersAsString(parameterList,request,options);
  this.parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (documentInUrl)   this.missingParameter=false;
 else   this.missingParameter=validateParameters(parameterDefList,this.parametersAsString);
  this.parametersAsString=getParsedParametersAsStringWithDefaultValue(this.parametersAsString,request,options);
  this.parameters=(HashMap)getParsedParameters(this.reportDesignHandle,parameterList,request,options);
  this.displayTexts=getDisplayTexts(this.displayTexts,request);
}
Program: 77398
Project: 77398
Buggy source:
/** 
 * Returns the resource handle with the locale of this thread. The resource handle will be cached.
 * @return the resource handle with the locale of this thread
 */
private static ViewerResourceHandle getResourceHandle(){
  Locale locale=getLocale();
  ViewerResourceHandle resourceHandle=(ViewerResourceHandle)resourceMap.get(locale);
  if (resourceHandle != null)   return resourceHandle;
synchronized (resourceMap) {
    if (resourceMap.get(locale) != null)     return (ViewerResourceHandle)resourceMap.get(locale);
    resourceHandle=new ViewerResourceHandle(locale);
    resourceMap.put(locale,resourceHandle);
  }
  return resourceHandle;
}

Fixed version (ground truth):
/** 
 * Returns the resource handle with the locale of this thread. The resource handle will be cached.
 * @return the resource handle with the locale of this thread
 */
public static ViewerResourceHandle getResourceHandle(){
  Locale locale=getLocale();
  ViewerResourceHandle resourceHandle=(ViewerResourceHandle)resourceMap.get(locale);
  if (resourceHandle != null)   return resourceHandle;
synchronized (resourceMap) {
    if (resourceMap.get(locale) != null)     return (ViewerResourceHandle)resourceMap.get(locale);
    resourceHandle=new ViewerResourceHandle(locale);
    resourceMap.put(locale,resourceHandle);
  }
  return resourceHandle;
}
Program: 77403
Project: 77403
Buggy source:
public Object getAdapter(Class adapter){
  if (adapter == ActionRegistry.class) {
    return jsEditor.getActionRegistry();
  }
  if (adapter == PalettePage.class) {
    return jsEditor.getAdapter(PalettePage.class);
  }
  if (adapter == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(getModel());
    return outlinePage;
  }
  return jsEditor.getAdapter(adapter);
}

Fixed version (ground truth):
public Object getAdapter(Class adapter){
  if (adapter == ActionRegistry.class) {
    return jsEditor.getActionRegistry();
  }
  if (adapter == PalettePage.class) {
    return jsEditor.getAdapter(PalettePage.class);
  }
  if (adapter == IContentOutlinePage.class) {
    DesignerOutlinePage outlinePage=new DesignerOutlinePage(getModel());
    getModelEventManager().addModelEventProcessor(outlinePage.getModelProcessor());
    return outlinePage;
  }
  return jsEditor.getAdapter(adapter);
}
Program: 77404
Project: 77404
Buggy source:
public void dispose(){
  super.dispose();
  jsEditor.dispose();
  jsEditor=null;
}

Fixed version (ground truth):
public void dispose(){
  unhookModelEventManager(getModel());
  super.dispose();
  jsEditor.dispose();
  jsEditor=null;
}
Program: 77405
Project: 77405
Buggy source:
public void createPartControl(Composite parent){
  try {
    jsEditor.createPartControl(parent);
    Control[] children=parent.getChildren();
    control=children[children.length - 1];
    if (previouPage != null) {
      onBroughtToTop(previouPage);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void createPartControl(Composite parent){
  try {
    jsEditor.createPartControl(parent);
    Control[] children=parent.getChildren();
    control=children[children.length - 1];
    if (previouPage != null) {
      onBroughtToTop(previouPage);
    }
    hookModelEventManager(getModel());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 77407
Project: 77407
Buggy source:
/** 
 * Justifies whether a library resource with the given file name is a valid library.
 * @param sessionHandle the current session of the library
 * @param fileName the file name of the library
 * @param is the input stream of the library
 * @return true if the library resource is a valid library, otherwise false
 */
public static boolean isValidLibrary(SessionHandle sessionHandle,String fileName,InputStream is){
  Library lib=null;
  try {
    lib=LibraryReader.getInstance().read(sessionHandle.getSession(),fileName,is);
    return lib != null;
  }
 catch (  DesignFileException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Justifies whether a library resource with the given file name is a valid library.
 * @param sessionHandle the current session of the library
 * @param fileName the file name of the library
 * @param is the input stream of the library
 * @return true if the library resource is a valid library, otherwise false
 */
public static boolean isValidLibrary(SessionHandle sessionHandle,String fileName,InputStream is){
  Library lib=null;
  try {
    ModuleOption options=new ModuleOption();
    options.setSemanticCheck(false);
    lib=LibraryReader.getInstance().read(sessionHandle.getSession(),fileName,is,options);
    return lib != null;
  }
 catch (  DesignFileException e) {
    return false;
  }
}
Program: 77408
Project: 77408
Buggy source:
/** 
 * Checks the input stream with given file name. If it is a valid design/library, return <code>ModuleUtil.REPORT_DESIGN</code>/<code>ModuleUtil.LIBRARY</code>, otherwise, <code>ModuleUtil.INVALID</code> is return.
 * @param sessionHandle the current session of the library
 * @param fileName the file name of the library
 * @param is the input stream of the library
 * @return <code>ModuleUtil.REPORT_DESIGN</code> if the input stream is areport design, <code>ModuleUtil.LIBRARY</code> if the input stream is a library, <code>ModuleUtil.INVALID</code> otherwise.
 */
public static int checkModule(SessionHandle sessionHandle,String fileName,InputStream is){
  Module rtnModule=null;
  try {
    rtnModule=GenericModuleReader.getInstance().read(sessionHandle.getSession(),fileName,is);
  }
 catch (  DesignFileException e) {
    return INVALID_MODULE;
  }
  return rtnModule instanceof Library ? LIBRARY : REPORT_DESIGN;
}

Fixed version (ground truth):
/** 
 * Checks the input stream with given file name. If it is a valid design/library, return <code>ModuleUtil.REPORT_DESIGN</code>/<code>ModuleUtil.LIBRARY</code>, otherwise, <code>ModuleUtil.INVALID</code> is return.
 * @param sessionHandle the current session of the library
 * @param fileName the file name of the library
 * @param is the input stream of the library
 * @return <code>ModuleUtil.REPORT_DESIGN</code> if the input stream is areport design, <code>ModuleUtil.LIBRARY</code> if the input stream is a library, <code>ModuleUtil.INVALID</code> otherwise.
 */
public static int checkModule(SessionHandle sessionHandle,String fileName,InputStream is){
  Module rtnModule=null;
  try {
    ModuleOption options=new ModuleOption();
    options.setSemanticCheck(false);
    rtnModule=GenericModuleReader.getInstance().read(sessionHandle.getSession(),fileName,is,options);
  }
 catch (  DesignFileException e) {
    return INVALID_MODULE;
  }
  return rtnModule instanceof Library ? LIBRARY : REPORT_DESIGN;
}
Program: 77409
Project: 77409
Buggy source:
/** 
 * Justifies whether a given input stream is a valid report design.
 * @param sessionHandle the current session of the report design
 * @param fileName the file name of the report design
 * @param is the input stream of the report design
 * @return true if the input stream is a valid report design, otherwisefalse
 */
public static boolean isValidDesign(SessionHandle sessionHandle,String fileName,InputStream is){
  ReportDesign design=null;
  try {
    design=DesignReader.getInstance().read(sessionHandle.getSession(),fileName,is);
    return design != null;
  }
 catch (  DesignFileException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Justifies whether a given input stream is a valid report design.
 * @param sessionHandle the current session of the report design
 * @param fileName the file name of the report design
 * @param is the input stream of the report design
 * @return true if the input stream is a valid report design, otherwisefalse
 */
public static boolean isValidDesign(SessionHandle sessionHandle,String fileName,InputStream is){
  ReportDesign design=null;
  try {
    ModuleOption options=new ModuleOption();
    options.setSemanticCheck(false);
    design=DesignReader.getInstance().read(sessionHandle.getSession(),fileName,is,options);
    return design != null;
  }
 catch (  DesignFileException e) {
    return false;
  }
}
Program: 77410
Project: 77410
Buggy source:
/** 
 * Checks whether the compound element is valid if the element has no extends property value or if the current element is compound elements and extends value is unresovled.
 * @return <code>true</code> if the compound element is valid. Otherwise<code>false</code>.
 */
public boolean isValidReferenceForCompoundElement(){
  ElementRefValue refValue=(ElementRefValue)element.getLocalProperty(getModule(),IDesignElementModel.EXTENDS_PROP);
  if (refValue == null)   return true;
  if (element.getDefn().isContainer() && !refValue.isResolved())   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the compound element is valid if the element has no extends property value or if the current element is compound elements and extends value is unresovled.
 * @return <code>true</code> if the compound element is valid. Otherwise<code>false</code>.
 */
public boolean isValidReferenceForCompoundElement(){
  return ModelUtil.isValidReferenceForCompoundElement(getModule(),element);
}
Program: 77411
Project: 77411
Buggy source:
/** 
 * Sends the notifications. This method check the current record state, and fire event to corresponding method of listener.
 * @param event activity stack event.
 */
protected void sendNotifcations(ActivityStackEvent event){
  if (listeners != null) {
    Iterator iter=listeners.iterator();
    while (iter.hasNext()) {
      ActivityStackListener listener=((ActivityStackListener)iter.next());
      listener.stackChanged(event);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends the notifications. This method check the current record state, and fire event to corresponding method of listener.
 * @param event activity stack event.
 */
public void sendNotifcations(ActivityStackEvent event){
  if (listeners != null) {
    Iterator iter=listeners.iterator();
    while (iter.hasNext()) {
      ActivityStackListener listener=((ActivityStackListener)iter.next());
      listener.stackChanged(event);
    }
  }
}
Program: 77412
Project: 77412
Buggy source:
protected void sendNotifcations(ActivityStackEvent event){
}

Fixed version (ground truth):
public void sendNotifcations(ActivityStackEvent event){
}
Program: 77413
Project: 77413
Buggy source:
/** 
 * Add script lib
 * @param scriptLib script lib
 * @throws SemanticException
 */
public void addScriptLib(ScriptLib scriptLib) throws SemanticException {
  ElementPropertyDefn propDefn=module.getPropertyDefn(SCRIPTLIBS_PROP);
  if (scriptLib == null || StringUtil.isBlank(scriptLib.getName())) {
    throw new PropertyValueException(getElement(),propDefn,scriptLib,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE);
  }
  if (findScriptLib(scriptLib.getName()) != null) {
    throw new NameException(getElement(),scriptLib.getName(),NameException.DESIGN_EXCEPTION_DUPLICATE);
  }
  PropertyCommand cmd=new PropertyCommand(getModule(),getElement());
  cmd.addItem(new CachedMemberRef(propDefn),scriptLib);
}

Fixed version (ground truth):
/** 
 * Add script lib
 * @param scriptLib script lib
 * @throws SemanticException
 */
public void addScriptLib(ScriptLib scriptLib) throws SemanticException {
  ElementPropertyDefn propDefn=module.getPropertyDefn(SCRIPTLIBS_PROP);
  if (scriptLib == null || StringUtil.isBlank(scriptLib.getName())) {
    throw new PropertyValueException(getElement(),propDefn,scriptLib,PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE);
  }
  PropertyCommand cmd=new PropertyCommand(getModule(),getElement());
  cmd.addItem(new CachedMemberRef(propDefn),scriptLib);
}
Program: 77414
Project: 77414
Buggy source:
/** 
 * Returns all script libs.
 * @return list which structure is <code>ScriptLib</code>
 */
public List getAllScriptLibs(){
  return getListProperty(SCRIPTLIBS_PROP);
}

Fixed version (ground truth):
/** 
 * Returns all script libs.
 * @return list which structure is <code>ScriptLibHandle</code>
 */
public List getAllScriptLibs(){
  return getFilteredStructureList(SCRIPTLIBS_PROP,ScriptLib.SCRIPTLIB_NAME_MEMBER);
}
Program: 77416
Project: 77416
Buggy source:
private void startContent(IContent content,String tag,String styleName){
  tagStack.push(tag);
  writer.openTag(tag);
  writer.attribute(HTMLTags.ATTR_CLASS,styleName);
  setActiveIDTypeIID(content);
  HTMLEmitterUtil.setBookmark(writer,tag,content.getBookmark());
}

Fixed version (ground truth):
private void startContent(IContent content,String tag,String styleName){
  tagStack.push(tag);
  writer.openTag(tag);
  if (content.getBookmark() == null) {
    content.setBookmark(idGenerator.generateUniqueID());
  }
  writer.attribute(HTMLTags.ATTR_CLASS,styleName);
  setActiveIDTypeIID(content);
  HTMLEmitterUtil.setBookmark(writer,tag,content.getBookmark());
}
Program: 77419
Project: 77419
Buggy source:
/** 
 * @param event
 */
private void populateEventData(TypedEvent event){
  TreeItem[] selection=availableDbObjectsTree.getSelection();
  if (selection == null)   selection=selectionMac;
  String identifierQuoteString;
  try {
    identifierQuoteString=metaDataProvider.getMetaData().getIdentifierQuoteString();
  }
 catch (  SQLException e) {
    identifierQuoteString="String_Node_Str";
  }
  if (selection.length > 0) {
    String data="String_Node_Str";
    for (int i=0; i < selection.length; i++) {
      Object obj=selection[i].getData();
      if (obj instanceof DbObject) {
        data+=SQLUtility.getDnDString(((DbObject)obj).getName(),identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
 else       if (obj instanceof Procedure) {
        data+=SQLUtility.getDnDString(((Procedure)obj).getProcedureNameWithSchema(),identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
 else {
        data+=SQLUtility.getDnDString(obj,identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
      data+=i != selection.length - 1 ? "String_Node_Str" : "String_Node_Str";
    }
    event.data=data;
  }
}

Fixed version (ground truth):
/** 
 * @param event
 */
private void populateEventData(TypedEvent event){
  TreeItem[] selection=availableDbObjectsTree.getSelection();
  if (selection == null || selection.length == 0)   selection=selectionMac;
  String identifierQuoteString;
  try {
    identifierQuoteString=metaDataProvider.getMetaData().getIdentifierQuoteString();
  }
 catch (  SQLException e) {
    identifierQuoteString="String_Node_Str";
  }
  if (selection.length > 0) {
    String data="String_Node_Str";
    for (int i=0; i < selection.length; i++) {
      Object obj=selection[i].getData();
      if (obj instanceof DbObject) {
        data+=SQLUtility.getDnDString(((DbObject)obj).getName(),identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
 else       if (obj instanceof Procedure) {
        data+=SQLUtility.getDnDString(((Procedure)obj).getProcedureNameWithSchema(),identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
 else {
        data+=SQLUtility.getDnDString(obj,identifierQuoteString,identifierQuoteStringCheckBox.getSelection());
      }
      data+=i != selection.length - 1 ? "String_Node_Str" : "String_Node_Str";
    }
    event.data=data;
  }
}
Program: 77420
Project: 77420
Buggy source:
protected Object clone() throws CloneNotSupportedException {
  ReferencableStructure struct=(ReferencableStructure)super.clone();
  struct.libReference=null;
  struct.clients=new ArrayList();
  struct.clientStructures=new ArrayList();
  Iterator propIter=getDefn().getPropertyIterator();
  while (propIter.hasNext()) {
    PropertyDefn prop=(PropertyDefn)propIter.next();
    if (struct.getLocalProperty(null,prop) != null || LIB_REFERENCE_MEMBER.equals(prop.getName()))     continue;
    StructRefValue libRef=this.libReference;
    while (libRef != null) {
      ReferencableStructure libStructure=libReference.getTargetStructure();
      Object value=libStructure.getLocalProperty(null,prop);
      if (value != null)       struct.setProperty(prop,value);
      libRef=(StructRefValue)libStructure.getLocalProperty(null,LIB_REFERENCE_MEMBER);
    }
  }
  return struct;
}

Fixed version (ground truth):
protected Object clone() throws CloneNotSupportedException {
  ReferencableStructure struct=(ReferencableStructure)super.clone();
  struct.libReference=null;
  struct.clients=new ArrayList();
  struct.clientStructures=new ArrayList();
  if (libReference == null)   return struct;
  Iterator propIter=getDefn().getPropertyIterator();
  while (propIter.hasNext()) {
    PropertyDefn prop=(PropertyDefn)propIter.next();
    if (struct.getLocalProperty(null,prop) != null || LIB_REFERENCE_MEMBER.equals(prop.getName()))     continue;
    StructRefValue libRef=this.libReference;
    while (libRef != null) {
      ReferencableStructure libStructure=libRef.getTargetStructure();
      if (libStructure == null) {
        struct.libReference=new StructRefValue(libReference.getLibraryNamespace(),libReference.getName());
        return struct;
      }
      Object value=libStructure.getLocalProperty(null,prop);
      if (value != null) {
        struct.setProperty(prop,value);
        break;
      }
      libRef=(StructRefValue)libStructure.getLocalProperty(null,LIB_REFERENCE_MEMBER);
    }
  }
  return struct;
}
Program: 77421
Project: 77421
Buggy source:
public void run(){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(DISPLAY_TEXT);
  try {
    if (Policy.TRACING_ACTIONS) {
      System.out.println("String_Node_Str");
    }
    Object newElement=InsertInLayoutUtil.performInsert(getSelection(),getTargetEditPart());
    if (newElement != null)     runCreate(newElement,targetPart.getModel());
    stack.commit();
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    stack.rollback();
  }
}

Fixed version (ground truth):
public void run(){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans(DISPLAY_TEXT);
  try {
    if (Policy.TRACING_ACTIONS) {
      System.out.println("String_Node_Str");
    }
    Object newElement=InsertInLayoutUtil.performInsert(getSelection(),getTargetEditPart());
    if (newElement != null)     runCreate(newElement,targetPart.getModel());
    stack.commit();
    fireCreateRequest(newElement);
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    stack.rollback();
  }
}
Program: 77422
Project: 77422
Buggy source:
protected ClassLoader createClassLoaderFromDesign(ClassLoader parent){
  IReportRunnable runnable=context.getRunnable();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    ArrayList urls=new ArrayList();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLib lib=(ScriptLib)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
    }
    if (urls.size() != 0) {
      URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
      return new URLClassLoader(jarUrls,parent);
    }
    return parent;
  }
  return null;
}

Fixed version (ground truth):
protected void createClassLoaderFromDesign(){
  IReportRunnable runnable=context.getRunnable();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    ArrayList urls=new ArrayList();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY);
      if (url != null) {
        urls.add(url);
      }
    }
    if (urls.size() != 0) {
      URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
      ClassLoader parent=appClassLoader == null ? systemClassLoader : appClassLoader;
      designClassLoader=new URLClassLoader(jarUrls,parent);
    }
  }
}
Program: 77423
Project: 77423
Buggy source:
protected ClassLoader createClassLoaderFromContext(ClassLoader parent){
  Map appContext=context.getAppContext();
  if (appContext != null) {
    Object appLoader=appContext.get(EngineConstants.APPCONTEXT_CLASSLOADER_KEY);
    if (appLoader instanceof ClassLoader) {
      return new UnionClassLoader((ClassLoader)appLoader,parent);
    }
  }
  return parent;
}

Fixed version (ground truth):
protected void createClassLoaderFromContext(){
  Map appContext=context.getAppContext();
  if (appContext != null) {
    Object appLoader=appContext.get(EngineConstants.APPCONTEXT_CLASSLOADER_KEY);
    if (appLoader instanceof ClassLoader) {
      appClassLoader=new UnionClassLoader((ClassLoader)appLoader,systemClassLoader);
    }
  }
}
Program: 77424
Project: 77424
Buggy source:
protected ClassLoader createClassLoaderFromProperty(){
  ClassLoader parent=ExecutionContext.class.getClassLoader();
  ArrayList urls=new ArrayList();
  for (int i=0; i < classPathes.length; i++) {
    String classPath=System.getProperty(classPathes[i]);
    if (classPath != null && classPath.length() != 0) {
      String[] jars=classPath.split(PROPERTYSEPARATOR,-1);
      if (jars != null && jars.length != 0) {
        for (int j=0; j < jars.length; j++) {
          File file=new File(jars[j]);
          try {
            urls.add(file.toURL());
          }
 catch (          MalformedURLException e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
  if (urls.size() != 0) {
    return new URLClassLoader((URL[])urls.toArray(new URL[0]),parent);
  }
  return parent;
}

Fixed version (ground truth):
protected void createClassLoaderFromProperty(){
  systemClassLoader=ExecutionContext.class.getClassLoader();
  ArrayList urls=new ArrayList();
  for (int i=0; i < classPathes.length; i++) {
    String classPath=System.getProperty(classPathes[i]);
    if (classPath != null && classPath.length() != 0) {
      String[] jars=classPath.split(PROPERTYSEPARATOR,-1);
      if (jars != null && jars.length != 0) {
        for (int j=0; j < jars.length; j++) {
          File file=new File(jars[j]);
          try {
            urls.add(file.toURL());
          }
 catch (          MalformedURLException e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
  if (urls.size() != 0) {
    systemClassLoader=new URLClassLoader((URL[])urls.toArray(new URL[0]),systemClassLoader);
  }
}
Program: 77425
Project: 77425
Buggy source:
public static Date convertToDate(String xmlString) throws ParseException {
  String pattern=null;
  if (xmlString.indexOf('T') != -1) {
    if (xmlString.indexOf('.') != -1) {
      pattern=XMLDATE_PATTERN_FULL;
    }
 else     if (xmlString.indexOf(':') == xmlString.lastIndexOf(':')) {
      pattern=XMLDATE_PATTERN_WITH_OUT_SECOND;
    }
 else {
      pattern=XMLDATE_PATTERN_WITH_OUT_MILLISECOND;
    }
  }
 else {
    pattern=XMLDATE_PATTERN_DATE_ONLY;
  }
  DateFormatter formater=new DateFormatter(pattern);
  return formater.parse(xmlString);
}

Fixed version (ground truth):
public static Date convertToDate(String xmlString) throws ParseException {
  if (StringUtil.isBlank(xmlString)) {
    return null;
  }
  String pattern=null;
  if (xmlString.indexOf('T') != -1) {
    if (xmlString.indexOf('.') != -1) {
      pattern=XMLDATE_PATTERN_FULL;
    }
 else     if (xmlString.indexOf(':') == xmlString.lastIndexOf(':')) {
      pattern=XMLDATE_PATTERN_WITH_OUT_SECOND;
    }
 else {
      pattern=XMLDATE_PATTERN_WITH_OUT_MILLISECOND;
    }
  }
 else {
    pattern=XMLDATE_PATTERN_DATE_ONLY;
  }
  DateFormatter formater=new DateFormatter(pattern);
  return formater.parse(xmlString);
}
Program: 77426
Project: 77426
Buggy source:
public static String convertToXMLString(Date date){
  GregorianCalendar cal=new GregorianCalendar();
  cal.setTime(date);
  String pattern=XMLDATE_PATTERN_FULL;
  if (!cal.isSet(Calendar.HOUR)) {
    pattern=XMLDATE_PATTERN_DATE_ONLY;
  }
 else   if (!cal.isSet(Calendar.SECOND)) {
    pattern=XMLDATE_PATTERN_WITH_OUT_SECOND;
  }
 else   if (!cal.isSet(Calendar.MILLISECOND)) {
    pattern=XMLDATE_PATTERN_WITH_OUT_MILLISECOND;
  }
  DateFormatter formater=new DateFormatter(pattern);
  return formater.format(date);
}

Fixed version (ground truth):
public static String convertToXMLString(Date date){
  if (date == null) {
    return null;
  }
  GregorianCalendar cal=new GregorianCalendar();
  cal.setTime(date);
  String pattern=XMLDATE_PATTERN_FULL;
  if (!cal.isSet(Calendar.HOUR)) {
    pattern=XMLDATE_PATTERN_DATE_ONLY;
  }
 else   if (!cal.isSet(Calendar.SECOND)) {
    pattern=XMLDATE_PATTERN_WITH_OUT_SECOND;
  }
 else   if (!cal.isSet(Calendar.MILLISECOND)) {
    pattern=XMLDATE_PATTERN_WITH_OUT_MILLISECOND;
  }
  DateFormatter formater=new DateFormatter(pattern);
  return formater.format(date);
}
Program: 77427
Project: 77427
Buggy source:
private String convertToStandardFormat(Date date){
  return new DateFormatter(STANDARD_DATE_TIME_PATTERN,ULocale.US).format(date);
}

Fixed version (ground truth):
private String convertToStandardFormat(Date date){
  if (date == null) {
    return null;
  }
  return new DateFormatter(STANDARD_DATE_TIME_PATTERN,ULocale.US).format(date);
}
Program: 77428
Project: 77428
Buggy source:
/** 
 * Add the particles and attributes that defined in an implicitly defined ComplexType to the node.
 * @param node
 * @param complexType
 * @throws OdaException 
 */
private static void addParticleAndAttributeInfo(ATreeNode node,XSComplexTypeDecl complexType,ATreeNode complexTypesRoot) throws OdaException {
  XSParticle particle=complexType.getParticle();
  if (particle != null) {
    XSObjectList list=((XSModelGroupImpl)particle.getTerm()).getParticles();
    for (int j=0; j < list.getLength(); j++) {
      ATreeNode childNode=new ATreeNode();
      childNode.setValue(((XSParticleDecl)list.item(j)).getTerm().getName());
      String dataType=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition().getName();
      if (dataType == null || dataType.length() == 0)       dataType=childNode.getValue().toString();
      childNode.setDataType(dataType);
      childNode.setType(ATreeNode.ELEMENT_TYPE);
      XSTypeDefinition xstype=((XSElementDecl)((XSParticleDecl)list.item(j)).getTerm()).getTypeDefinition();
      if ((!dataType.equals("String_Node_Str")) && xstype instanceof XSComplexTypeDecl) {
        if (xstype.getName() == null)         addParticleAndAttributeInfo(childNode,(XSComplexTypeDecl)xstype,complexTypesRoot);
        ATreeNode n=findComplexElement(complexTypesRoot,dataType);
        if (n != null) {
          childNode.addChild(n.getChildren());
        }
      }
      node.addChild(childNode);
    }
  }
  if (!includeAttribute)   return;
  XSAttributeGroupDecl group=complexType.getAttrGrp();
  if (group != null) {
    XSObjectList list=group.getAttributeUses();
    for (int j=0; j < list.getLength(); j++) {
      ATreeNode childNode=new ATreeNode();
      childNode.setValue(((XSAttributeUseImpl)list.item(j)).getAttrDeclaration().getName());
      childNode.setType(ATreeNode.ATTRIBUTE_TYPE);
      node.addChild(childNode);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add the particles and attributes that defined in an implicitly defined ComplexType to the node.
 * @param node
 * @param complexType
 * @throws OdaException 
 */
private static void addParticleAndAttributeInfo(ATreeNode node,XSComplexTypeDecl complexType,ATreeNode complexTypesRoot) throws OdaException {
  XSParticle particle=complexType.getParticle();
  if (particle != null) {
    addElementToNode(node,complexTypesRoot,(XSModelGroupImpl)particle.getTerm());
  }
  if (!includeAttribute)   return;
  XSAttributeGroupDecl group=complexType.getAttrGrp();
  if (group != null) {
    XSObjectList list=group.getAttributeUses();
    for (int j=0; j < list.getLength(); j++) {
      ATreeNode childNode=new ATreeNode();
      childNode.setValue(((XSAttributeUseImpl)list.item(j)).getAttrDeclaration().getName());
      childNode.setType(ATreeNode.ATTRIBUTE_TYPE);
      node.addChild(childNode);
    }
  }
}
Program: 77429
Project: 77429
Buggy source:
/** 
 * is in factory mode
 * @return true, factory mode, false not in factory mode
 */
public boolean isInFactory(){
  return factoryMode;
}

Fixed version (ground truth):
/** 
 * is in factory mode
 * @return true, factory mode, false not in factory mode
 */
public boolean isInFactory(){
  return true;
}
Program: 77430
Project: 77430
Buggy source:
/** 
 * Determines if the slot can contain a given element.
 * @param module the module
 * @param slotId the slot id
 * @param element the element to insert
 * @return a list containing exceptions.
 */
public final List checkContainmentContext(Module module,int slotId,DesignElement element){
  boolean retValue=canContainInRom(slotId,element.getDefn());
  ContentException e=new ContentException(this,slotId,element,ContentException.DESIGN_EXCEPTION_INVALID_CONTEXT_CONTAINMENT);
  List errors=new ArrayList();
  if (!retValue) {
    errors.add(e);
    return errors;
  }
  if (!canContainTemplateElement(module,slotId,element)) {
    errors.add(e);
    return errors;
  }
  if (isRootIncludedByModule()) {
    errors.add(e);
    return errors;
  }
  if (isVirtualElement() || getExtendsName() != null) {
    errors.add(e);
    return errors;
  }
  DesignElement tmpContainer=this;
  while (tmpContainer != null) {
    if (tmpContainer instanceof ListingElement || tmpContainer instanceof Theme || tmpContainer instanceof MasterPage) {
      errors=tmpContainer.checkContent(module,this,slotId,element);
      return errors;
    }
    tmpContainer=tmpContainer.getContainer();
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
/** 
 * Determines if the slot can contain a given element.
 * @param module the module
 * @param slotId the slot id
 * @param element the element to insert
 * @return a list containing exceptions.
 */
public final List checkContainmentContext(Module module,int slotId,DesignElement element){
  boolean retValue=canContainInRom(slotId,element.getDefn());
  ContentException e=new ContentException(this,slotId,element,ContentException.DESIGN_EXCEPTION_INVALID_CONTEXT_CONTAINMENT);
  List errors=new ArrayList();
  if (!retValue) {
    errors.add(e);
    return errors;
  }
  if (!canContainTemplateElement(module,slotId,element)) {
    errors.add(e);
    return errors;
  }
  if (isRootIncludedByModule()) {
    errors.add(e);
    return errors;
  }
  if (isVirtualElement() || getExtendsName() != null) {
    errors.add(e);
    return errors;
  }
  DesignElement tmpContainer=this;
  while (tmpContainer != null) {
    if (tmpContainer == element) {
      errors.add(e);
      return errors;
    }
    if (tmpContainer instanceof ListingElement || tmpContainer instanceof Theme || tmpContainer instanceof MasterPage) {
      errors=tmpContainer.checkContent(module,this,slotId,element);
      return errors;
    }
    tmpContainer=tmpContainer.getContainer();
  }
  return Collections.EMPTY_LIST;
}
Program: 77432
Project: 77432
Buggy source:
/** 
 * Creates a new instance of the proper subclass based on the type of the query passed in.
 * @param dataEngine
 * @param queryDefn
 * @param appContext	Application context map; could be null.
 * @return PreparedReportQuery
 * @throws DataException 
 */
static IPreparedQuery newInstance(DataEngineImpl dataEngine,IQueryDefinition queryDefn,Map appContext) throws DataException {
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the proper subclass based on the type of the query passed in.
 * @param dataEngine
 * @param queryDefn
 * @param appContext Application context map; could be null.
 * @return PreparedReportQuery
 * @throws DataException
 */
static IPreparedQuery newInstance(DataEngineImpl dataEngine,IQueryDefinition queryDefn,Map appContext) throws DataException {
}
Program: 77433
Project: 77433
Buggy source:
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_INTEGER_NUMBER);
  }
  previewLable.setText(formatStr);
}

Fixed version (ground truth):
private void doPreview(String pattern){
  String type=getSelectedDataType();
  String formatStr="String_Node_Str";
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) {
    formatStr=new StringFormatter(pattern,ULocale.getDefault()).format(DEFAULT_PREVIEW_STRING);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) {
    formatStr=new DateFormatter(pattern).format(new Date());
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type) || DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_NUMBER);
  }
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type)) {
    formatStr=new NumberFormatter(pattern).format(DEFAULT_PREVIEW_INTEGER_NUMBER);
  }
  previewLable.setText(UIUtil.convertToGUIString(formatStr));
}
Program: 77434
Project: 77434
Buggy source:
private void updateFormatField(){
  String displayFormat;
  IChoiceSet choiceSet=getFormatChoiceSet(getSelectedDataType());
  if (choiceSet == null) {
    displayFormat=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
  }
 else {
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
  }
  formatField.setText("String_Node_Str" + displayFormat);
  changeFormat.setEnabled(choiceSet != null);
  if (selectedParameter != null) {
    doPreview(formatCategroy != DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM ? formatCategroy : formatPattern);
  }
}

Fixed version (ground truth):
private void updateFormatField(){
  String displayFormat;
  IChoiceSet choiceSet=getFormatChoiceSet(getSelectedDataType());
  if (choiceSet == null) {
    displayFormat=DEUtil.getMetaDataDictionary().getChoiceSet(DesignChoiceConstants.CHOICE_STRING_FORMAT_TYPE).findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getDisplayName();
  }
 else {
    displayFormat=choiceSet.findChoice(formatCategroy).getDisplayName();
    if (isCustom()) {
      displayFormat+="String_Node_Str" + formatPattern;
    }
  }
  formatField.setText("String_Node_Str" + displayFormat);
  changeFormat.setEnabled(choiceSet != null);
  if (selectedParameter != null) {
    doPreview(isCustom() ? formatPattern : formatCategroy);
  }
}
Program: 77435
Project: 77435
Buggy source:
private void createDefaultEditor(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE);
  defaultValueEditor=new Text(valueArea,SWT.BORDER);
  defaultValueEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      defaultValue=UIUtil.convertToModelString(defaultValueEditor.getText(),false);
      if (isStatic()) {
        refreshValueTable();
      }
      updateFormatField();
      updateMessageLine();
    }
  }
);
}

Fixed version (ground truth):
private void createDefaultEditor(){
  createLabel(valueArea,LABEL_DEFAULT_VALUE);
  defaultValueEditor=new Text(valueArea,SWT.BORDER);
  defaultValueEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  defaultValueEditor.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      changeDefaultValue(UIUtil.convertToModelString(defaultValueEditor.getText(),false));
      if (isStatic()) {
        refreshValueTable();
      }
    }
  }
);
}
Program: 77437
Project: 77437
Buggy source:
private String format(String string){
  if (canBeNull() && string == null) {
    return LABEL_NULL;
  }
  if (StringUtil.isBlank(string) || formatCategroy == null) {
    return string;
  }
  try {
    String pattern=formatPattern;
    if (formatPattern == null) {
      if (DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM.equals(formatCategroy)) {
        return string;
      }
      pattern=formatCategroy;
    }
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
      Date date=DataTypeUtil.toDate(string,ULocale.US);
      DateFormatter formatter=new DateFormatter(pattern);
      string=formatter.format(date);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(getSelectedDataType())) {
      string=new NumberFormatter(pattern).format(DataTypeUtil.toDouble(string).doubleValue());
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(getSelectedDataType())) {
      string=new NumberFormatter(pattern).format(DataTypeUtil.toBigDecimal(string));
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(getSelectedDataType())) {
      string=new StringFormatter(pattern).format(string);
    }
  }
 catch (  BirtException e) {
  }
  return string;
}

Fixed version (ground truth):
private String format(String string){
  if (canBeNull() && string == null) {
    return LABEL_NULL;
  }
  if (StringUtil.isBlank(string) || formatCategroy == null) {
    return string;
  }
  try {
    String pattern=formatPattern;
    if (formatPattern == null) {
      if (isCustom()) {
        return string;
      }
      pattern=formatCategroy;
    }
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(getSelectedDataType())) {
      Date date=DataTypeUtil.toDate(string,ULocale.US);
      DateFormatter formatter=new DateFormatter(pattern);
      string=formatter.format(date);
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(getSelectedDataType())) {
      string=new NumberFormatter(pattern).format(DataTypeUtil.toDouble(string).doubleValue());
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(getSelectedDataType())) {
      string=new NumberFormatter(pattern).format(DataTypeUtil.toBigDecimal(string));
    }
 else     if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(getSelectedDataType())) {
      string=new StringFormatter(pattern).format(string);
    }
  }
 catch (  BirtException e) {
  }
  return string;
}
Program: 77438
Project: 77438
Buggy source:
public void modifyText(ModifyEvent e){
  defaultValue=UIUtil.convertToModelString(defaultValueEditor.getText(),false);
  if (isStatic()) {
    refreshValueTable();
  }
  updateFormatField();
  updateMessageLine();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  changeDefaultValue(UIUtil.convertToModelString(defaultValueEditor.getText(),false));
  if (isStatic()) {
    refreshValueTable();
  }
}
Program: 77439
Project: 77439
Buggy source:
public boolean removeItem(Object[] elements){
  for (int i=0; i < elements.length; i++) {
    choiceList.remove(elements[i]);
  }
  return true;
}

Fixed version (ground truth):
public boolean removeItem(Object[] elements){
  for (int i=0; i < elements.length; i++) {
    if (isDefaultChoice((SelectionChoice)elements[i])) {
      changeDefaultValue(null);
    }
    choiceList.remove(elements[i]);
  }
  return true;
}
Program: 77440
Project: 77440
Buggy source:
public boolean editItem(final Object element){
  final SelectionChoice choice=(SelectionChoice)element;
  boolean isDefault=isDefaultChoice(choice);
  SelectionChoiceDialog dialog=new SelectionChoiceDialog(Messages.getString("String_Node_Str"));
  dialog.setInput(choice);
  dialog.setValidator(new SelectionChoiceDialog.ISelectionChoiceValidator(){
    public String validate(    String displayLabel,    String value){
      return validateChoice(choice,displayLabel,value);
    }
  }
);
  if (dialog.open() == Dialog.OK) {
    choice.setValue(convertToStandardFormat(choice.getValue()));
    if (isDefault) {
      defaultValue=choice.getValue();
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean editItem(final Object element){
  final SelectionChoice choice=(SelectionChoice)element;
  boolean isDefault=isDefaultChoice(choice);
  SelectionChoiceDialog dialog=new SelectionChoiceDialog(Messages.getString("String_Node_Str"));
  dialog.setInput(choice);
  dialog.setValidator(new SelectionChoiceDialog.ISelectionChoiceValidator(){
    public String validate(    String displayLabel,    String value){
      return validateChoice(choice,displayLabel,value);
    }
  }
);
  if (dialog.open() == Dialog.OK) {
    choice.setValue(convertToStandardFormat(choice.getValue()));
    if (isDefault) {
      changeDefaultValue(choice.getValue());
    }
    return true;
  }
  return false;
}
Program: 77442
Project: 77442
Buggy source:
public long findPage(long offset) throws IOException {
  for (long page=1; page <= totalPage; page++) {
    IPageHint pageHint=getPageHint(page);
    for (int section=0; section < pageHint.getSectionCount(); section++) {
      long start=pageHint.getSectionStart(section);
      long end=pageHint.getSectionEnd(section);
      if (start <= offset && offset <= end) {
        return page;
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
public long findPage(long offset) throws IOException {
  getTotalPage();
  for (long page=1; page <= totalPage; page++) {
    IPageHint pageHint=getPageHint(page);
    for (int section=0; section < pageHint.getSectionCount(); section++) {
      long start=pageHint.getSectionStart(section);
      long end=pageHint.getSectionEnd(section);
      if (start <= offset && offset <= end) {
        return page;
      }
    }
  }
  return -1;
}
Program: 77443
Project: 77443
Buggy source:
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDate(source,ULocale.getDefault());
  }
 catch (  BirtException e) {
    try {
      return toDate(source,DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      return toDateISO8601(source);
    }
  }
}

Fixed version (ground truth):
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      return toDate(source,DEFAULT_LOCALE);
    }
  }
}
Program: 77444
Project: 77444
Buggy source:
/** 
 * convert String with ISO8601 date format to java.util.Date
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDateISO8601(String source) throws BirtException {
  Date resultDate=null;
  source=source.replaceFirst("String_Node_Str","String_Node_Str");
  for (int i=0; i < simpleDateFormatter.length; i++) {
    try {
      resultDate=simpleDateFormatter[i].parse(source);
      return resultDate;
    }
 catch (    ParseException e1) {
    }
  }
  if (resultDate == null) {
    throw new BirtException(pluginId,ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"},resourceBundle);
  }
  return resultDate;
}

Fixed version (ground truth):
/** 
 * convert String with ISO8601 date format to java.util.Date
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDateISO8601(String source) throws BirtException {
  Date resultDate=null;
  source=source.replaceFirst("String_Node_Str","String_Node_Str");
  for (int i=0; i < simpleDateFormatter.length - 1; i++) {
    try {
      resultDate=simpleDateFormatter[i].parse(source);
      return resultDate;
    }
 catch (    ParseException e1) {
    }
  }
  if (source.length() <= 4 && source.matches("String_Node_Str")) {
    try {
      resultDate=simpleDateFormatter[simpleDateFormatter.length - 1].parse(source);
      return resultDate;
    }
 catch (    ParseException e1) {
    }
  }
  if (resultDate == null) {
    throw new BirtException(pluginId,ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"},resourceBundle);
  }
  return resultDate;
}