nus-yam/ex-repair huggingface dataset:
Program: 143461
Project: 143461
Buggy source:
/** 
 * Resumes listening normally to row updates.
 */
protected void resumeRowUpdateListener(){
  this.ignoreUpdateOnPkHash=null;
}

Fixed version (ground truth):
/** 
 * Resumes listening normally to row updates.
 * @deprecated disabled for now. Should we really do this? when an update comes from client who's to say a data change handler or something won't\change other properties of the componen/values of the record that should get sent to client?
 */
@Deprecated protected void resumeRowUpdateListener(){
}
Program: 143463
Project: 143463
Buggy source:
/** 
 * Ignores update record events for the record with given pkHash.
 */
protected void pauseRowUpdateListener(String pkHash){
  this.ignoreUpdateOnPkHash=pkHash;
}

Fixed version (ground truth):
/** 
 * Ignores update record events for the record with given pkHash.
 * @deprecated disabled for now. Should we really do this? when an update comes from client who's to say a data change handler or something won't\change other properties of the componen/values of the record that should get sent to client?
 */
@Deprecated protected void pauseRowUpdateListener(String pkHash){
}
Program: 143464
Project: 143464
Buggy source:
public void toJSON(JSONWriter writer,String key,DataConversion clientConversion,IDataConverterContext dataConverterContext) throws JSONException {
  if (value instanceof UUID || value instanceof UUID) {
    value=value.toString();
  }
  JSONUtils.addKeyIfPresent(writer,key);
  if (jsonValue == null) {
    if (findMode) {
      jsonValue=value instanceof String ? value : (value != null ? String.valueOf(value) : "String_Node_Str");
    }
 else     if (typeOfDP != null) {
      EmbeddableJSONWriter ejw=new EmbeddableJSONWriter(true);
      DataConversion jsonDataConversion=new DataConversion();
      FullValueToJSONConverter.INSTANCE.toJSONValue(ejw,null,value,typeOfDP,jsonDataConversion,dataConverterContext.getWebObject());
      if (jsonDataConversion.getConversions().size() == 0)       jsonDataConversion=null;
      String str=ejw.toJSONString();
      if (str == null || "String_Node_Str".equals(str)) {
        System.err.println(str);
      }
      jsonValue=new JSONStringWithConversions(ejw.toJSONString(),jsonDataConversion);
    }
 else {
      jsonValue=value;
    }
  }
  writer.value(jsonValue);
  if (jsonValue instanceof IJSONStringWithConversions)   clientConversion.convert(((IJSONStringWithConversions)jsonValue).getDataConversions());
}

Fixed version (ground truth):
public void toJSON(JSONWriter writer,String key,DataConversion clientConversion,IDataConverterContext dataConverterContext) throws JSONException {
  if (value instanceof UUID || value instanceof UUID) {
    value=value.toString();
  }
  JSONUtils.addKeyIfPresent(writer,key);
  if (jsonValue == null) {
    if (findMode) {
      jsonValue=value instanceof String ? value : (value != null ? String.valueOf(value) : "String_Node_Str");
    }
 else     if (typeOfDP != null) {
      EmbeddableJSONWriter ejw=new EmbeddableJSONWriter(true);
      DataConversion jsonDataConversion=new DataConversion();
      FullValueToJSONConverter.INSTANCE.toJSONValue(ejw,null,value,typeOfDP,jsonDataConversion,dataConverterContext.getWebObject());
      if (jsonDataConversion.getConversions().size() == 0)       jsonDataConversion=null;
      String str=ejw.toJSONString();
      if (str == null || str.trim().length() == 0) {
        Debug.error("String_Node_Str" + typeOfDP + "String_Node_Str"+ value+ "String_Node_Str");
        str="String_Node_Str";
      }
      jsonValue=new JSONStringWithConversions(str,jsonDataConversion);
    }
 else {
      jsonValue=value;
    }
  }
  writer.value(jsonValue);
  if (jsonValue instanceof IJSONStringWithConversions)   clientConversion.convert(((IJSONStringWithConversions)jsonValue).getDataConversions());
}
Program: 143466
Project: 143466
Buggy source:
@Override public void setEditable(boolean editable){
  super.setEditable(editable);
  this.editable=editable;
  Iterator<HasRuntimeReadOnly> readOnlyAwareComponentsIte=getReadOnlyAwareComponents().iterator();
  while (readOnlyAwareComponentsIte.hasNext()) {
    readOnlyAwareComponentsIte.next().setReadOnly(!editable);
  }
  invalidate();
  repaint();
}

Fixed version (ground truth):
@Override public void setEditable(boolean editable){
  super.setEditable(editable);
  this.editable=editable;
}
Program: 143467
Project: 143467
Buggy source:
@Override public void setEditable(boolean editable){
  super.setEditable(editable);
  this.editable=editable;
  Iterator<HasRuntimeReadOnly> readOnlyAwareComponentsIte=getReadOnlyAwareComponents().iterator();
  while (readOnlyAwareComponentsIte.hasNext()) {
    readOnlyAwareComponentsIte.next().setReadOnly(!editable);
  }
  repaint();
}

Fixed version (ground truth):
@Override public void setEditable(boolean editable){
  super.setEditable(editable);
  this.editable=editable;
}
Program: 143468
Project: 143468
Buggy source:
public void setReadOnly(boolean readOnly){
  this.readOnly=readOnly;
  applyState();
}

Fixed version (ground truth):
public void setReadOnly(boolean readOnly){
  this.readOnly=readOnly;
  if (readOnly && !isEditable()) {
    applyState();
    return;
  }
  if (readOnly) {
    setEditable(false);
    if (!blockEditStateChange)     editState=true;
  }
 else {
    setEditable(editState);
  }
}
Program: 143469
Project: 143469
Buggy source:
public void applyState(){
  boolean jComboEnabled=accessible && enabled && !readOnly;
  applier.setEnabled(jComboEnabled);
  applier.setEditable(jComboEnabled && editable);
  applier.setLabelsEnabled(accessible && enabled);
}

