nus-yam/ex-repair huggingface dataset:
Program: 82329
Project: 82329
Buggy source:
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @param testInfo the {@link TestInfo} we are waiting for
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    StringBuilder buf=new StringBuilder();
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (results == null || !results.containsKey(clientStatus)) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.clientDesc);
      ++lineCount;
    }
    int difference=numClients - getNumClientsRetrievedTest(testInfo);
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
    return buf.toString();
  }
}

Fixed version (ground truth):
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @param testInfo the {@link TestInfo} we are waiting for
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    StringBuilder buf=new StringBuilder();
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (results == null || !results.containsKey(clientStatus)) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.getDesc());
      ++lineCount;
    }
    int difference=numClients - getNumClientsRetrievedTest(testInfo);
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
    return buf.toString();
  }
}
Program: 82330
Project: 82330
Buggy source:
public void reportFatalLaunch(String clientId,String clientDesc,String userAgent,JUnitResult result){
  ClientStatus clientStatus=ensureClientStatus(clientId,clientDesc);
  Map<TestInfo,JUnitResult> results=new HashMap<TestInfo,JUnitResult>();
  for (  TestInfo testInfo : testBlocks.get(clientStatus.blockIndex)) {
    results.put(testInfo,result);
  }
  reportResults(clientId,clientDesc,userAgent,results);
}

Fixed version (ground truth):
/** 
 * Reports a failure from a client that cannot startup.
 * @param clientInfo information about the client
 * @param result the failure result
 */
public void reportFatalLaunch(ClientInfoExt clientInfo,JUnitResult result){
  ClientStatus clientStatus=ensureClientStatus(clientInfo);
  Map<TestInfo,JUnitResult> results=new HashMap<TestInfo,JUnitResult>();
  for (  TestInfo testInfo : testBlocks.get(clientStatus.blockIndex)) {
    results.put(testInfo,result);
  }
  reportResults(clientInfo,results);
}
Program: 82331
Project: 82331
Buggy source:
/** 
 * Returns any new clients that have contacted the server since the last call. The same client will never be returned from this method twice.
 */
String[] getNewClients(){
synchronized (clientStatusesLock) {
    List<String> results=new ArrayList<String>();
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (clientStatus.isNew) {
        results.add(clientStatus.clientDesc);
        clientStatus.isNew=false;
      }
    }
    clientStatusesLock.notifyAll();
    return results.toArray(new String[results.size()]);
  }
}

Fixed version (ground truth):
/** 
 * Returns any new clients that have contacted the server since the last call. The same client will never be returned from this method twice.
 */
String[] getNewClients(){
synchronized (clientStatusesLock) {
    List<String> results=new ArrayList<String>();
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (clientStatus.isNew) {
        results.add(clientStatus.getDesc());
        clientStatus.isNew=false;
      }
    }
    clientStatusesLock.notifyAll();
    return results.toArray(new String[results.size()]);
  }
}
Program: 82332
Project: 82332
Buggy source:
public ClientStatus(String clientId,String clientDesc){
  this.clientId=clientId;
  this.clientDesc=clientDesc;
}

Fixed version (ground truth):
public ClientStatus(ClientInfoExt clientInfo){
  this.clientInfo=clientInfo;
}
Program: 82333
Project: 82333
Buggy source:
/** 
 * Ensure that a   {@link ClientStatus} for the clientId exists.
 * @param clientId the id of the client
 * @return the {@link ClientStatus} for the client
 */
private ClientStatus ensureClientStatus(String clientId,String clientDesc){
  ClientStatus clientStatus=clientStatuses.get(clientId);
  if (clientStatus == null) {
    clientStatus=new ClientStatus(clientId,clientDesc);
    clientStatuses.put(clientId,clientStatus);
  }
 else {
    clientStatus.clientDesc=clientDesc;
  }
  return clientStatus;
}

Fixed version (ground truth):
/** 
 * Ensure that a   {@link ClientStatus} for the clientId exists.
 * @param clientId the id of the client
 * @return the {@link ClientStatus} for the client
 */
private ClientStatus ensureClientStatus(ClientInfoExt clientInfo){
  int id=clientInfo.getSessionId();
  ClientStatus clientStatus=clientStatuses.get(id);
  if (clientStatus == null) {
    clientStatus=new ClientStatus(clientInfo);
    clientStatuses.put(id,clientStatus);
  }
 else {
    clientStatus.updateClientInfo(clientInfo);
  }
  return clientStatus;
}
Program: 82334
Project: 82334
Buggy source:
/** 
 * Called by the servlet to report the results of the last test to run.
 * @param clientId the ID of the client
 * @param userAgent the user agent property of the client
 * @param results the result of running the test block
 */
public void reportResults(String clientId,String clientDesc,String userAgent,Map<TestInfo,JUnitResult> results){
synchronized (clientStatusesLock) {
    if (results == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    userAgents.add(userAgent);
    ClientStatus clientStatus=ensureClientStatus(clientId,clientDesc);
    for (    Map.Entry<TestInfo,JUnitResult> entry : results.entrySet()) {
      TestInfo testInfo=entry.getKey();
      ensureResults(testInfo).put(clientStatus,entry.getValue());
    }
    clientStatusesLock.notifyAll();
  }
}

Fixed version (ground truth):
/** 
 * Called by the servlet to report the results of the last test to run.
 * @param clientInfo information about the client
 * @param results the result of running the test block
 */
public void reportResults(ClientInfoExt clientInfo,Map<TestInfo,JUnitResult> results){
synchronized (clientStatusesLock) {
    if (results == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    userAgents.add(clientInfo.getUserAgent());
    ClientStatus clientStatus=ensureClientStatus(clientInfo);
    for (    Map.Entry<TestInfo,JUnitResult> entry : results.entrySet()) {
      TestInfo testInfo=entry.getKey();
      ensureResults(testInfo).put(clientStatus,entry.getValue());
    }
    clientStatusesLock.notifyAll();
  }
}
Program: 82335
Project: 82335
Buggy source:
/** 
 * Returns a human-formatted message identifying what clients have connected but have not yet reported results for this test. It is used in a timeout condition, to identify what we're still waiting on.
 * @param testInfo the {@link TestInfo} that the clients are working on
 * @return human readable message
 */
String getWorkingClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    int itemCount=0;
    StringBuilder buf=new StringBuilder();
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    if (results != null) {
      for (      Map.Entry<ClientStatus,JUnitResult> entry : results.entrySet()) {
        if (entry.getValue() == null) {
          buf.append(entry.getKey().clientDesc);
          buf.append("String_Node_Str");
          itemCount++;
        }
      }
    }
    int difference=numClients - itemCount;
    if (difference > 0) {
      if (itemCount > 0) {
        buf.append('\n');
      }
      buf.append(difference + "String_Node_Str");
    }
    return buf.toString();
  }
}

Fixed version (ground truth):
/** 
 * Returns a human-formatted message identifying what clients have connected but have not yet reported results for this test. It is used in a timeout condition, to identify what we're still waiting on.
 * @param testInfo the {@link TestInfo} that the clients are working on
 * @return human readable message
 */
String getWorkingClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    int itemCount=0;
    StringBuilder buf=new StringBuilder();
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    if (results != null) {
      for (      Map.Entry<ClientStatus,JUnitResult> entry : results.entrySet()) {
        if (entry.getValue() == null) {
          buf.append(entry.getKey().getDesc());
          buf.append("String_Node_Str");
          itemCount++;
        }
      }
    }
    int difference=numClients - itemCount;
    if (difference > 0) {
      if (itemCount > 0) {
        buf.append('\n');
      }
      buf.append(difference + "String_Node_Str");
    }
    return buf.toString();
  }
}
Program: 82337
Project: 82337
Buggy source:
/** 
 * Reports results for the last method run and gets the name of next method to run.
 * @param results the results of executing the test
 * @param blockIndex the index of the test block to retrieve
 * @param userAgent the user agent property of this client
 * @return the next test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock reportResultsAndGetTestBlock(HashMap<TestInfo,JUnitResult> results,int blockIndex,String userAgent) throws TimeoutException ;

Fixed version (ground truth):
/** 
 * Reports results for the last method run and gets the name of next method to run.
 * @param results the results of executing the test
 * @param blockIndex the index of the test block to retrieve
 * @param clientInfo the info for this client
 * @return the next test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock reportResultsAndGetTestBlock(HashMap<TestInfo,JUnitResult> results,int blockIndex,ClientInfo clientInfo) throws TimeoutException ;
Program: 82338
Project: 82338
Buggy source:
/** 
 * Gets a specific block of tests to run.
 * @param blockIndex the index of the test block to retrieve
 * @param userAgent the user agent property of this client
 * @return the test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock getTestBlock(int blockIndex,String userAgent) throws TimeoutException ;

Fixed version (ground truth):
/** 
 * Gets a specific block of tests to run.
 * @param blockIndex the index of the test block to retrieve
 * @param clientInfo the info for this client
 * @return the initial response
 * @throws TimeoutException if the wait for the next method times out.
 */