Fixed version (ground truth):
public void applyState(){
  boolean jComboEnabled=accessible && enabled && !readOnly;
  applier.setEnabled(editable ? true : jComboEnabled);
  applier.setEditable(editable);
  applier.setLabelsEnabled(accessible && enabled);
}
Program: 143470
Project: 143470
Buggy source:
@Override public Object call(Context cx,Scriptable scope,Scriptable thisObj,Object[] args){
  try {
    return session.getService(serviceName).executeServiceCall(definition.getName(),args);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public Object call(Context cx,Scriptable scope,Scriptable thisObj,Object[] args){
  try {
    PropertyDescription retPD=definition != null ? definition.getReturnType() : null;
    return NGConversions.INSTANCE.convertSabloComponentToRhinoValue(session.getService(serviceName).executeServiceCall(definition.getName(),args),retPD,(BaseWebObject)session.getService(serviceName),thisObj);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 143471
Project: 143471
Buggy source:
protected Object getJavaValue(Object value,PropertyDescription propertyDescription){
  if (propertyDescription != null && !propertyDescription.isArray() && propertyDescription.getType() instanceof IWrapperType) {
    return ((IWrapperType)propertyDescription.getType()).unwrap(value);
  }
  return value;
}

Fixed version (ground truth):
protected Object getJavaValue(Object value,PropertyDescription propertyDescription){
  if (propertyDescription != null) {
    if (!propertyDescription.isArray() && propertyDescription.getType() instanceof IWrapperType) {
      return ((IWrapperType)propertyDescription.getType()).unwrap(value);
    }
 else     if (propertyDescription.isArray() && value instanceof List) {
      List arr=((List)value);
      List<Object> list=new ArrayList<>();
      for (int i=0; i < arr.size(); i++) {
        list.add(getJavaValue(arr.get(i),propertyDescription.asArrayElement()));
      }
      return list;
    }
 else     if ((propertyDescription.getType() instanceof ICustomType) && ((ICustomType)propertyDescription.getType()).getCustomJSONTypeDefinition() != null && value instanceof Map && !(propertyDescription.getType() instanceof IComplexTypeImpl)) {
      Map<String,Object> props=((Map)value);
      Map<String,Object> newProps=new HashMap<>();
      PropertyDescription localPropertyType=((ICustomType)propertyDescription.getType()).getCustomJSONTypeDefinition();
      for (      String prop : props.keySet()) {
        PropertyDescription localPropertyDescription=localPropertyType.getProperty(prop);
        newProps.put(prop,getJavaValue(props.get(prop),localPropertyDescription));
      }
      return newProps;
    }
  }
  return value;
}
Program: 143474
Project: 143474
Buggy source:
@Override public void touchForm(Form form,String realInstanceName,boolean async){
  if (form == null)   return;
  ConcurrentMap<String,String> formsOnClient=endpointForms.get(WebsocketEndpoint.get());
  String formName=realInstanceName == null ? form.getName() : realInstanceName;
  String formUrl="String_Node_Str" + form.getSolution().getName() + "String_Node_Str"+ formName+ "String_Node_Str";
  if (formsOnClient.putIfAbsent(formName,formUrl) == null) {
    updateController(form,formName,formUrl,!async);
    if (!async) {
synchronized (formUrl) {
        try {
          formUrl.wait();
        }
 catch (        InterruptedException ex) {
          Debug.error(ex);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void touchForm(Form form,String realInstanceName,boolean async){
  if (form == null)   return;
  ConcurrentMap<String,Pair<String,Boolean>> formsOnClient=endpointForms.get(WebsocketEndpoint.get());
  String formName=realInstanceName == null ? form.getName() : realInstanceName;
  String formUrl="String_Node_Str" + form.getSolution().getName() + "String_Node_Str"+ formName+ "String_Node_Str";
  if (formsOnClient.putIfAbsent(formName,new Pair<String,Boolean>(formUrl,Boolean.FALSE)) == null) {
    updateController(form,formName,formUrl,!async);
  }
 else {
    formUrl=formsOnClient.get(formName).getLeft();
  }
  if (!async) {
synchronized (formUrl) {
      if (!formsOnClient.get(formName).getRight().booleanValue()) {
        try {
          formUrl.wait();
        }
 catch (        InterruptedException ex) {
          Debug.error(ex);
        }
      }
    }
  }
}
Program: 143475
Project: 143475
Buggy source:
@Override public void formCreated(String formName){
  ConcurrentMap<String,String> formsOnClient=endpointForms.get(WebsocketEndpoint.get());
  String formUrl=formsOnClient.get(formName);
synchronized (formUrl) {
    formUrl.notifyAll();
  }
}

Fixed version (ground truth):
@Override public void formCreated(String formName){
  ConcurrentMap<String,Pair<String,Boolean>> formsOnClient=endpointForms.get(WebsocketEndpoint.get());
  String formUrl=formsOnClient.get(formName).getLeft();
synchronized (formUrl) {
    formsOnClient.get(formName).setRight(Boolean.TRUE);
    formUrl.notifyAll();
  }
}
Program: 143476
Project: 143476
Buggy source:
@Override public void registerEndpoint(IWebsocketEndpoint endpoint){
  super.registerEndpoint(endpoint);
  endpointForms.put(endpoint,new ConcurrentHashMap<String,String>());
}

Fixed version (ground truth):
@Override public void registerEndpoint(IWebsocketEndpoint endpoint){
  super.registerEndpoint(endpoint);
  endpointForms.put(endpoint,new ConcurrentHashMap<String,Pair<String,Boolean>>());
}
Program: 143479
Project: 143479
Buggy source:
/** 
 * Try to parse the given object as a UUID
 * @param o the object to try
 * @param throwOnException whether or not to throw a RuntimeException on failure
 * @return UUID or null if o is not recognized
 * @return the UUID - or null if the parse doesn't succeed if throwOnException is false
 */
public static UUID getAsUUID(Object o,boolean throwOnException){
  if (o == null) {
    return null;
  }
  try {
    if (o instanceof byte[] && ((byte[])o).length == 16) {
      return new UUID((byte[])o);
    }
    if (o instanceof String) {
      return UUID.fromString((String)o);
    }
    if (o instanceof UUID) {
      return (UUID)o;
    }
  }
 catch (  RuntimeException e) {
    if (throwOnException) {
      throw e;
    }
  }
  String msg="String_Node_Str" + o + "String_Node_Str"+ o.getClass().getName();
  if (throwOnException) {
    throw new RuntimeException(msg);
  }
  Debug.trace(msg);
  return null;
}

Fixed version (ground truth):
/** 
 * Try to parse the given object as a UUID
 * @param o the object to try
 * @param throwOnException whether or not to throw a RuntimeException on failure
 * @return UUID or null if o is not recognized
 * @return the UUID - or null if the parse doesn't succeed if throwOnException is false
 */
public static UUID getAsUUID(Object o,boolean throwOnException){
  if (o == null) {
    return null;
  }
  try {
    if (o instanceof byte[] && ((byte[])o).length == 16) {
      return new UUID((byte[])o);
    }
    if (o instanceof String) {
      return UUID.fromString((String)o);
    }
    if (o instanceof UUID) {
      return (UUID)o;
    }
    if (o instanceof NativeJavaObject) {
      return getAsUUID(((NativeJavaObject)o).unwrap(),throwOnException);
    }
  }
 catch (  RuntimeException e) {
    if (throwOnException) {
      throw e;
    }
  }
  String msg="String_Node_Str" + o + "String_Node_Str"+ o.getClass().getName();
  if (throwOnException) {
    throw new RuntimeException(msg);
  }
  Debug.trace(msg);
  return null;
}
Program: 143481
Project: 143481
Buggy source:
public void giveMeFoundSet(IFoundSetListener l) throws ServoyException {
  IFoundSetInternal set=null;
  if (l.getDataSource() == null || inMemDataSources.get(l.getDataSource()) != null || l.wantSharedFoundSet()) {
    String wantedGlobalRelationName=l.getGlobalRelationNamedFoundset();
    if (wantedGlobalRelationName != null) {
      set=getGlobalRelatedFoundSet(wantedGlobalRelationName);
      if (set == null || !Solution.areDataSourcesCompatible(application.getRepository(),set.getDataSource(),l.getDataSource())) {
        throw new RepositoryException("String_Node_Str" + wantedGlobalRelationName + "String_Node_Str");
      }
    }
 else {
      set=getSharedFoundSet(l.getDataSource(),l.getDefaultSortColumns());
    }
  }
 else {
    set=getSeparateFoundSet(l,l.getDefaultSortColumns());
  }
  l.newValue(new FoundSetEvent(set,FoundSetEvent.NEW_FOUNDSET,FoundSetEvent.CHANGE_UPDATE));
}

Fixed version (ground truth):
public void giveMeFoundSet(IFoundSetListener l) throws ServoyException {
  IFoundSetInternal set=null;
  if (l.getDataSource() == null || l.wantSharedFoundSet()) {
    String wantedGlobalRelationName=l.getGlobalRelationNamedFoundset();
    if (wantedGlobalRelationName != null) {
      set=getGlobalRelatedFoundSet(wantedGlobalRelationName);
      if (set == null || !Solution.areDataSourcesCompatible(application.getRepository(),set.getDataSource(),l.getDataSource())) {
        throw new RepositoryException("String_Node_Str" + wantedGlobalRelationName + "String_Node_Str");
      }
    }
 else {
      set=getSharedFoundSet(l.getDataSource(),l.getDefaultSortColumns());
    }
  }
 else {
    set=getSeparateFoundSet(l,l.getDefaultSortColumns());
  }
  l.newValue(new FoundSetEvent(set,FoundSetEvent.NEW_FOUNDSET,FoundSetEvent.CHANGE_UPDATE));
}
Program: 143485
Project: 143485
Buggy source:
public int getSelectedViewIndex(){
  int selectedIndex=formController.getFoundSet().getSelectedIndex();
  return selectedIndex - ((currentPage - 1) * PAGE_SIZE);
}

Fixed version (ground truth):
public int getSelectedViewIndex(){
  int selectedIndex=formController.getFoundSet().getSelectedIndex();
  return selectedIndex - ((currentPage - 1) * getPageSize());
}
Program: 143486
Project: 143486
Buggy source:
public int getPageSize(){
  return WebGridFormUI.PAGE_SIZE;
}

Fixed version (ground truth):
public int getPageSize(){
  return WebGridFormUI.DEFAULT_PAGE_SIZE;
}
Program: 143487
Project: 143487
Buggy source:
public Collection<BaseComponent> getBodyComponents(){
  Part part=null;
  for (  Part prt : Utils.iterate(form.getParts())) {
    if (prt.getPartType() == Part.BODY) {
      part=prt;
      break;
    }
  }
  List<BaseComponent> baseComponents=new ArrayList<>();
  if (part == null)   return baseComponents;
  int startPos=form.getPartStartYPos(part.getID());
  int endPos=part.getHeight();
  Iterator<IPersist> it=form.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
  while (it.hasNext()) {
    IPersist persist=it.next();
    if (persist instanceof GraphicalComponent && isTableView && ((GraphicalComponent)persist).getLabelFor() != null)     continue;
    if (persist instanceof BaseComponent && formElementValidator.isComponentSpecValid((BaseComponent)persist)) {
      Point location=((BaseComponent)persist).getLocation();
      if (startPos <= location.y && endPos >= location.y) {
        baseComponents.add((BaseComponent)persist);
      }
    }
  }
  return baseComponents;
}

Fixed version (ground truth):
public Collection<BaseComponent> getBodyComponents(){
  Part part=getBodyPart();
  List<BaseComponent> baseComponents=new ArrayList<>();
  if (part == null)   return baseComponents;
  int startPos=form.getPartStartYPos(part.getID());
  int endPos=part.getHeight();
  Iterator<IPersist> it=form.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
  while (it.hasNext()) {
    IPersist persist=it.next();
    if (persist instanceof GraphicalComponent && isTableView && ((GraphicalComponent)persist).getLabelFor() != null)     continue;
    if (persist instanceof BaseComponent && formElementValidator.isComponentSpecValid((BaseComponent)persist)) {
      Point location=((BaseComponent)persist).getLocation();
      if (startPos <= location.y && endPos >= location.y) {
        baseComponents.add((BaseComponent)persist);
      }
    }
  }
  return baseComponents;
}
Program: 143488
Project: 143488
Buggy source:
public int getGridHeight(){
  for (  Part prt : Utils.iterate(form.getParts())) {
    if (prt.getPartType() == Part.BODY) {
      return prt.getHeight();
    }
  }
  return 0;
}

Fixed version (ground truth):
public int getGridHeight(){
  Part part=getBodyPart();
  return part != null ? part.getHeight() : 0;
}
Program: 143489
Project: 143489
Buggy source:
/** 
 * In cases where the user selected the same column in 2 or 3 'Return in dataprovider' or 'Show in field' for a valuelist the query  only does a select with one column name .After the data is received  it reconstructs the rows with the missing duplicate columns
 */
public Object[] processRow(Object[] row){
  Object[] ret=row;
  if (secondColRedirectIndex >= 0 || thirdColRedirectIndex >= 0) {
    boolean hasFirstDp=(showValues & 1) != 0 || (returnValues & 1) != 0;
    boolean hasSecondDp=(showValues & 2) != 0 || (returnValues & 2) != 0;
    ArrayList<Object> arr=new ArrayList<Object>();
    arr.add(row[0]);
    if (secondColRedirectIndex >= 0) {
      arr.add(row[secondColRedirectIndex]);
    }
 else     if (hasFirstDp && hasSecondDp) {
      arr.add(row[1]);
    }
    if (thirdColRedirectIndex >= 0) {
      arr.add(row[thirdColRedirectIndex]);
    }
 else {
      arr.add(row[row.length - 1]);
    }
    ret=arr.toArray();
  }
  return CustomValueList.processRow(ret,showValues,returnValues);
}

Fixed version (ground truth):
/** 
 * In cases where the user selected the same column in 2 or 3 'Return in dataprovider' or 'Show in field' for a valuelist the query  only does a select with one column name .After the data is received  it reconstructs the rows with the missing duplicate columns
 */
public Object[] processRow(Object[] row){
  Object[] ret=row;
  if (secondColRedirectIndex >= 0 || thirdColRedirectIndex >= 0) {
    boolean hasFirstDp=(showValues & 1) != 0 || (returnValues & 1) != 0;
    boolean hasSecondDp=(showValues & 2) != 0 || (returnValues & 2) != 0;
    boolean hasThirdDp=(showValues & 4) != 0 || (returnValues & 4) != 0;
    ArrayList<Object> arr=new ArrayList<Object>();
    int srcIdx=0;
    if (hasFirstDp)     arr.add(row[srcIdx++]);
    if (secondColRedirectIndex >= 0) {
      arr.add(row[secondColRedirectIndex]);
    }
 else     if (hasSecondDp) {
      arr.add(row[srcIdx++]);
    }
    if (thirdColRedirectIndex >= 0) {
      arr.add(row[thirdColRedirectIndex]);
    }
 else     if (hasThirdDp) {
      arr.add(row[srcIdx++]);
    }
    ret=arr.toArray();
  }
  return CustomValueList.processRow(ret,showValues,returnValues);
}
Program: 143490
Project: 143490
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public String readTextFile(String path,Charset charset) throws IOException {
  URL url=Activator.getContext().getBundle().getEntry("String_Node_Str" + componentName + '/'+ path);
  InputStream is=null;
  try {
    is=url.openStream();
    return Utils.getTXTFileContent(is,charset);
  }
  finally {
    if (is != null)     is.close();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public String readTextFile(String path,Charset charset) throws IOException {
  URL url=Activator.getContext().getBundle().getEntry("String_Node_Str" + componentName + '/'+ path);
  if (url == null)   return null;
  InputStream is=null;
  try {
    is=url.openStream();
    return Utils.getTXTFileContent(is,charset);
  }
  finally {
    if (is != null)     is.close();
  }
}
Program: 143491
Project: 143491
Buggy source:
@Override public Object[] getIds(){
  return null;
}

Fixed version (ground truth):
@Override public Object[] getIds(){
  return new Object[0];
}
Program: 143492
Project: 143492
Buggy source:
@Override public Object[] getIds(){
  return null;
}

Fixed version (ground truth):
@Override public Object[] getIds(){
  ArrayList<String> al=new ArrayList<>();
  al.addAll(specProperties);
  al.addAll(apiFunctions.keySet());
  return al.toArray();
}
Program: 143493
Project: 143493
Buggy source:
@Override public Object[] getIds(){
  return null;
}

Fixed version (ground truth):
@Override public Object[] getIds(){
  return new Object[0];
}
Program: 143494
Project: 143494
Buggy source:
/** 
 * @return the clientCreator
 */
public static IClientCreator getClientCreator(){
  if (clientCreator == null) {
    clientCreator=new IClientCreator(){
      @Override public NGClient createClient(      INGClientEndpoint endpoint){
        return new NGClient(endpoint);
      }
    }
;
  }
  return clientCreator;
}

Fixed version (ground truth):
/** 
 * @return the clientCreator
 */
public static IClientCreator getClientCreator(){
  if ((clientCreator == null)) {
    clientCreator=new IClientCreator(){
      @Override public NGClient createClient(      INGClientEndpoint endpoint){
        return new NGClient(endpoint);
      }
    }
;
  }
  return clientCreator;
}
Program: 143496
Project: 143496
Buggy source:
public void run(){
  application.reportError(ae.getLocalizedMessage(),ae);
}

Fixed version (ground truth):
public void run(){
  application.handleException(null,ae);
}
Program: 143497
Project: 143497
Buggy source:
/** 
 * @see com.servoy.j2db.smart.J2DBClient#shutDown(boolean)
 */
@Override public void shutDown(boolean force){
  shutDown=true;
  try {
    Solution solution=getSolution();
    if (solution != null) {
      if (!closeSolution(force,null) && !force) {
        shutDown=false;
        return;
      }
    }
    logout(null);
    if (unitTestsRunning) {
      repository=null;
      applicationServerAccess=null;
    }
  }
 catch (  Exception ex) {
    Debug.error(ex);
  }
  Window[] ownedWindows=getMainApplicationFrame().getOwnedWindows();
  if (ownedWindows != null) {
    for (    Window w : ownedWindows)     w.dispose();
  }
  getMainApplicationFrame().setVisible(false);
  saveSettings();
}

Fixed version (ground truth):
/** 
 * @see com.servoy.j2db.smart.J2DBClient#shutDown(boolean)
 */
@Override public void shutDown(boolean force){
  shutDown=true;
  try {
    Solution solution=getSolution();
    if (solution != null) {
      if (!closeSolution(force,null) && !force) {
        shutDown=false;
        return;
      }
    }
    logout(null);
    if (unitTestsRunning) {
      repository=null;
      applicationServerAccess=null;
    }
  }
 catch (  Exception ex) {
    Debug.error(ex);
  }
  getLoadingUIEffects().setClientShouldBeShowing(!shutDown);
  Window[] ownedWindows=getMainApplicationFrame().getOwnedWindows();
  if (ownedWindows != null) {
    for (    Window w : ownedWindows)     w.dispose();
  }
  getMainApplicationFrame().setVisible(false);
  saveSettings();
}
Program: 143498
Project: 143498
Buggy source:
/** 
 */
public void show(final Form form){
  shutDown=false;
  Runnable run=new Runnable(){
    public void run(){
      if (!getMainApplicationFrame().isVisible()) {
        ComponentFactory.flushCachedItems(DebugJ2DBClient.this);
        getMainApplicationFrame().setVisible(true);
      }
 else {
        getMainApplicationFrame().setState(Frame.NORMAL);
      }
      if (unitTestsRunning) {
        getMainApplicationFrame().setState(Frame.ICONIFIED);
      }
 else {
        getMainApplicationFrame().toFront();
      }
      if (form == null) {
        if (isSolutionLoaded()) {
          closeSolution(true,null);
        }
 else {
          selectAndOpenSolution();
        }
      }
 else {
        ((FormManager)getFormManager()).showFormInMainPanel(form.getName());
      }
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    run.run();
  }
 else {
    SwingUtilities.invokeLater(run);
  }
}

Fixed version (ground truth):
/** 
 */
public void show(final Form form){
  shutDown=false;
  Runnable run=new Runnable(){
    public void run(){
      if (!getMainApplicationFrame().isVisible()) {
        ComponentFactory.flushCachedItems(DebugJ2DBClient.this);
        getMainApplicationFrame().setVisible(true);
      }
 else {
        getMainApplicationFrame().setState(Frame.NORMAL);
      }
      getLoadingUIEffects().setClientShouldBeShowing(!shutDown);
      if (unitTestsRunning) {
        getMainApplicationFrame().setState(Frame.ICONIFIED);
      }
 else {
        getMainApplicationFrame().toFront();
      }
      if (form == null) {
        if (isSolutionLoaded()) {
          closeSolution(true,null);
        }
 else {
          selectAndOpenSolution();
        }
      }
 else {
        ((FormManager)getFormManager()).showFormInMainPanel(form.getName());
      }
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    run.run();
  }
 else {
    SwingUtilities.invokeLater(run);
  }
}
Program: 143499
Project: 143499
Buggy source:
public void showSolutionLoading(boolean b){
  getCurrentContainer().showSolutionLoading(b);
}

Fixed version (ground truth):
public void showSolutionLoading(boolean b){
  application.showSolutionLoading(b);
}
Program: 143500
Project: 143500
Buggy source:
@Override protected void loadSolution(final SolutionMetaData solutionMeta) throws RepositoryException {
  getFormManager().showSolutionLoading(true);
  invokeLater(new Runnable(){
    public void run(){
      try {
        blockGUI(Messages.getString("String_Node_Str",new Object[]{solutionMeta.getName()}));
        loadSolutionsAndModules(solutionMeta);
      }
 catch (      final Exception ex) {
        invokeLater(new Runnable(){
          public void run(){
            reportError(Messages.getString("String_Node_Str"),ex);
          }
        }
);
      }
 finally {
        getScriptEngine();
        releaseGUI();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void loadSolution(final SolutionMetaData solutionMeta) throws RepositoryException {
  showSolutionLoading(true);
  invokeLater(new Runnable(){
    public void run(){
      try {
        blockGUI(Messages.getString("String_Node_Str",new Object[]{solutionMeta.getName()}));
        loadSolutionsAndModules(solutionMeta);
      }
 catch (      final Exception ex) {
        invokeLater(new Runnable(){
          public void run(){
            reportError(Messages.getString("String_Node_Str"),ex);
          }
        }
);
      }
 finally {
        getScriptEngine();
        releaseGUI();
      }
    }
  }
);
}
Program: 143501
Project: 143501
Buggy source:
@Override protected SolutionMetaData showSolutionSelection(SolutionMetaData[] solutions){
  if (selectSolutionDialog == null) {
    selectSolutionDialog=new SelectSolutionDialog(this);
  }
  mainPanel.showSolutionLoading(true);
  SolutionMetaData tmp=null;
  try {
    tmp=selectSolutionDialog.showDialog(solutions);
  }
  finally {
    if (tmp == null)     mainPanel.showSolutionLoading(false);
  }
  return tmp;
}

Fixed version (ground truth):
@Override protected SolutionMetaData showSolutionSelection(SolutionMetaData[] solutions){
  if (selectSolutionDialog == null) {
    selectSolutionDialog=new SelectSolutionDialog(this);
  }
  showSolutionLoading(true);
  SolutionMetaData tmp=null;
  try {
    tmp=selectSolutionDialog.showDialog(solutions);
  }
  finally {
    if (tmp == null)     showSolutionLoading(false);
  }
  return tmp;
}
Program: 143503
Project: 143503
Buggy source:
private void setValueThreadSafe(final Object value){
  try {
    application.invokeAndWait(new Runnable(){
      public void run(){
        try {
          setValueEx(value);
        }
 catch (        Exception e) {
          Debug.error("String_Node_Str" + value,e);
          if (editorKit instanceof FixedHTMLEditorKit) {
            Debug.error("String_Node_Str");
            enclosedComponent.setDocument(editorKit.createDefaultDocument());
            setValueEx(value);
          }
        }
      }
    }
);
  }
 catch (  Exception e) {
    Debug.error(e);
  }
}

Fixed version (ground truth):
private void setValueThreadSafe(final Object value){
  try {
    Runnable runnable=new Runnable(){
      public void run(){
        try {
          setValueEx(value);
        }
 catch (        Exception e) {
          Debug.error("String_Node_Str" + value,e);
          if (editorKit instanceof FixedHTMLEditorKit) {
            Debug.error("String_Node_Str");
            enclosedComponent.setDocument(editorKit.createDefaultDocument());
            setValueEx(value);
          }
        }
      }
    }
;
    if (application.isEventDispatchThread()) {
      runnable.run();
    }
 else {
      application.invokeLater(runnable);
    }
  }
 catch (  Exception e) {
    Debug.error(e);
  }
}
Program: 143505
Project: 143505
Buggy source:
Object authenticate(String authenticator_solution,String method,Object[] credentials);

Fixed version (ground truth):
@ServoyClientSupport(mc=false,wc=true,sc=true) Object authenticate(String authenticator_solution,String method,Object[] credentials);
Program: 143506
Project: 143506
Buggy source:
/** 
 * @sameas com.servoy.base.persistence.IBaseGraphicalComponent#getOnActionMethodID()
 */
int getOnActionMethodID();

Fixed version (ground truth):
int getOnActionMethodID();
Program: 143507
Project: 143507
Buggy source:
/** 
 * @templatedescription Perform the element default action
 * @templatename onAction
 * @templateparam JSEvent event the event that triggered the action
 * @templateaddtodo
 */
public int getOnActionMethodID(){
  return getTypedProperty(StaticContentSpecLoader.PROPERTY_ONACTIONMETHODID).intValue();
}

Fixed version (ground truth):
/** 
 * @sameas com.servoy.base.persistence.IBaseGraphicalComponent#getOnActionMethodID()
 * @templatedescription Perform the element default action
 * @templatename onAction
 * @templateparam JSEvent event the event that triggered the action
 * @templateaddtodo
 */
public int getOnActionMethodID(){
  return getTypedProperty(StaticContentSpecLoader.PROPERTY_ONACTIONMETHODID).intValue();
}
Program: 143508
Project: 143508
Buggy source:
/** 
 * @templatedescription Handle changed data
 * @templatename onDataChange
 * @templatetype Boolean
 * @templateparam ${dataproviderType} oldValue old value
 * @templateparam ${dataproviderType} newValue new value
 * @templateparam JSEvent event the event that triggered the action
 * @templateaddtodo
 * @templatecode return true
 */
public int getOnDataChangeMethodID(){
  return getTypedProperty(StaticContentSpecLoader.PROPERTY_ONDATACHANGEMETHODID).intValue();
}

Fixed version (ground truth):
/** 
 * @clonedesc com.servoy.base.solutionmodel.IBaseSMField#getOnDataChange()
 * @templatedescription Handle changed data
 * @templatename onDataChange
 * @templatetype Boolean
 * @templateparam ${dataproviderType} oldValue old value
 * @templateparam ${dataproviderType} newValue new value
 * @templateparam JSEvent event the event that triggered the action
 * @templateaddtodo
 * @templatecode return true
 */
public int getOnDataChangeMethodID(){
  return getTypedProperty(StaticContentSpecLoader.PROPERTY_ONDATACHANGEMETHODID).intValue();
}
Program: 143512
Project: 143512
Buggy source:
/** 
 * @see org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
 */
@Override public void renderHead(final HtmlHeaderContainer container){
  super.renderHead(container);
  IHeaderResponse response=container.getHeaderResponse();
  YUILoader.renderHTMLEdit(response);
  String script="String_Node_Str" + getMarkupId() + "String_Node_Str"+ textArea.getMarkupId()+ "String_Node_Str";
  response.renderOnDomReadyJavascript(script);
}

Fixed version (ground truth):
/** 
 * @see org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
 */
@Override public void renderHead(final HtmlHeaderContainer container){
  super.renderHead(container);
  IHeaderResponse response=container.getHeaderResponse();
  YUILoader.renderHTMLEdit(response);
  String script="String_Node_Str" + getMarkupId() + "String_Node_Str"+ textArea.getMarkupId()+ "String_Node_Str"+ isEditable()+ "String_Node_Str";
  response.renderOnDomReadyJavascript(script);
}
Program: 143513
Project: 143513
Buggy source:
/** 
 * @return true if it was not triggered by initial show or other operations for which the callback shouldn't be called.
 */
protected boolean move(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  bounds.x=Integer.parseInt(request.getParameter("String_Node_Str"));
  bounds.y=Integer.parseInt(request.getParameter("String_Node_Str"));
  return !("String_Node_Str".equals(request.getParameter("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * @return true if it was not triggered by initial show or other operations for which the callback shouldn't be called.
 */
protected boolean move(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  bounds.x=Utils.getAsInteger(request.getParameter("String_Node_Str"));
  bounds.y=Utils.getAsInteger(request.getParameter("String_Node_Str"));
  return !("String_Node_Str".equals(request.getParameter("String_Node_Str")));
}
Program: 143514
Project: 143514
Buggy source:
/** 
 * @return true if it was not triggered by initial show or other operations for which the callback shouldn't be called.
 */
protected boolean resize(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  bounds.width=Integer.parseInt(request.getParameter("String_Node_Str"));
  bounds.height=Integer.parseInt(request.getParameter("String_Node_Str"));
  return !("String_Node_Str".equals(request.getParameter("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * @return true if it was not triggered by initial show or other operations for which the callback shouldn't be called.
 */
protected boolean resize(AjaxRequestTarget target){
  Request request=RequestCycle.get().getRequest();
  bounds.width=Utils.getAsInteger(request.getParameter("String_Node_Str"));
  bounds.height=Utils.getAsInteger(request.getParameter("String_Node_Str"));
  return !("String_Node_Str".equals(request.getParameter("String_Node_Str")));
}
Program: 143517
Project: 143517
Buggy source:
@Override protected void respond(AjaxRequestTarget ajaxRequestTarget){
  Page componentPage=getComponent().getPage();
  Request componentRequest=getComponent().getRequest();
  String action=componentRequest.getParameter(PARAM_ACTION);
  String id=componentRequest.getParameter(PARAM_DRAGGABLE_ID);
  int modifiers=WebEventExecutor.convertModifiers(Integer.parseInt(componentRequest.getParameter(PARAM_MODIFIERS)));
  if (ACTION_DRAG_START.equals(action)) {
    boolean dragStartReturn=onDragStart(id,Integer.parseInt(componentRequest.getParameter(PARAM_X)),Integer.parseInt(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
    if (!dragStartReturn)     ajaxRequestTarget.appendJavascript("String_Node_Str");
  }
 else   if (ACTION_DRAG_END.equals(action)) {
    onDragEnd(id,Integer.parseInt(componentRequest.getParameter(PARAM_X)),Integer.parseInt(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
  }
 else   if (ACTION_DROP_HOVER.equals(action)) {
    onDropHover(id,componentRequest.getParameter(PARAM_TARGET_ID),modifiers,ajaxRequestTarget);
  }
 else   if (ACTION_DROP.equals(action)) {
    onDrop(id,componentRequest.getParameter(PARAM_TARGET_ID),Integer.parseInt(componentRequest.getParameter(PARAM_X)),Integer.parseInt(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
  }
  WebEventExecutor.generateResponse(ajaxRequestTarget,componentPage);
}

Fixed version (ground truth):
@Override protected void respond(AjaxRequestTarget ajaxRequestTarget){
  Page componentPage=getComponent().getPage();
  Request componentRequest=getComponent().getRequest();
  String action=componentRequest.getParameter(PARAM_ACTION);
  String id=componentRequest.getParameter(PARAM_DRAGGABLE_ID);
  int modifiers=WebEventExecutor.convertModifiers(Integer.parseInt(componentRequest.getParameter(PARAM_MODIFIERS)));
  if (ACTION_DRAG_START.equals(action)) {
    boolean dragStartReturn=onDragStart(id,Utils.getAsInteger(componentRequest.getParameter(PARAM_X)),Utils.getAsInteger(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
    if (!dragStartReturn)     ajaxRequestTarget.appendJavascript("String_Node_Str");
  }
 else   if (ACTION_DRAG_END.equals(action)) {
    onDragEnd(id,Utils.getAsInteger(componentRequest.getParameter(PARAM_X)),Utils.getAsInteger(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
  }
 else   if (ACTION_DROP_HOVER.equals(action)) {
    onDropHover(id,componentRequest.getParameter(PARAM_TARGET_ID),modifiers,ajaxRequestTarget);
  }
 else   if (ACTION_DROP.equals(action)) {
    onDrop(id,componentRequest.getParameter(PARAM_TARGET_ID),Utils.getAsInteger(componentRequest.getParameter(PARAM_X)),Utils.getAsInteger(componentRequest.getParameter(PARAM_Y)),modifiers,ajaxRequestTarget);
  }
  WebEventExecutor.generateResponse(ajaxRequestTarget,componentPage);
}
Program: 143518
Project: 143518
Buggy source:
public RootObjectMetaData createNewRootObjectMetaData(int rootObjectId,UUID rootObjectUuid,String name,int objectTypeId,int activeRelease,int latestRelease) throws RepositoryException {
  RootObjectMetaData romd=createRootObjectMetaData(rootObjectId,rootObjectUuid,name,objectTypeId,activeRelease,latestRelease);
  getRootObjectCache().add(romd);
  return romd;
}

Fixed version (ground truth):
public RootObjectMetaData createNewRootObjectMetaData(int rootObjectId,UUID rootObjectUuid,String name,int objectTypeId,int activeRelease,int latestRelease) throws RepositoryException {
  RootObjectMetaData romd=createRootObjectMetaData(rootObjectId,rootObjectUuid,name,objectTypeId,activeRelease,latestRelease);
  getRootObjectCache().add(romd,false);
  return romd;
}
Program: 143519
Project: 143519
Buggy source:
public IRootObject getLatestRootObject(int rootObjectId) throws RepositoryException {
  RootObjectMetaData metadata=getRootObjectCache().getRootObjectMetaData(rootObjectId);
  if (metadata == null) {
    try {
      Iterator<RootObjectMetaData> iterator=loadRootObjectMetaDatas().iterator();
      while (iterator.hasNext()) {
        metadata=iterator.next();
        if (metadata.getRootObjectId() == rootObjectId) {
          getRootObjectCache().add(metadata);
          return getRootObject(rootObjectId,metadata.getLatestRelease());
        }
      }
    }
 catch (    Exception e) {
      Debug.error("String_Node_Str" + rootObjectId,e);
    }
    return null;
  }
  return getRootObject(rootObjectId,metadata.getLatestRelease());
}

Fixed version (ground truth):
public IRootObject getLatestRootObject(int rootObjectId) throws RepositoryException {
  RootObjectMetaData metadata=getRootObjectCache().getRootObjectMetaData(rootObjectId);
  if (metadata == null) {
    try {
      Iterator<RootObjectMetaData> iterator=loadRootObjectMetaDatas().iterator();
      while (iterator.hasNext()) {
        metadata=iterator.next();
        if (metadata.getRootObjectId() == rootObjectId) {
          getRootObjectCache().add(metadata,false);
          return getRootObject(rootObjectId,metadata.getLatestRelease());
        }
      }
    }
 catch (    Exception e) {
      Debug.error("String_Node_Str" + rootObjectId,e);
    }
    return null;
  }
  return getRootObject(rootObjectId,metadata.getLatestRelease());
}
Program: 143520
Project: 143520
Buggy source:
protected AbstractRepository(IServerManager serverManager,boolean loadImportHooks){
  this.serverManager=serverManager;
  mimeTypeMap=new HashMap<String,String>();
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  repositoryHelper=new RepositoryHelper(this,loadImportHooks);
}

Fixed version (ground truth):
protected AbstractRepository(IServerManager serverManager){
  this.serverManager=serverManager;
  mimeTypeMap=new HashMap<String,String>();
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  mimeTypeMap.put("String_Node_Str","String_Node_Str");
  repositoryHelper=new RepositoryHelper(this);
}
Program: 143521
Project: 143521
Buggy source:
/** 
 * Adds the given meta data object to the root object meta data cache.
 * @param rootObjectMetaData the meta data to be added.
 */
public void addRootObjectMetaData(RootObjectMetaData rootObjectMetaData) throws RepositoryException {
  getRootObjectCache().add(rootObjectMetaData);
}

Fixed version (ground truth):
/** 
 * Adds the given meta data object to the root object meta data cache.
 * @param rootObjectMetaData the meta data to be added.
 */
public void addRootObjectMetaData(RootObjectMetaData rootObjectMetaData) throws RepositoryException {
  getRootObjectCache().add(rootObjectMetaData,true);
}
Program: 143523
Project: 143523
Buggy source:
public List<RootObjectReference> getActiveSolutionModuleMetaDatas(int solutionId) throws RepositoryException {
  Map<UUID,RootObjectReference> referencedModules=new HashMap<UUID,RootObjectReference>();
  try {
    Solution sol=(Solution)developerRepository.getActiveRootObject(solutionId);
    if (sol != null) {
      referencedModules.put(sol.getUUID(),new RootObjectReference(sol.getName(),sol.getUUID(),sol.getRootObjectMetaData(),sol.getReleaseNumber()));
      loadObjectMetaDatas(sol.getModulesNames(),referencedModules);
    }
  }
 catch (  Exception e) {
    throw new RepositoryException(e);
  }
  return new ArrayList<RootObjectReference>(referencedModules.values());
}

Fixed version (ground truth):
public List<RootObjectReference> getActiveSolutionModuleMetaDatas(int solutionId) throws RepositoryException {
  Map<UUID,RootObjectReference> referencedModules=new HashMap<UUID,RootObjectReference>();
  try {
    Solution sol=(Solution)developerRepository.getActiveRootObject(solutionId);
    if (sol != null) {
      referencedModules.put(sol.getUUID(),new RootObjectReference(sol.getName(),sol.getUUID(),sol.getRootObjectMetaData(),sol.getReleaseNumber()));
      loadObjectMetaDatas(sol.getModulesNames(),referencedModules,SolutionMetaData.isImportHook(sol.getSolutionMetaData()));
    }
  }
 catch (  Exception e) {
    throw new RepositoryException(e);
  }
  return new ArrayList<RootObjectReference>(referencedModules.values());
}
Program: 143524
Project: 143524
Buggy source:
public RepositoryHelper(IDeveloperRepository dr,boolean loadImportHooks){
  developerRepository=dr;
  this.loadImportHooks=loadImportHooks;
}

Fixed version (ground truth):
public RepositoryHelper(IDeveloperRepository dr){
  developerRepository=dr;
}
Program: 143525
Project: 143525
Buggy source:
/** 
 * @param metadata
 */
synchronized void add(RootObjectMetaData metaData){
  CacheRecord cacheRecord=new CacheRecord();
  cacheRecord.rootObjectMetaData=metaData;
  cacheRecord.rootObjects=new HashMap();
  rootObjectsById.put(new Integer(metaData.getRootObjectId()),cacheRecord);
  rootObjectsByName.put(new RootObjectKey(metaData.getName(),metaData.getObjectTypeId()),cacheRecord);
}

Fixed version (ground truth):
synchronized void add(RootObjectMetaData metaData,boolean allowUpdate){
  Integer intId=new Integer(metaData.getRootObjectId());
  CacheRecord cacheRecord=allowUpdate ? rootObjectsById.get(intId) : null;
  if (cacheRecord == null) {
    cacheRecord=new CacheRecord();
    cacheRecord.rootObjects=new HashMap<Integer,IRootObject>();
    rootObjectsById.put(intId,cacheRecord);
    rootObjectsByName.put(new RootObjectKey(metaData.getName(),metaData.getObjectTypeId()),cacheRecord);
  }
 else {
    for (    IRootObject ro : cacheRecord.rootObjects.values()) {
      ((AbstractRootObject)ro).setMetaData(metaData);
    }
  }
  cacheRecord.rootObjectMetaData=metaData;
}
Program: 143526
Project: 143526
Buggy source:
synchronized RootObjectMetaData[] getRootObjectMetaDatas() throws RepositoryException {
  RootObjectMetaData[] metaDatas=new RootObjectMetaData[rootObjectsById.size()];
  Iterator iterator=rootObjectsById.values().iterator();
  int i=0;
  while (iterator.hasNext()) {
    metaDatas[i++]=((CacheRecord)iterator.next()).rootObjectMetaData;
  }
  return metaDatas;
}

Fixed version (ground truth):
synchronized RootObjectMetaData[] getRootObjectMetaDatas() throws RepositoryException {
  RootObjectMetaData[] metaDatas=new RootObjectMetaData[rootObjectsById.size()];
  Iterator<CacheRecord> iterator=rootObjectsById.values().iterator();
  int i=0;
  while (iterator.hasNext()) {
    metaDatas[i++]=iterator.next().rootObjectMetaData;
  }
  return metaDatas;
}
Program: 143527
Project: 143527
Buggy source:
private void flushRootObjectMap(HashMap rootObjectMap) throws RepositoryException {
  Iterator iterator=rootObjectMap.values().iterator();
  while (iterator.hasNext()) {
    IRootObject rootObject=(IRootObject)iterator.next();
    ChangeHandler ch=rootObject.getChangeHandler();
    if (ch != null) {
      ch.rootObjectIsFlushed();
    }
    iterator.remove();
  }
}

Fixed version (ground truth):
private void flushRootObjectMap(HashMap<Integer,IRootObject> rootObjectMap) throws RepositoryException {
  Iterator<IRootObject> iterator=rootObjectMap.values().iterator();
  while (iterator.hasNext()) {
    IRootObject rootObject=iterator.next();
    ChangeHandler ch=rootObject.getChangeHandler();
    if (ch != null) {
      ch.rootObjectIsFlushed();
    }
    iterator.remove();
  }
}
Program: 143528
Project: 143528
Buggy source:
synchronized RootObjectMetaData[] getRootObjectMetaDatasForType(int objectTypeId) throws RepositoryException {
  List list=new SortedList(NameComparator.INSTANCE);
  Iterator iterator=rootObjectsById.values().iterator();
  while (iterator.hasNext()) {
    RootObjectMetaData metaData=((CacheRecord)iterator.next()).rootObjectMetaData;
    if (metaData.getObjectTypeId() == objectTypeId) {
      list.add(metaData);
    }
  }
  RootObjectMetaData[] filtered=new RootObjectMetaData[list.size()];
  return (RootObjectMetaData[])list.toArray(filtered);
}

Fixed version (ground truth):
synchronized RootObjectMetaData[] getRootObjectMetaDatasForType(int objectTypeId) throws RepositoryException {
  List list=new SortedList(NameComparator.INSTANCE);
  Iterator<CacheRecord> iterator=rootObjectsById.values().iterator();
  while (iterator.hasNext()) {
    RootObjectMetaData metaData=iterator.next().rootObjectMetaData;
    if (metaData.getObjectTypeId() == objectTypeId) {
      list.add(metaData);
    }
  }
  RootObjectMetaData[] filtered=new RootObjectMetaData[list.size()];
  return (RootObjectMetaData[])list.toArray(filtered);
}
Program: 143529
Project: 143529
Buggy source:
synchronized void flushRootObject(int rootObjectId) throws RepositoryException {
  Integer key=new Integer(rootObjectId);
  CacheRecord cacheRecord=(CacheRecord)rootObjectsById.get(key);
  if (cacheRecord != null) {
    flushRootObjectMap(cacheRecord.rootObjects);
  }
}

Fixed version (ground truth):
synchronized void flushRootObject(int rootObjectId) throws RepositoryException {
  Integer key=new Integer(rootObjectId);
  CacheRecord cacheRecord=rootObjectsById.get(key);
  if (cacheRecord != null) {
    flushRootObjectMap(cacheRecord.rootObjects);
  }
}