InitialResponse getTestBlock(int blockIndex,ClientInfo clientInfo) throws TimeoutException ;
Program: 82339
Project: 82339
Buggy source:
public static String toSourceName(String dottedName){
  return dottedName.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String toSourceName(String dottedName){
  return NON_TRAILING_DOLLAR.matcher(dottedName).replaceAll("String_Node_Str");
}
Program: 82340
Project: 82340
Buggy source:
/** 
 * React to messages from the other side, where a return value is expected.
 * @param handler
 * @throws RemoteDeathError
 */
public ReturnMessage reactToMessagesWhileWaitingForReturn(SessionHandler handler){
  do {
    try {
      getStreamToOtherSide().flush();
      MessageType messageType=Message.readMessageType(getStreamFromOtherSide());
switch (messageType) {
case FREE_VALUE:
        final FreeMessage freeMsg=FreeMessage.receive(this);
      handler.freeValue(this,freeMsg.getIds());
    break;
case RETURN:
  return ReturnMessage.receive(this);
case INVOKE:
InvokeOnServerMessage imsg=InvokeOnServerMessage.receive(this);
ExceptionOrReturnValue result=handler.invoke(this,imsg.getThis(),imsg.getMethodDispatchId(),imsg.getArgs());
sendFreedValues();
ReturnMessage.send(this,result);
break;
case INVOKE_SPECIAL:
handleInvokeSpecial(handler);
break;
case QUIT:
throw new RemoteDeathError(null);
default :
throw new BrowserChannelException("String_Node_Str" + messageType + "String_Node_Str");
}
}
 catch (IOException e) {
throw new RemoteDeathError(e);
}
catch (BrowserChannelException e) {
throw new RemoteDeathError(e);
}
}
 while (true);
}

Fixed version (ground truth):
/** 
 * React to messages from the other side, where a return value is expected.
 * @param handler
 * @throws BrowserChannelException 
 * @throws RemoteDeathError
 */
public ReturnMessage reactToMessagesWhileWaitingForReturn(SessionHandler handler) throws BrowserChannelException, RemoteDeathError {
  do {
    try {
      getStreamToOtherSide().flush();
      MessageType messageType=Message.readMessageType(getStreamFromOtherSide());
switch (messageType) {
case FREE_VALUE:
        final FreeMessage freeMsg=FreeMessage.receive(this);
      handler.freeValue(this,freeMsg.getIds());
    break;
case RETURN:
  return ReturnMessage.receive(this);
case INVOKE:
InvokeOnServerMessage imsg=InvokeOnServerMessage.receive(this);
ExceptionOrReturnValue result=handler.invoke(this,imsg.getThis(),imsg.getMethodDispatchId(),imsg.getArgs());
sendFreedValues();
ReturnMessage.send(this,result);
break;
case INVOKE_SPECIAL:
handleInvokeSpecial(handler);
break;
case QUIT:
throw new RemoteDeathError(null);
default :
throw new BrowserChannelException("String_Node_Str" + messageType + "String_Node_Str");
}
}
 catch (IOException e) {
throw new RemoteDeathError(e);
}
catch (BrowserChannelException e) {
throw new RemoteDeathError(e);
}
}
 while (true);
}
Program: 82341
Project: 82341
Buggy source:
/** 
 * Load a new instance of a module.
 * @param channel
 * @param moduleName
 * @param userAgent
 * @param url top-level URL of the main page, null if using an old plugin
 * @param tabKey opaque key of the tab, may be empty if the plugin can'tdistinguish tabs or null if using an old plugin
 * @param sessionKey opaque key for this session, null if using an old plugin
 * @param userAgentIcon byte array containing an icon (which fits within24x24) representing the user agent or null if unavailable
 * @return a TreeLogger to use for the module's logs
 */
public abstract TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon);

Fixed version (ground truth):
/** 
 * Load a new instance of a module.
 * @param channel
 * @param moduleName
 * @param userAgent
 * @param url top-level URL of the main page, null if using an old plugin
 * @param tabKey opaque key of the tab, may be empty if the plugin can'tdistinguish tabs or null if using an old plugin
 * @param sessionKey opaque key for this session, null if using an old plugin
 * @param userAgentIcon byte array containing an icon (which fits within24x24) representing the user agent or null if unavailable
 * @return a TreeLogger to use for the module's logs, or null if the moduleload failed
 */
public abstract TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon);
Program: 82342
Project: 82342
Buggy source:
protected void BrowserChannel(InputStream inputStream,OutputStream outputStream,ObjectRefFactory objectRefFactory) throws IOException {
  streamFromOtherSide=new DataInputStream(inputStream);
  streamToOtherSide=new DataOutputStream(outputStream);
  socket=null;
  this.objectRefFactory=objectRefFactory;
}

Fixed version (ground truth):
protected void BrowserChannel(InputStream inputStream,OutputStream outputStream,ObjectRefFactory objectRefFactory){
  streamFromOtherSide=new DataInputStream(inputStream);
  streamToOtherSide=new DataOutputStream(outputStream);
  socket=null;
  this.objectRefFactory=objectRefFactory;
}
Program: 82343
Project: 82343
Buggy source:
BrowserChannelServer(TreeLogger initialLogger,InputStream inputStream,OutputStream outputStream,SessionHandler handler,boolean ignoreRemoteDeath) throws IOException {
  super(inputStream,outputStream,new ServerObjectRefFactory());
  this.handler=handler;
  this.ignoreRemoteDeath=ignoreRemoteDeath;
  init(initialLogger);
}

Fixed version (ground truth):
BrowserChannelServer(TreeLogger initialLogger,InputStream inputStream,OutputStream outputStream,SessionHandler handler,boolean ignoreRemoteDeath){
  super(inputStream,outputStream,new ServerObjectRefFactory());
  this.handler=handler;
  this.ignoreRemoteDeath=ignoreRemoteDeath;
  init(initialLogger);
}
Program: 82346
Project: 82346
Buggy source:
protected ModuleSpace(TreeLogger logger,ModuleSpaceHost host,String moduleName,Object key){
  this.host=host;
  this.moduleName=moduleName;
  this.key=key;
  this.logger=logger;
  threadLocalLogger.set(host.getLogger());
}

Fixed version (ground truth):
protected ModuleSpace(TreeLogger logger,ModuleSpaceHost host,String moduleName){
  this.host=host;
  this.moduleName=moduleName;
  this.logger=logger;
  threadLocalLogger.set(host.getLogger());
}
Program: 82347
Project: 82347
Buggy source:
public ModuleSpaceOOPHM(ModuleSpaceHost msh,String moduleName,BrowserChannelServer channel){
  super(msh.getLogger(),msh,moduleName,moduleName);
  this.channel=channel;
  msh.getLogger().log(TreeLogger.DEBUG,"String_Node_Str" + moduleName,null);
}

Fixed version (ground truth):
public ModuleSpaceOOPHM(ModuleSpaceHost msh,String moduleName,BrowserChannelServer channel){
  super(msh.getLogger(),msh,moduleName);
  this.channel=channel;
  msh.getLogger().log(TreeLogger.DEBUG,"String_Node_Str" + moduleName,null);
}
Program: 82348
Project: 82348
Buggy source:
@Override public synchronized TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon){
  PerfLogger.start("String_Node_Str" + moduleName);
  BrowserChannelServer serverChannel=(BrowserChannelServer)channel;
  ModuleHandle moduleHandle=host.createModuleLogger(moduleName,userAgent,url,tabKey,sessionKey,serverChannel,userAgentIcon);
  TreeLogger logger=moduleHandle.getLogger();
  moduleHandleMap.put(serverChannel,moduleHandle);
  ModuleSpace moduleSpace=null;
  try {
    ModuleSpaceHost msh=host.createModuleSpaceHost(moduleHandle,moduleName);
    moduleSpace=new ModuleSpaceOOPHM(msh,moduleName,serverChannel);
    moduleMap.put(serverChannel,moduleSpace);
    PerfLogger.start("String_Node_Str");
    moduleSpace.onLoad(logger);
  }
 catch (  Throwable e) {
    moduleHandle.getLogger().log(TreeLogger.ERROR,"String_Node_Str" + moduleName + "String_Node_Str"+ userAgent+ "String_Node_Str"+ channel.getRemoteEndpoint(),e);
    if (moduleSpace != null) {
      moduleSpace.dispose();
    }
    moduleHandle.unload();
    moduleMap.remove(serverChannel);
    moduleHandleMap.remove(serverChannel);
  }
 finally {
    PerfLogger.end();
    PerfLogger.end();
  }
  return moduleHandle.getLogger();
}

Fixed version (ground truth):
@Override public synchronized TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon){
  PerfLogger.start("String_Node_Str" + moduleName);
  BrowserChannelServer serverChannel=(BrowserChannelServer)channel;
  ModuleHandle moduleHandle=host.createModuleLogger(moduleName,userAgent,url,tabKey,sessionKey,serverChannel,userAgentIcon);
  TreeLogger logger=moduleHandle.getLogger();
  moduleHandleMap.put(serverChannel,moduleHandle);
  ModuleSpace moduleSpace=null;
  try {
    ModuleSpaceHost msh=host.createModuleSpaceHost(moduleHandle,moduleName);
    moduleSpace=new ModuleSpaceOOPHM(msh,moduleName,serverChannel);
    moduleMap.put(serverChannel,moduleSpace);
    PerfLogger.start("String_Node_Str");
    moduleSpace.onLoad(logger);
  }
 catch (  Throwable e) {
    moduleHandle.getLogger().log(TreeLogger.ERROR,"String_Node_Str" + moduleName + "String_Node_Str"+ userAgent+ "String_Node_Str"+ channel.getRemoteEndpoint(),e);
    if (moduleSpace != null) {
      moduleSpace.dispose();
    }
    moduleHandle.unload();
    moduleMap.remove(serverChannel);
    moduleHandleMap.remove(serverChannel);
    return null;
  }
 finally {
    PerfLogger.end();
    PerfLogger.end();
  }
  return moduleHandle.getLogger();
}
Program: 82349
Project: 82349
Buggy source:
/** 
 * @return full text of log event.
 */
public String getFullText(){
  StringBuffer sb=new StringBuffer();
  formatTimestamp(timestamp.getTime() - firstLog.getTime(),sb);
  sb.append("String_Node_Str");
  if (type != null) {
    sb.append("String_Node_Str");
    sb.append(type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(htmlEscape(message));
  sb.append("String_Node_Str");
  if (exceptionDetail != null) {
    sb.append("String_Node_Str" + htmlEscape(exceptionDetail) + "String_Node_Str");
  }
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    String anchorText=helpInfo.getAnchorText();
    if (anchorText == null) {
      anchorText=url.toExternalForm();
    }
    String prefix=helpInfo.getPrefix();
    if (url != null) {
      sb.append("String_Node_Str" + prefix + "String_Node_Str");
      sb.append(url.toString());
      sb.append("String_Node_Str");
      sb.append(anchorText);
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * @return full text of log event.
 */
public String getFullText(){
  StringBuffer sb=new StringBuffer();
  formatTimestamp(timestamp.getTime() - firstLog.getTime(),sb);
  sb.append("String_Node_Str");
  if (type != null) {
    sb.append("String_Node_Str");
    sb.append(type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(htmlEscape(message));
  sb.append("String_Node_Str");
  if (exceptionDetail != null) {
    sb.append("String_Node_Str" + htmlEscape(exceptionDetail) + "String_Node_Str");
  }
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    String anchorText=helpInfo.getAnchorText();
    if (anchorText == null && url != null) {
      anchorText=url.toExternalForm();
    }
    String prefix=helpInfo.getPrefix();
    if (url != null) {
      sb.append("String_Node_Str" + prefix + "String_Node_Str");
      sb.append(url.toString());
      sb.append("String_Node_Str");
      sb.append(anchorText);
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 82350
Project: 82350
Buggy source:
protected static DivElement createRuler(Unit widthUnit,Unit heightUnit){
  DivElement ruler=Document.get().createDivElement();
  ruler.setInnerHTML("String_Node_Str");
  Style style=ruler.getStyle();
  style.setPosition(Position.ABSOLUTE);
  style.setZIndex(-32767);
  style.setLeft(-10000,PX);
  style.setWidth(10,widthUnit);
  style.setHeight(10,heightUnit);
  return ruler;
}

Fixed version (ground truth):
protected static DivElement createRuler(Unit widthUnit,Unit heightUnit){
  DivElement ruler=Document.get().createDivElement();
  ruler.setInnerHTML("String_Node_Str");
  Style style=ruler.getStyle();
  style.setPosition(Position.ABSOLUTE);
  style.setZIndex(-32767);
  style.setLeft(-20,widthUnit);
  style.setTop(-20,heightUnit);
  style.setWidth(10,widthUnit);
  style.setHeight(10,heightUnit);
  return ruler;
}
Program: 82351
Project: 82351
Buggy source:
/** 
 * The height of the scroll view of an element.
 */
public final native int getScrollWidth();

Fixed version (ground truth):
/** 
 * The width of the scroll view of an element.
 */
public final native int getScrollWidth();
Program: 82352
Project: 82352
Buggy source:
/** 
 * @param classNames css class names to convert
 * @return map of the same class names in a form safe for use as Javaidentifiers, with the order of the input set preserved
 * @throws Failure on collisions due to conversions
 */
public Map<String,String> convertSet(Set<String> classNames) throws Failure {
  Map<String,String> rawToConverted=new LinkedHashMap<String,String>();
  Map<String,String> convertedToRaw=new LinkedHashMap<String,String>();
  for (  String className : classNames) {
    String converted=convertName(className);
    String already=convertedToRaw.get(converted);
    if (already != null) {
      throw new Failure("String_Node_Str",already,className);
    }
    if (!converted.equals(className)) {
      convertedToRaw.put(converted,className);
    }
    rawToConverted.put(className,converted);
  }
  return rawToConverted;
}

Fixed version (ground truth):
/** 
 * @param classNames css class names to convert
 * @return map of the same class names in a form safe for use as Javaidentifiers, with the order of the input set preserved
 * @throws Failure on collisions due to conversions
 */
public Map<String,String> convertSet(Set<String> classNames) throws Failure {
  Map<String,String> rawToConverted=new LinkedHashMap<String,String>();
  Map<String,String> convertedToRaw=new LinkedHashMap<String,String>();
  for (  String className : classNames) {
    String converted=convertName(className);
    String already=convertedToRaw.get(converted);
    if (already != null) {
      throw new Failure("String_Node_Str",already,className);
    }
    convertedToRaw.put(converted,className);
    rawToConverted.put(className,converted);
  }
  return rawToConverted;
}
Program: 82353
Project: 82353
Buggy source:
public void testSomeOp() throws CssNameConverter.Failure {
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Pair[] expected={new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str")};
  Map<String,String> out=converter.convertSet(in);
  for (  Pair pair : expected) {
    String convert=out.remove(pair.before);
    assertEquals(pair.after,convert);
  }
  assertTrue(out.isEmpty());
}

Fixed version (ground truth):
public void testSomeOp() throws CssNameConverter.Failure {
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Pair[] expected={new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str"),new Pair("String_Node_Str","String_Node_Str")};
  Map<String,String> out=converter.convertSet(in);
  for (  Pair pair : expected) {
    String convert=out.remove(pair.before);
    assertEquals(pair.after,convert);
  }
  assertTrue(out.isEmpty());
}
Program: 82354
Project: 82354
Buggy source:
public void testNoOp() throws CssNameConverter.Failure {
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Map<String,String> out=converter.convertSet(in);
  for (  Map.Entry<String,String> entry : out.entrySet()) {
    String key=entry.getKey();
    assertTrue(in.remove(key));
    assertEquals(key,entry.getValue());
  }
  assertTrue(in.isEmpty());
}

Fixed version (ground truth):
public void testNoOp() throws CssNameConverter.Failure {
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Map<String,String> out=converter.convertSet(in);
  for (  Map.Entry<String,String> entry : out.entrySet()) {
    String key=entry.getKey();
    assertTrue(in.remove(key));
    assertEquals(key,entry.getValue());
  }
  assertTrue(in.isEmpty());
}
Program: 82355
Project: 82355
Buggy source:
public void testCollision(){
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}

Fixed version (ground truth):
public void testCollision(){
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
    fail();
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}
Program: 82356
Project: 82356
Buggy source:
public void testReverseCollision(){
  Set<String> in=Sets.create("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}

Fixed version (ground truth):
public void testReverseCollision(){
  Set<String> in=makeOrderedSet("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    converter.convertSet(in);
    fail();
  }
 catch (  CssNameConverter.Failure e) {
    assertContains(e.getMessage(),"String_Node_Str");
    assertContains(e.getMessage(),"String_Node_Str");
  }
}
Program: 82357
Project: 82357
Buggy source:
/** 
 * Attempts to get a named configuration property. Throws <code>BadPropertyValueException</code> if the property is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 */
ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named configuration property. Throws <code>BadPropertyValueException</code> if the property is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param propertyName 
 * @return the configuration property instance (never null)
 * @throws BadPropertyValueException if the property is unknown or not aconfiguration property
 */
ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException ;
Program: 82358
Project: 82358
Buggy source:
/** 
 * Attempts to get a named deferred binding property or configuration property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 */
@Deprecated String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property or configuration property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 * @throws BadPropertyValueException if the property is unknown or not of theright type
 */
@Deprecated String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 82359
Project: 82359
Buggy source:
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is a configuration property or is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 */
@Deprecated String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is a configuration property or is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 * @throws BadPropertyValueException if the property is unknown or not of theright type 
 */
@Deprecated String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 82360
Project: 82360
Buggy source:
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 */
SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger 
 * @param propertyName 
 * @return the selection property instance (never null)
 * @throws BadPropertyValueException if the property is unknown or not aselection property
 */
SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 82361
Project: 82361
Buggy source:
public com.google.gwt.core.ext.ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException {
  for (  final ConfigurationProperty prop : configProps) {
    if (prop.getName().equals(propertyName)) {
      return new com.google.gwt.core.ext.ConfigurationProperty(){
        public String getName(){
          return prop.getName();
        }
        public List<String> getValues(){
          return prop.getValues();
        }
      }
;
    }
  }
  throw new BadPropertyValueException(propertyName);
}

Fixed version (ground truth):
public com.google.gwt.core.ext.ConfigurationProperty getConfigurationProperty(String propertyName) throws BadPropertyValueException {
  for (  final ConfigurationProperty prop : configProps) {
    if (prop.getName().equals(propertyName)) {
      return new DefaultConfigurationProperty(prop.getName(),prop.getValues());
    }
  }
  throw new BadPropertyValueException(propertyName);
}
Program: 82362
Project: 82362
Buggy source:
public String[] getOrderedPropValues(){
  return orderedPropValues;
}

Fixed version (ground truth):
/** 
 * @return an array of binding property values.
 */
public String[] getOrderedPropValues(){
  return orderedPropValues;
}
Program: 82363
Project: 82363
Buggy source:
public BindingProperty[] getOrderedProps(){
  return orderedProps;
}

Fixed version (ground truth):
/** 
 * @return an array of binding properties.
 */
public BindingProperty[] getOrderedProps(){
  return orderedProps;
}
Program: 82364
Project: 82364
Buggy source:
public StaticPropertyOracle(BindingProperty[] orderedProps,String[] orderedPropValues,ConfigurationProperty[] configProps){
  this.orderedProps=orderedProps;
  this.orderedPropValues=orderedPropValues;
  this.configProps=configProps;
  int len=orderedProps.length;
  for (int i=0; i < len; i++) {
    BindingProperty prop=orderedProps[i];
    String value=orderedPropValues[i];
    if (!prop.isAllowedValue(value)) {
      throw new IllegalArgumentException("String_Node_Str" + prop.getName() + "String_Node_Str"+ value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create a property oracle that will return the supplied values.
 * @param orderedProps array of binding properties
 * @param orderedPropValues values of the above binding properties
 * @param configProps array of config properties
 */
public StaticPropertyOracle(BindingProperty[] orderedProps,String[] orderedPropValues,ConfigurationProperty[] configProps){
  this.orderedProps=orderedProps;
  this.orderedPropValues=orderedPropValues;
  this.configProps=configProps;
  int len=orderedProps.length;
  for (int i=0; i < len; i++) {
    BindingProperty prop=orderedProps[i];
    String value=orderedPropValues[i];
    if (!prop.isAllowedValue(value)) {
      throw new IllegalArgumentException("String_Node_Str" + prop.getName() + "String_Node_Str"+ value);
    }
  }
}
Program: 82365
Project: 82365
Buggy source:
public com.google.gwt.core.ext.SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException {
  for (int i=0; i < orderedProps.length; i++) {
    final BindingProperty prop=orderedProps[i];
    final String name=prop.getName();
    final String fallback=prop.getFallback();
    if (name.equals(propertyName)) {
      final String value=orderedPropValues[i];
      String[] values=prop.getDefinedValues();
      final TreeSet<String> possibleValues=new TreeSet<String>();
      for (      String v : values) {
        possibleValues.add(v);
      }
      return new com.google.gwt.core.ext.SelectionProperty(){
        public String getCurrentValue(){
          return value;
        }
        public String getFallbackValue(){
          return fallback;
        }
        public String getName(){
          return name;
        }
        public SortedSet<String> getPossibleValues(){
          return possibleValues;
        }
      }
;
    }
  }
  throw new BadPropertyValueException(propertyName);
}

Fixed version (ground truth):
public com.google.gwt.core.ext.SelectionProperty getSelectionProperty(TreeLogger logger,String propertyName) throws BadPropertyValueException {
  for (int i=0; i < orderedProps.length; i++) {
    final BindingProperty prop=orderedProps[i];
    final String name=prop.getName();
    if (name.equals(propertyName)) {
      final String value=orderedPropValues[i];
      String[] values=prop.getDefinedValues();
      final TreeSet<String> possibleValues=new TreeSet<String>();
      for (      String v : values) {
        possibleValues.add(v);
      }
      return new DefaultSelectionProperty(value,prop.getFallback(),name,possibleValues);
    }
  }
  throw new BadPropertyValueException(propertyName);
}
Program: 82366
Project: 82366
Buggy source:
/** 
 * Invoke a JS method and return its value.
 * @param name method name to invoke
 * @param jthis object to invoke method on, null if static method
 * @param types argument types
 * @param args argument values
 */
@Override protected JsValue doInvoke(String name,Object jthis,Class<?>[] types,Object[] args) throws Throwable {
  TreeLogger branch=host.getLogger().branch(TreeLogger.DEBUG,"String_Node_Str" + name,null);
  CompilingClassLoader isolatedClassLoader=getIsolatedClassLoader();
  JsValueOOPHM jsthis=new JsValueOOPHM();
  Class<?> jthisType=(jthis == null) ? Object.class : jthis.getClass();
  JsValueGlue.set(jsthis,isolatedClassLoader,jthisType,jthis);
  branch.log(TreeLogger.SPAM,"String_Node_Str" + jsthis);
  int argc=args.length;
  JsValueOOPHM argv[]=new JsValueOOPHM[argc];
  for (int i=0; i < argc; ++i) {
    argv[i]=new JsValueOOPHM();
    JsValueGlue.set(argv[i],isolatedClassLoader,types[i],args[i]);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + i + "String_Node_Str"+ argv[i]);
  }
  JsValueOOPHM returnVal=new JsValueOOPHM();
  try {
    channel.invokeJavascript(isolatedClassLoader,jsthis,name,argv,returnVal);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + returnVal);
  }
 catch (  Throwable t) {
    branch.log(TreeLogger.DEBUG,"String_Node_Str",t);
    throw t;
  }
  return returnVal;
}

Fixed version (ground truth):
/** 
 * Invoke a JS method and return its value.
 * @param name method name to invoke
 * @param jthis object to invoke method on, null if static method
 * @param types argument types
 * @param args argument values
 */
@Override protected JsValue doInvoke(String name,Object jthis,Class<?>[] types,Object[] args) throws Throwable {
  TreeLogger branch=host.getLogger().branch(TreeLogger.SPAM,"String_Node_Str" + name,null);
  CompilingClassLoader isolatedClassLoader=getIsolatedClassLoader();
  JsValueOOPHM jsthis=new JsValueOOPHM();
  Class<?> jthisType=(jthis == null) ? Object.class : jthis.getClass();
  JsValueGlue.set(jsthis,isolatedClassLoader,jthisType,jthis);
  branch.log(TreeLogger.SPAM,"String_Node_Str" + jsthis);
  int argc=args.length;
  JsValueOOPHM argv[]=new JsValueOOPHM[argc];
  for (int i=0; i < argc; ++i) {
    argv[i]=new JsValueOOPHM();
    JsValueGlue.set(argv[i],isolatedClassLoader,types[i],args[i]);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + i + "String_Node_Str"+ argv[i]);
  }
  JsValueOOPHM returnVal=new JsValueOOPHM();
  try {
    channel.invokeJavascript(isolatedClassLoader,jsthis,name,argv,returnVal);
    branch.log(TreeLogger.SPAM,"String_Node_Str" + returnVal);
  }
 catch (  Throwable t) {
    branch.log(TreeLogger.SPAM,"String_Node_Str",t);
    throw t;
  }
  return returnVal;
}
Program: 82367
Project: 82367
Buggy source:
/** 
 * Return true if we are running on a Mac.
 */
private static boolean isMac(){
  String lcOSName=System.getProperty("String_Node_Str").toLowerCase();
  return lcOSName.startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Return true if we are running on a Mac.
 */
private static boolean isMac(){
  String lcOSName=System.getProperty("String_Node_Str").toLowerCase(Locale.ENGLISH);
  return lcOSName.startsWith("String_Node_Str");
}
Program: 82368
Project: 82368
Buggy source:
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase();
  for (  String rule : hosts) {
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}

Fixed version (ground truth):
public static String checkHost(String hostUnderConsideration,Set<String> hosts){
  hostUnderConsideration=hostUnderConsideration.toLowerCase(Locale.ENGLISH);
  for (  String rule : hosts) {
    if (hostUnderConsideration.matches("String_Node_Str" + rule + "String_Node_Str")) {
      return rule;
    }
  }
  return null;
}
Program: 82369
Project: 82369
Buggy source:
static String suggestServletName(String servletClass){
  int pos=servletClass.lastIndexOf('.');
  String suggest=(pos < 0) ? servletClass : servletClass.substring(pos + 1);
  suggest=Character.toLowerCase(suggest.charAt(0)) + suggest.substring(1);
  return suggest;
}

Fixed version (ground truth):
static String suggestServletName(String servletClass){
  int pos=servletClass.lastIndexOf('.');
  String suggest=(pos < 0) ? servletClass : servletClass.substring(pos + 1);
  String firstChar=suggest.substring(0,1).toLowerCase(Locale.ENGLISH);
  suggest=firstChar + suggest.substring(1);
  return suggest;
}
Program: 82370
Project: 82370
Buggy source:
private Set<String> getSuppressedWarnings(MethodDeclaration method){
  Annotation[] annotations=method.annotations;
  if (annotations == null) {
    return Sets.create();
  }
  for (  Annotation a : annotations) {
    if (SuppressWarnings.class.getName().equals(CharOperation.toString(((ReferenceBinding)a.resolvedType).compoundName))) {
      for (      MemberValuePair pair : a.memberValuePairs()) {
        if (String.valueOf(pair.name).equals("String_Node_Str")) {
          Expression valueExpr=pair.value;
          if (valueExpr instanceof StringLiteral) {
            return Sets.create(((StringLiteral)valueExpr).constant.stringValue().toLowerCase());
          }
 else           if (valueExpr instanceof ArrayInitializer) {
            ArrayInitializer ai=(ArrayInitializer)valueExpr;
            String[] values=new String[ai.expressions.length];
            for (int i=0, j=values.length; i < j; i++) {
              values[i]=((StringLiteral)ai.expressions[i]).constant.stringValue().toLowerCase();
            }
            return Sets.create(values);
          }
 else {
            throw new InternalCompilerException("String_Node_Str");
          }
        }
      }
    }
  }
  return Sets.create();
}

Fixed version (ground truth):
private Set<String> getSuppressedWarnings(MethodDeclaration method){
  Annotation[] annotations=method.annotations;
  if (annotations == null) {
    return Sets.create();
  }
  for (  Annotation a : annotations) {
    if (SuppressWarnings.class.getName().equals(CharOperation.toString(((ReferenceBinding)a.resolvedType).compoundName))) {
      for (      MemberValuePair pair : a.memberValuePairs()) {
        if (String.valueOf(pair.name).equals("String_Node_Str")) {
          Expression valueExpr=pair.value;
          if (valueExpr instanceof StringLiteral) {
            return Sets.create(((StringLiteral)valueExpr).constant.stringValue().toLowerCase(Locale.ENGLISH));
          }
 else           if (valueExpr instanceof ArrayInitializer) {
            ArrayInitializer ai=(ArrayInitializer)valueExpr;
            String[] values=new String[ai.expressions.length];
            for (int i=0, j=values.length; i < j; i++) {
              values[i]=((StringLiteral)ai.expressions[i]).constant.stringValue().toLowerCase(Locale.ENGLISH);
            }
            return Sets.create(values);
          }
 else {
            throw new InternalCompilerException("String_Node_Str");
          }
        }
      }
    }
  }
  return Sets.create();
}
Program: 82371
Project: 82371
Buggy source:
public static ClassPathEntry createEntryForUrl(TreeLogger logger,URL url) throws URISyntaxException, IOException {
  if (url.getProtocol().equals("String_Node_Str")) {
    File f=new File(url.toURI());
    String lowerCaseFileName=f.getName().toLowerCase();
    if (f.isDirectory()) {
      return new DirectoryClassPathEntry(f);
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new JarFile(f));
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new ZipFile(f));
    }
 else {
      try {
        return new ZipFileClassPathEntry(new JarFile(f));
      }
 catch (      Exception ignored) {
      }
      try {
        return new ZipFileClassPathEntry(new ZipFile(f));
      }
 catch (      Exception ignored) {
      }
      logger.log(TreeLogger.TRACE,"String_Node_Str" + f + "String_Node_Str");
      return null;
    }
  }
 else {
    logger.log(TreeLogger.WARN,"String_Node_Str" + url,null);
    return null;
  }
}

Fixed version (ground truth):
public static ClassPathEntry createEntryForUrl(TreeLogger logger,URL url) throws URISyntaxException, IOException {
  if (url.getProtocol().equals("String_Node_Str")) {
    File f=new File(url.toURI());
    String lowerCaseFileName=f.getName().toLowerCase(Locale.ENGLISH);
    if (f.isDirectory()) {
      return new DirectoryClassPathEntry(f);
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new JarFile(f));
    }
 else     if (f.isFile() && lowerCaseFileName.endsWith("String_Node_Str")) {
      return new ZipFileClassPathEntry(new ZipFile(f));
    }
 else {
      try {
        return new ZipFileClassPathEntry(new JarFile(f));
      }
 catch (      Exception ignored) {
      }
      try {
        return new ZipFileClassPathEntry(new ZipFile(f));
      }
 catch (      Exception ignored) {
      }
      logger.log(TreeLogger.TRACE,"String_Node_Str" + f + "String_Node_Str");
      return null;
    }
  }
 else {
    logger.log(TreeLogger.WARN,"String_Node_Str" + url,null);
    return null;
  }
}