nus-yam/ex-repair huggingface dataset:
Program: 68862
Project: 68862
Buggy source:
public void testLoadFromAndSaveAfterDefineMultipleSchemas() throws Exception {
  List types=defineTypes();
  xsdHelper.define(getSchema(getUnrelatedSchemaName()));
  FileReader reader=new FileReader(getControlFileName());
  XMLDocument document=xmlHelper.load(reader,null,getOptions());
  verifyAfterLoad(document);
  String s=xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName());
  compareXML(getControlDataObjectFileName(),s);
}

Fixed version (ground truth):
public void testLoadFromAndSaveAfterDefineMultipleSchemas() throws Exception {
  defineTypes();
  xsdHelper.define(getSchema(getUnrelatedSchemaName()));
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,getOptions());
  verifyAfterLoad(document);
  String s=xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName());
  compareXML(getControlDataObjectFileName(),s);
}
Program: 68863
Project: 68863
Buggy source:
public void testLoadFromSAXSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  SAXSource source=null;
  List types=defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  source=new SAXSource(new InputSource(inputStream));
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}

Fixed version (ground truth):
public void testLoadFromSAXSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  SAXSource source=null;
  defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  source=new SAXSource(new InputSource(inputStream));
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}
Program: 68864
Project: 68864
Buggy source:
public void testLoadFromInputStreamWithURIAndOptionsSaveDataObjectToOutputStream() throws Exception {
  List types=defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName(),outstream);
  compareXML(getControlDataObjectFileName(),outstream.toString());
}

Fixed version (ground truth):
public void testLoadFromInputStreamWithURIAndOptionsSaveDataObjectToOutputStream() throws Exception {
  defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName(),outstream);
  compareXML(getControlDataObjectFileName(),outstream.toString());
}
Program: 68865
Project: 68865
Buggy source:
public void testLoadFromFileReaderWithURIAndOptionsStreamSaveDataObjectToWriter() throws Exception {
  List types=defineTypes();
  FileReader reader=new FileReader(getControlFileName());
  XMLDocument document=xmlHelper.load(reader,null,getOptions());
  verifyAfterLoad(document);
  String s=xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName());
  compareXML(getControlDataObjectFileName(),s);
}

Fixed version (ground truth):
public void testLoadFromFileReaderWithURIAndOptionsStreamSaveDataObjectToWriter() throws Exception {
  defineTypes();
  FileReader reader=new FileReader(getControlFileName());
  XMLDocument document=xmlHelper.load(reader,null,getOptions());
  verifyAfterLoad(document);
  String s=xmlHelper.save(document.getRootObject(),getControlRootURI(),getControlRootName());
  compareXML(getControlDataObjectFileName(),s);
}
Program: 68866
Project: 68866
Buggy source:
public void testLoadFromStreamSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  StreamSource source=null;
  List types=defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  source=new StreamSource(inputStream);
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}

Fixed version (ground truth):
public void testLoadFromStreamSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  StreamSource source=null;
  defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  source=new StreamSource(inputStream);
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}
Program: 68867
Project: 68867
Buggy source:
public void testLoadFromInputStreamSaveDocumentToOutputStream() throws Exception {
  List types=defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  xmlHelper.save(document,outputStream,null);
  compareXML(getControlWriteFileName(),outputStream.toString());
}

Fixed version (ground truth):
public void testLoadFromInputStreamSaveDocumentToOutputStream() throws Exception {
  defineTypes();
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  xmlHelper.save(document,outputStream,null);
  compareXML(getControlWriteFileName(),outputStream.toString());
}
Program: 68868
Project: 68868
Buggy source:
public void testLoadFromInputStreamWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  DocumentBuilderFactory factory;
  DocumentBuilder builder;
  Document document1=null;
  List types=defineTypes();
  factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  builder=factory.newDocumentBuilder();
  document1=builder.parse(new File(getControlFileName()));
  document1.toString();
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(new FileInputStream(getControlFileName()),null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}

Fixed version (ground truth):
public void testLoadFromInputStreamWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  DocumentBuilderFactory factory;
  DocumentBuilder builder;
  Document document1=null;
  defineTypes();
  factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  builder=factory.newDocumentBuilder();
  document1=builder.parse(new File(getControlFileName()));
  document1.toString();
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(new FileInputStream(getControlFileName()),null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}
Program: 68869
Project: 68869
Buggy source:
public void testLoadFromDomSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  DocumentBuilderFactory factory;
  DocumentBuilder builder;
  Document document1=null;
  DOMSource source=null;
  List types=defineTypes();
  factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  builder=factory.newDocumentBuilder();
  document1=builder.parse(new File(getControlFileName()));
  source=new DOMSource(document1);
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}

Fixed version (ground truth):
public void testLoadFromDomSourceWithURIAndOptionsSaveDataObjectToStreamResult() throws Exception {
  DocumentBuilderFactory factory;
  DocumentBuilder builder;
  Document document1=null;
  DOMSource source=null;
  defineTypes();
  factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  builder=factory.newDocumentBuilder();
  document1=builder.parse(new File(getControlFileName()));
  source=new DOMSource(document1);
  XMLDocument document=((SDOXMLHelper)xmlHelper).load(source,null,getOptions());
  verifyAfterLoad(document);
  ByteArrayOutputStream outstream=new ByteArrayOutputStream();
  StreamResult result=new StreamResult(outstream);
  ((SDOXMLHelper)xmlHelper).save(document,result,null);
  compareXML(getControlWriteFileName(),result.getOutputStream().toString());
}
Program: 68870
Project: 68870
Buggy source:
/** 
 * OBSOLETE: Replaced by setSessionLog(org.eclipse.persistence.logging.SessionLog);
 * @deprecated
 * @see #setSessionLog(org.eclipse.persistence.logging.SessionLog)
 */
public void setSessionLog(org.eclipse.persistence.sessions.SessionLog sessionLog){
  setSessionLog((org.eclipse.persistence.logging.SessionLog)sessionLog);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Set the session log to which an accessor logs messages and SQL. If not set, this will default to a session log on a writer on System.out. To enable logging, log level can not be OFF. Also set a backpointer to this session in SessionLog.
 * @see #logMessage(String)
 */
public void setSessionLog(SessionLog sessionLog){
  this.sessionLog=sessionLog;
  if ((sessionLog != null) && (sessionLog.getSession() == null)) {
    sessionLog.setSession(this);
  }
}
Program: 68871
Project: 68871
Buggy source:
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels.
 */
public void process_log_exceptions_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    ((AbstractSession)sessionHolder.getObject()).getSessionLog().setShouldLogExceptions(bool.booleanValue());
  }
 catch (  Throwable exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels.
 */
public void process_log_exceptions_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    if (bool && ((AbstractSession)sessionHolder.getObject()).getSessionLog().getLevel() > SessionLog.WARNING) {
      ((AbstractSession)sessionHolder.getObject()).getSessionLog().setLevel(SessionLog.WARNING);
    }
  }
 catch (  Throwable exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}
Program: 68872
Project: 68872
Buggy source:
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels
 */
public void process_enable_logging_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    ((AbstractSession)sessionHolder.getObject()).setShouldLogMessages(bool.booleanValue());
  }
 catch (  Exception exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels
 */
public void process_enable_logging_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    if (bool.booleanValue() && (((AbstractSession)sessionHolder.getObject()).getSessionLog().getLevel() > SessionLog.FINER)) {
      ((AbstractSession)sessionHolder.getObject()).setLogLevel(SessionLog.FINER);
    }
 else     if (!bool.booleanValue()) {
      ((AbstractSession)sessionHolder.getObject()).setLogLevel(SessionLog.OFF);
    }
  }
 catch (  Exception exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}
Program: 68873
Project: 68873
Buggy source:
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels.
 */
public void process_log_debug_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    ((AbstractSession)sessionHolder.getObject()).getSessionLog().setShouldLogDebug(bool.booleanValue());
  }
 catch (  Throwable exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Obsolete.  Map this tag to the new log levels.
 */
public void process_log_debug_Tag(Node node,ObjectHolder sessionHolder){
  try {
    Boolean bool=Boolean.valueOf(node.getFirstChild().getNodeValue());
    if (bool) {
      ((AbstractSession)sessionHolder.getObject()).getSessionLog().setLevel(SessionLog.FINEST);
    }
  }
 catch (  Throwable exception) {
    getExceptionStore().add(SessionLoaderException.failedToLoadTag(node.getNodeName(),node.getFirstChild().getNodeValue(),exception));
  }
}
Program: 68874
Project: 68874
Buggy source:
/** 
 * INTERNAL: Execute this command.  Recreate the remote connection and add it to the connections list.
 */
public void execute(AbstractSession session,RemoteSessionController remoteSessionController){
  AbstractJNDIClusteringService service=(AbstractJNDIClusteringService)session.getCacheSynchronizationManager().getClusteringService();
  session.getCacheSynchronizationManager().getRemoteConnections().put(sessionId,service.createRemoteConnection(sessionId,jndiURL));
  session.logDebug("String_Node_Str" + sessionId);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Execute this command.  Recreate the remote connection and add it to the connections list.
 */
public void execute(AbstractSession session,RemoteSessionController remoteSessionController){
  AbstractJNDIClusteringService service=(AbstractJNDIClusteringService)session.getCacheSynchronizationManager().getClusteringService();
  session.getCacheSynchronizationManager().getRemoteConnections().put(sessionId,service.createRemoteConnection(sessionId,jndiURL));
  session.log(SessionLog.FINEST,"String_Node_Str" + sessionId,(Object[])null,null,false);
}
Program: 68875
Project: 68875
Buggy source:
/** 
 * OBSOLETE:
 * @deprecated replaced by log(org.eclipse.persistence.logging.SessionLogEntry)
 */
public void log(org.eclipse.persistence.sessions.SessionLogEntry entry){
  if (!shouldLog(entry.getLevel())) {
    return;
  }
synchronized (this) {
    SessionLogEntry newEntry=new SessionLogEntry(entry.getSession());
    newEntry.setException(entry.getException());
    newEntry.setLevel(entry.getLevel());
    newEntry.setMessage(entry.getMessage());
    newEntry.setDate(entry.getDate());
    newEntry.setConnection(entry.getConnection());
    newEntry.setNameSpace(entry.getNameSpace());
    newEntry.setParameters(entry.getParameters());
    log(newEntry);
  }
}

Fixed version (ground truth):
/** 
 * PUBLIC: <p> Log a SessionLogEntry </p><p>
 * @param entry SessionLogEntry that holds all the information for a TopLink logging event</p>
 */
public abstract void log(SessionLogEntry sessionLogEntry);
Program: 68876
Project: 68876
Buggy source:
/** 
 * Return the system default log level. This is based on the System property "topink.logging.level", or INFO if not set.
 */
public static int getDefaultLoggingLevel(){
  String logLevel=System.getProperty(PersistenceUnitProperties.LOGGING_LEVEL);
  return translateStringToLoggingLevel(logLevel);
}

Fixed version (ground truth):
/** 
 * Return the system default log level. This is based on the System property "eclipselink.logging.level", or INFO if not set.
 */
public static int getDefaultLoggingLevel(){
  String logLevel=System.getProperty(PersistenceUnitProperties.LOGGING_LEVEL);
  return translateStringToLoggingLevel(logLevel);
}
Program: 68877
Project: 68877
Buggy source:
/** 
 * Called by the container when an EntityManagerFactory is to be created.
 * @param info Metadata for use by the persistence provider
 * @return EntityManagerFactory for the persistence unitspecified by the metadata
 * @param map A Map of integration-level properties for useby the persistence provider.
 */
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info,Map properties){
  Map nonNullProperties=(properties == null) ? new HashMap() : properties;
  EntityManagerSetupImpl emSetupImpl=null;
synchronized (EntityManagerFactoryProvider.emSetupImpls) {
    String urlAndName=info.getPersistenceUnitRootUrl() + info.getPersistenceUnitName();
    emSetupImpl=EntityManagerFactoryProvider.getEntityManagerSetupImpl(urlAndName);
    if (emSetupImpl == null) {
      emSetupImpl=new EntityManagerSetupImpl();
      emSetupImpl.setIsInContainerMode(true);
      EntityManagerFactoryProvider.addEntityManagerSetupImpl(urlAndName,emSetupImpl);
    }
  }
  ClassTransformer transformer=null;
  if (!emSetupImpl.isDeployed()) {
    transformer=emSetupImpl.predeploy(info,nonNullProperties);
  }
  if (transformer != null) {
    info.addTransformer(transformer);
  }
  EntityManagerFactoryImpl factory=new EntityManagerFactoryImpl(emSetupImpl,nonNullProperties);
  if (emSetupImpl.shouldGetSessionOnCreateFactory(nonNullProperties)) {
    factory.getServerSession();
  }
  return factory;
}

Fixed version (ground truth):
/** 
 * Called by the container when an EntityManagerFactory is to be created.
 * @param info Metadata for use by the persistence provider
 * @return EntityManagerFactory for the persistence unitspecified by the metadata
 * @param map A Map of integration-level properties for useby the persistence provider.
 */
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info,Map properties){
  Map nonNullProperties=(properties == null) ? new HashMap() : properties;
  EntityManagerSetupImpl emSetupImpl=null;
  boolean isNew=false;
  ClassTransformer transformer=null;
synchronized (EntityManagerFactoryProvider.emSetupImpls) {
    String urlAndName=info.getPersistenceUnitRootUrl() + info.getPersistenceUnitName();
    emSetupImpl=EntityManagerFactoryProvider.getEntityManagerSetupImpl(urlAndName);
    if (emSetupImpl == null) {
      emSetupImpl=new EntityManagerSetupImpl();
      isNew=true;
      emSetupImpl.setIsInContainerMode(true);
      transformer=emSetupImpl.predeploy(info,nonNullProperties);
      EntityManagerFactoryProvider.addEntityManagerSetupImpl(urlAndName,emSetupImpl);
    }
  }
  if (!isNew && !emSetupImpl.isDeployed()) {
    transformer=emSetupImpl.predeploy(info,nonNullProperties);
  }
  if (transformer != null) {
    info.addTransformer(transformer);
  }
  EntityManagerFactoryImpl factory=new EntityManagerFactoryImpl(emSetupImpl,nonNullProperties);
  if (emSetupImpl.shouldGetSessionOnCreateFactory(nonNullProperties)) {
    factory.getServerSession();
  }
  return factory;
}
Program: 68878
Project: 68878
Buggy source:
public void testDiscoverNewReferencedObject(){
}

Fixed version (ground truth):
public void testDiscoverNewReferencedObject(){
  String firstName="String_Node_Str";
  EntityManager em=createEntityManager();
  int employeeId=0;
  em.getTransaction().begin();
  try {
    Employee employee=new Employee();
    employee.setFirstName(firstName);
    employee.setLastName("String_Node_Str");
    em.persist(employee);
    em.getTransaction().commit();
    employeeId=employee.getId();
  }
  finally {
    if (em.getTransaction().isActive()) {
      em.getTransaction().rollback();
    }
    em.close();
  }
  em=createEntityManager();
  int managerId=0;
  em.getTransaction().begin();
  try {
    Employee manager=new Employee();
    manager.setFirstName(firstName);
    manager.setLastName("String_Node_Str");
    PhoneNumber phoneNumber1=new PhoneNumber("String_Node_Str","String_Node_Str","String_Node_Str");
    manager.addPhoneNumber(phoneNumber1);
    PhoneNumber phoneNumber2=new PhoneNumber("String_Node_Str","String_Node_Str","String_Node_Str");
    manager.addPhoneNumber(phoneNumber2);
    Employee employee=(Employee)em.find(Employee.class,employeeId);
    manager.addManagedEmployee(employee);
    em.getTransaction().commit();
    managerId=manager.getId();
  }
  finally {
    if (em.getTransaction().isActive()) {
      em.getTransaction().rollback();
    }
    em.close();
  }
  String errorMsg="String_Node_Str";
  em=createEntityManager();
  try {
    Employee manager=(Employee)em.createQuery("String_Node_Str" + managerId).setHint("String_Node_Str","String_Node_Str").getSingleResult();
    if (manager == null) {
      errorMsg="String_Node_Str";
    }
 else {
      if (manager.getPhoneNumbers().size() != 2) {
        errorMsg="String_Node_Str" + manager.getPhoneNumbers().size() + "String_Node_Str";
      }
    }
  }
  finally {
    em.close();
  }
  em=createEntityManager();
  em.getTransaction().begin();
  try {
    if (managerId != 0) {
      Employee manager=(Employee)em.find(Employee.class,managerId);
      em.remove(manager);
    }
 else     if (employeeId != 0) {
      Employee employee=(Employee)em.find(Employee.class,employeeId);
      em.remove(employee);
    }
  }
  finally {
    if (em.getTransaction().isActive()) {
      em.getTransaction().rollback();
    }
    em.close();
  }
  if (errorMsg.length() > 0) {
    fail(errorMsg);
  }
}
Program: 68879
Project: 68879
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  return new TestSetup(suite){
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession(persistenceUnitName);
      JPAPropertiesRelationshipTableManager tm=new JPAPropertiesRelationshipTableManager();
      tm.replaceTables(session);
    }
    protected void tearDown(){
      clearCache();
    }
  }
;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  suite.addTest(new JPAAdvPropertiesJUnitTestCase("String_Node_Str"));
  return new TestSetup(suite){
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession(persistenceUnitName);
      JPAPropertiesRelationshipTableManager tm=new JPAPropertiesRelationshipTableManager();
      tm.replaceTables(session);
    }
    protected void tearDown(){
      clearCache();
    }
  }
;
}
Program: 68880
Project: 68880
Buggy source:
/** 
 * Make any changes to our ServerSession that can be made after it is created.
 */
protected void updateServerSession(Map m,ClassLoader loader){
  if (session == null || session.isConnected()) {
    return;
  }
  boolean serverPlatformChanged=updateServerPlatform(m,loader);
  boolean sessionNameChanged=updateSessionName(m);
  updateLoggers(m,serverPlatformChanged,sessionNameChanged,loader);
  String shouldBindString=getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_BIND_PARAMETERS,m,session);
  if (shouldBindString != null) {
    session.getPlatform().setShouldBindAllParameters(Boolean.parseBoolean(shouldBindString));
  }
  updateLogins(m);
  if (!session.getLogin().shouldUseExternalTransactionController()) {
    session.getServerPlatform().disableJTA();
  }
  setSessionEventListener(loader);
  setExceptionHandler(loader);
  updatePools(m);
  if (!isSessionLoadedFromSessionsXML) {
    updateDescriptorCacheSettings(m,loader);
  }
  updateBatchWritingSetting(m);
  updateNativeSQLSetting();
  updateCacheStatementSettings();
  updateTemporalMutableSetting();
  processDescriptorCustomizers(m,loader);
  processSessionCustomizer(m,loader);
  setDescriptorNamedQueries();
}

Fixed version (ground truth):
/** 
 * Make any changes to our ServerSession that can be made after it is created.
 */
protected void updateServerSession(Map m,ClassLoader loader){
  if (session == null || session.isConnected()) {
    return;
  }
  boolean serverPlatformChanged=updateServerPlatform(m,loader);
  boolean sessionNameChanged=updateSessionName(m);
  updateLoggers(m,serverPlatformChanged,sessionNameChanged,loader);
  updateProfiler(m,loader);
  String shouldBindString=getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_BIND_PARAMETERS,m,session);
  if (shouldBindString != null) {
    session.getPlatform().setShouldBindAllParameters(Boolean.parseBoolean(shouldBindString));
  }
  updateLogins(m);
  if (!session.getLogin().shouldUseExternalTransactionController()) {
    session.getServerPlatform().disableJTA();
  }
  setSessionEventListener(loader);
  setExceptionHandler(loader);
  updatePools(m);
  if (!isSessionLoadedFromSessionsXML) {
    updateDescriptorCacheSettings(m,loader);
  }
  updateBatchWritingSetting(m);
  updateNativeSQLSetting();
  updateCacheStatementSettings();
  updateTemporalMutableSetting();
  processDescriptorCustomizers(m,loader);
  processSessionCustomizer(m,loader);
  setDescriptorNamedQueries();
}
Program: 68885
Project: 68885
Buggy source:
public void setId(Integer id){
  this.id=id;
}

Fixed version (ground truth):
public void setId(String id){
  this.id=id;
}
Program: 68886
Project: 68886
Buggy source:
public Integer getId(){
  return id;
}

Fixed version (ground truth):
public String getId(){
  return id;
}
Program: 68887
Project: 68887
Buggy source:
@Override public void close(){
  _scope.promote_forward_del_locals(_gvn,_par._par == null ? null : _par._scope);
  if (_scope.is_dead())   return;
  if (_par._par == null) {
    CallNode.reset_to_init0();
    FunNode.reset_to_init0();
    _gvn.reset_to_init0();
    return;
  }
  while (_scope._uses._len > 0) {
    Node use=_scope._uses.at(0);
    int idx=use._defs.find(_scope);
    use.set_def(idx,_par._scope,_gvn);
  }
  _gvn.kill0(_scope);
}

Fixed version (ground truth):
@Override public void close(){
  _scope.promote_forward_del_locals(_gvn,_par._par == null ? null : _par._scope);
  if (_scope.is_dead())   return;
  if (_par._par == null) {
    CallNode.reset_to_init0();
    FunNode.reset_to_init0();
    _gvn.reset_to_init0();
    return;
  }
  while (_scope._uses._len > 0) {
    Node use=_scope._uses.at(0);
    int idx=use._defs.find(_scope);
    _gvn.set_def_reg(use,idx,_par._scope);
  }
  _gvn.kill0(_scope);
}
Program: 68888
Project: 68888
Buggy source:
/** 
 * Parse a list of statements; final semi-colon is optional. stmts= stmt [; stmt]*[;]? 
 */
private Node stmts(){
  Node stmt=stmt(), last=null;
  while (stmt != null) {
    if (!peek(';'))     return stmt;
    last=stmt;
    stmt=stmt();
    if (stmt != null && last != null)     kill(last);
  }
  return last;
}

Fixed version (ground truth):
/** 
 * Parse a list of statements; final semi-colon is optional. stmts= stmt [; stmt]*[;]? 
 */
private Node stmts(){
  Node stmt=stmt(), last=null;
  while (stmt != null) {
    if (!peek(';'))     return stmt;
    last=stmt;
    stmt=stmt();
    if (stmt != null)     kill(last);
  }
  return last;
}
Program: 68889
Project: 68889
Buggy source:
/** 
 * Parse an anonymous function; the opening '{' already parsed.  After the '{' comes an optional list of arguments and a '->' token. func = { [[id]* ->]? stmt }
 */
private Node func(){
  int oldx=_x;
  Ary<String> ids=new Ary<>(new String[1],0);
  while (true) {
    String tok=token();
    if (tok == null) {
      ids.clear();
      _x=oldx;
      break;
    }
    if (tok.equals("String_Node_Str"))     break;
    ids.add(tok);
  }
  Node old_ctrl=ctrl();
  FunNode fun=init(new FunNode(ids._len,old_ctrl));
  try (Env e=new Env(_e)){
    _e=e;
    set_ctrl(fun);
    int cnt=0;
    for (    String id : ids)     _e.add(id,gvn(new ParmNode(cnt++,id,fun,con(Type.SCALAR))));
    Node rpc=gvn(new ParmNode(-1,"String_Node_Str",fun,_gvn.con(TypeRPC.ALL_CALL)));
    Node rez=stmts();
    Node epi=gvn(new EpilogNode(ctrl(),rez,rpc,fun));
    require('}');
    _e=_e._par;
    set_ctrl(old_ctrl);
    return epi;
  }
 }

Fixed version (ground truth):
/** 
 * Parse an anonymous function; the opening '{' already parsed.  After the '{' comes an optional list of arguments and a '->' token. func = { [[id]* ->]? stmt }
 */
private Node func(){
  int oldx=_x;
  Ary<String> ids=new Ary<>(new String[1],0);
  while (true) {
    String tok=token();
    if (tok == null) {
      ids.clear();
      _x=oldx;
      break;
    }
    if (tok.equals("String_Node_Str"))     break;
    ids.add(tok);
  }
  Node old_ctrl=ctrl();
  FunNode fun=init(new FunNode(ids._len,old_ctrl));
  try (Env e=new Env(_e)){
    _e=e;
    set_ctrl(fun);
    int cnt=0;
    for (    String id : ids)     _e.add(id,gvn(new ParmNode(cnt++,id,fun,con(Type.SCALAR))));
    Node rpc=gvn(new ParmNode(-1,"String_Node_Str",fun,_gvn.con(TypeRPC.ALL_CALL)));
    Node rez=stmts();
    require('}');
    Node epi=gvn(new EpilogNode(ctrl(),rez,rpc,fun));
    _e=_e._par;
    set_ctrl(old_ctrl);
    return epi;
  }
 }
Program: 68890
Project: 68890
Buggy source:
public Type type(Node n){
  Type t=n._uid < _ts._len ? _ts._es[n._uid] : null;
  if (t != null)   return t;
  t=n.all_type();
  if (_opt)   t=t.dual();
  return _ts.setX(n._uid,t);
}

Fixed version (ground truth):
public Type type(Node n){
  Type t=n._uid < _ts._len ? _ts._es[n._uid] : null;
  return t == null ? _ts.setX(n._uid,n.all_type()) : t;
}
Program: 68891
Project: 68891
Buggy source:
public Node xform(Node n){
  if (_opt)   throw AA.unimpl();
  return xform_new(n);
}

Fixed version (ground truth):
public Node xform(Node n){
}
Program: 68893
Project: 68893
Buggy source:
void iter(){
  while (_work._len > 0) {
    Node n=_work.pop();
    _wrk_bits.clear(n._uid);
    if (n.is_dead())     continue;
    if (n instanceof ScopeNode || n instanceof TmpNode)     continue;
    if (n._uses._len == 0) {
      kill(n);
      continue;
    }
    xform_old(n);
  }
}

Fixed version (ground truth):
void iter(){
  Ary<Node> funs=new Ary<>(new Node[1],0);
  BitSet fun_bits=new BitSet();
  boolean work;
  while ((work=_work._len > 0) || funs._len > 0) {
    Node n=(work ? _work : funs).pop();
    (work ? _wrk_bits : fun_bits).clear(n._uid);
    if (n.is_dead())     continue;
    if (n instanceof ScopeNode || n instanceof TmpNode)     continue;
    if (n._uses._len == 0) {
      kill(n);
      continue;
    }
    if (_work._len > 0 && n instanceof FunNode && n.is_copy(this,-1) == null) {
      if (!fun_bits.get(n._uid)) {
        funs.add(n);
        fun_bits.set(n._uid);
      }
    }
 else {
      xform_old(n);
    }
  }
}
Program: 68894
Project: 68894
Buggy source:
protected boolean canBeConst(){
switch (_type) {
case TSCALAR:
case TNUM:
case TREAL:
    return false;
case TXREAL:
case TXNUM:
case TXSCALAR:
  return true;
default :
throw AA.unimpl();
}
}

Fixed version (ground truth):
protected boolean canBeConst(){
switch (_type) {
case TSCALAR:
case TNUM:
case TREAL:
case TCONTROL:
    return false;
case TXREAL:
case TXNUM:
case TXSCALAR:
  return true;
default :
throw AA.unimpl();
}
}
Program: 68895
Project: 68895
Buggy source:
@Override public boolean is_con(){
  return false;
}

Fixed version (ground truth):
@Override public boolean is_con(){
  return !_all;
}
Program: 68896
Project: 68896
Buggy source:
@Override public boolean canBeConst(){
  throw AA.unimpl();
}

Fixed version (ground truth):
@Override public boolean canBeConst(){
  return _rpcs.abit() > 0;
}
Program: 68897
Project: 68897
Buggy source:
@Override public boolean is_con(){
  if (_inf == TypeErr.ALL)   throw AA.unimpl();
  for (  Type _t : _ts)   if (!_t.is_con())   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean is_con(){
  for (  Type _t : _ts)   if (!_t.is_con())   return false;
  return _inf.is_con();
}
Program: 68898
Project: 68898
Buggy source:
@Override protected boolean canBeConst(){
  if (_inf == TypeErr.ANY)   throw AA.unimpl();
  for (  Type _t : _ts)   if (_t.canBeConst())   return true;
  return false;
}

Fixed version (ground truth):
@Override protected boolean canBeConst(){
  for (  Type _t : _ts)   if (!_t.canBeConst())   return false;
  return _inf.canBeConst();
}
Program: 68899
Project: 68899
Buggy source:
public FunNode funode(){
  return (FunNode)(FunNode.get(fidx()).at(0).at(2));
}

Fixed version (ground truth):
FunNode funode(){
  return (FunNode)(FunNode.get(fidx()).at(0).at(2));
}
Program: 68900
Project: 68900
Buggy source:
@Override protected Type xmeet(Type t){
switch (t._type) {
case TERROR:
    return ((TypeErr)t)._all ? t : this;
case TCONTROL:
case TTUPLE:
  return TypeErr.ALL;
case TFLT:
case TINT:
case TSTR:
return Type.SCALAR;
case TFUN:
break;
case TUNION:
return t.xmeet(this);
default :
throw typerr(t);
}
TypeFun tf=(TypeFun)t;
if (_ts != tf._ts || _ret != tf._ret) return TypeUnion.make(false,this,tf);
return make(_ts,_ret,_fidxs.or(tf._fidxs));
}

Fixed version (ground truth):
@Override protected Type xmeet(Type t){
switch (t._type) {
case TERROR:
    return ((TypeErr)t)._all ? t : this;
case TCONTROL:
case TTUPLE:
  return TypeErr.ALL;
case TFLT:
case TINT:
case TSTR:
return Type.SCALAR;
case TFUN:
break;
case TUNION:
return t.xmeet(this);
default :
throw typerr(t);
}
TypeFun tf=(TypeFun)t;
Bits fidxs=_fidxs.or(tf._fidxs);
if (fidxs != _fidxs && fidxs != tf._fidxs) return TypeUnion.make(false,this,tf);
TypeTuple ts=(TypeTuple)_ts.meet(tf._ts);
Type ret=_ret.meet(tf._ret);
return make(ts,ret,fidxs);
}
Program: 68901
Project: 68901
Buggy source:
private int calcHashCode(Object splitKey){
  int hashCode=splitKey.hashCode();
  return hashCode;
}

Fixed version (ground truth):
private int calcHashCode(Object splitKey){
  int hashCode=splitKey.hashCode();
  if (hashCode < 0)   hashCode=-hashCode;
  return hashCode;
}
Program: 68902
Project: 68902
Buggy source:
public int getDbNo(Object splitKey){
  return getTableNo(splitKey) / dbNum;
}

Fixed version (ground truth):
public int getDbNo(Object splitKey){
  return getTableNo(splitKey) / tableNum;
}
Program: 68903
Project: 68903
Buggy source:
public int getNodeNo(Object splitKey){
  return getDbNo(splitKey) / portNum;
}

Fixed version (ground truth):
public int getNodeNo(Object splitKey){
  return getDbNo(splitKey) / dbNum;
}
Program: 68904
Project: 68904
Buggy source:
@Test(groups={"String_Node_Str"}) public void testSimpleSplitJdbcTemplate(){
  SimpleSplitJdbcTemplate simpleSplitJdbcTemplate=(SimpleSplitJdbcTemplate)applicationContext.getBean("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  Random random=new Random(new Date().getTime());
  for (int i=0; i < random.nextInt(16); i++)   idService.genId();
  long id=idService.genId();
  TestTable testTable=new TestTable();
  testTable.setId(id);
  testTable.setName("String_Node_Str" + id);
  testTable.setGender(Gender.MALE);
  testTable.setLstUpdTime(new Date());
  testTable.setLstUpdUser("String_Node_Str");
  simpleSplitJdbcTemplate.insert(id,testTable);
  TestTable q=new TestTable();
  TestTable testTable1=simpleSplitJdbcTemplate.get(id,id,TestTable.class);
  AssertJUnit.assertEquals(testTable.getName(),testTable1.getName());
  AssertJUnit.assertEquals(testTable.getGender(),testTable1.getGender());
  AssertJUnit.assertEquals(testTable.getLstUpdUser(),testTable1.getLstUpdUser());
  System.out.println(testTable1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testSimpleSplitJdbcTemplate(){
  SimpleSplitJdbcTemplate simpleSplitJdbcTemplate=(SimpleSplitJdbcTemplate)applicationContext.getBean("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  Random random=new Random(new Date().getTime());
  for (int i=0; i < random.nextInt(16); i++)   idService.genId();
  long id=idService.genId();
  System.out.println("String_Node_Str" + id);
  TestTable testTable=new TestTable();
  testTable.setId(id);
  testTable.setName("String_Node_Str" + id);
  testTable.setGender(Gender.MALE);
  testTable.setLstUpdTime(new Date());
  testTable.setLstUpdUser("String_Node_Str");
  simpleSplitJdbcTemplate.insert(id,testTable);
  TestTable q=new TestTable();
  TestTable testTable1=simpleSplitJdbcTemplate.get(id,id,TestTable.class);
  AssertJUnit.assertEquals(testTable.getId(),testTable1.getId());
  AssertJUnit.assertEquals(testTable.getName(),testTable1.getName());
  AssertJUnit.assertEquals(testTable.getGender(),testTable1.getGender());
  AssertJUnit.assertEquals(testTable.getLstUpdUser(),testTable1.getLstUpdUser());
  AssertJUnit.assertEquals((testTable.getLstUpdTime().getTime() + 500) / 1000 * 1000,testTable1.getLstUpdTime().getTime());
  System.out.println("String_Node_Str" + testTable1);
}
Program: 68905
Project: 68905
Buggy source:
public <T>T get(String name,String value,final Class<T> clazz);

Fixed version (ground truth):
public <T>T get(String name,Object value,final Class<T> clazz);
Program: 68906
Project: 68906
Buggy source:
public T mapRow(ResultSet rs,int rowNum) throws SQLException {
  return OrmUtil.convertRow2Bean(rs,clazz);
}

Fixed version (ground truth):
public T mapRow(ResultSet rs,int rowNum) throws SQLException {
  return (T)OrmUtil.convertRow2Bean(rs,bean.getClass());
}
Program: 68907
Project: 68907
Buggy source:
public <T>T get(String name,String value,final Class<T> clazz){
  SqlRunningBean srb=SqlUtil.generateSelectSql(name,value,clazz);
  T bean=this.queryForObject(srb.getSql(),srb.getParams(),new RowMapper<T>(){
    public T mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return OrmUtil.convertRow2Bean(rs,clazz);
    }
  }
);
  return bean;
}

Fixed version (ground truth):
public <T>T get(String name,Object value,final Class<T> clazz){
  SqlRunningBean srb=SqlUtil.generateSelectSql(name,value,clazz);
  T bean=this.queryForObject(srb.getSql(),srb.getParams(),new RowMapper<T>(){
    public T mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return OrmUtil.convertRow2Bean(rs,clazz);
    }
  }
);
  return bean;
}
Program: 68908
Project: 68908
Buggy source:
public static <T>SqlRunningBean generateSearchSql(T bean,String dbPrefix,String tablePrefix,int dbNo,int tableNo){
  return generateSearchSql(bean,null,null,null,dbPrefix,tablePrefix,dbNo,tableNo);
}

Fixed version (ground truth):
public static <T>SqlRunningBean generateSearchSql(T bean){
  return generateSearchSql(bean,null,null,null,null,null,-1,-1);
}
Program: 68909
Project: 68909
Buggy source:
public int getNodeNo(Object splitKey){
  return getTableNo(splitKey) / portNum;
}

Fixed version (ground truth):
public int getNodeNo(Object splitKey){
  return getDbNo(splitKey) / portNum;
}
Program: 68910
Project: 68910
Buggy source:
@Dimension(unit=Dimension.PX) public float getTextSize(){
  return mTextPaint.getTextSize();
}

Fixed version (ground truth):
@Dimension public float getTextSize(){
  return mTextPaint.getTextSize();
}
Program: 68911
Project: 68911
Buggy source:
public AvatarImageView(Context context,AttributeSet attrs){
  super(context,attrs);
  String initial=DEF_INITIAL;
  int textColor=Color.WHITE;
  int textSize=DEF_TEXT_SIZE;
  int backgroundColor=DEF_BACKGROUND_COLOR;
  int showState=DEF_STATE;
  if (attrs != null) {
    TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.AvatarImageView,0,0);
    initial=a.getString(R.styleable.AvatarImageView_avatar_text);
    textColor=a.getColor(R.styleable.AvatarImageView_avatar_textColor,textColor);
    textSize=a.getDimensionPixelSize(R.styleable.AvatarImageView_avatar_textSize,textSize);
    backgroundColor=a.getColor(R.styleable.AvatarImageView_avatar_backgroundColor,backgroundColor);
    showState=a.getInt(R.styleable.AvatarImageView_avatar_state,showState);
    a.recycle();
  }
  mShowState=showState;
  mTextPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mTextPaint.setTextAlign(Paint.Align.CENTER);
  mTextPaint.setColor(textColor);
  mTextPaint.setTextSize(textSize);
  mTextBounds=new Rect();
  mInitial=extractInitial(initial);
  updateTextBounds();
  mBackgroundPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mBackgroundPaint.setColor(backgroundColor);
  mBackgroundPaint.setStyle(Paint.Style.FILL);
  mBackgroundBounds=new RectF();
}

Fixed version (ground truth):
public AvatarImageView(Context context,AttributeSet attrs){
  super(context,attrs);
  String initial=DEF_INITIAL;
  int textColor=Color.WHITE;
  int textSize=DEF_TEXT_SIZE;
  int backgroundColor=DEF_BACKGROUND_COLOR;
  int showState=DEF_STATE;
  if (attrs != null) {
    TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.AvatarImageView,0,0);
    initial=a.getString(R.styleable.AvatarImageView_text);
    textColor=a.getColor(R.styleable.AvatarImageView_textColor,textColor);
    textSize=a.getDimensionPixelSize(R.styleable.AvatarImageView_textSize,textSize);
    backgroundColor=a.getColor(R.styleable.AvatarImageView_avatarBackgroundColor,backgroundColor);
    showState=a.getInt(R.styleable.AvatarImageView_state,showState);
    a.recycle();
  }
  mShowState=showState;
  mTextPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mTextPaint.setTextAlign(Paint.Align.CENTER);
  mTextPaint.setColor(textColor);
  mTextPaint.setTextSize(textSize);
  mTextBounds=new Rect();
  mInitial=extractInitial(initial);
  updateTextBounds();
  mBackgroundPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mBackgroundPaint.setColor(backgroundColor);
  mBackgroundPaint.setStyle(Paint.Style.FILL);
  mBackgroundBounds=new RectF();
}
Program: 68912
Project: 68912
Buggy source:
public void setTextSize(@Dimension(unit=Dimension.PX) float size){
  mTextPaint.setTextSize(size);
  updateTextBounds();
  invalidate();
}

Fixed version (ground truth):
public void setTextSize(@Dimension float size){
  mTextPaint.setTextSize(size);
  updateTextBounds();
  invalidate();
}
Program: 68913
Project: 68913
Buggy source:
public static String doHanmingOCR(BufferedImage target){
  ArrayList<BufferedImage> subImages=clipBDIndexImage(target);
  String result="String_Node_Str";
  for (int j=0; j < subImages.size(); j++) {
    BufferedImage subImage=subImages.get(j);
    for (int i=0; i < 10; i++) {
      int distance=getDistance(fps[i],getFingerPrint(subImage));
      if (distance < 40 && distance != -1) {
        result+=i;
        break;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public static String doHanmingOCR(BufferedImage target){
  BufferedImage image=target;
  if (target.getHeight() != 72) {
    int scale=72 / target.getHeight();
    int w=target.getWidth();
    int h=target.getHeight();
    BufferedImage after=new BufferedImage(w * scale,h * scale,target.getType());
    AffineTransform at=new AffineTransform();
    at.scale(scale,scale);
    AffineTransformOp scaleOp=new AffineTransformOp(at,AffineTransformOp.TYPE_BILINEAR);
    image=scaleOp.filter(target,after);
    BufferedImage binaryImage=new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_BYTE_BINARY);
    for (int i=0; i < image.getWidth(); i++) {
      for (int j=0; j < image.getHeight(); j++) {
        int rgb=image.getRGB(i,j);
        binaryImage.setRGB(i,j,rgb);
      }
    }
    image=binaryImage;
  }
  ArrayList<BufferedImage> subImages=clipBDIndexImage(image);
  String result="String_Node_Str";
  for (int j=0; j < subImages.size(); j++) {
    BufferedImage subImage=subImages.get(j);
    for (int i=0; i < 10; i++) {
      int distance=getDistance(fps[i],getFingerPrint(subImage));
      if (distance < distanceThreshold && distance != -1) {
        result+=i;
        break;
      }
    }
  }
  return result;
}
Program: 68914
Project: 68914
Buggy source:
public Vector2 getRandomOpenSpaceNearEntity(Entity target){
  Vector2 targetPosition=ComponentMappers.position.get(target).pos;
  Vector2 position;
  int x=MathUtils.random(-1,1);
  int y=MathUtils.random(-1,1);
  if (!isBlocked(WorldManager.world.currentMapIndex,new Vector2(targetPosition.x + x,targetPosition.y + y))) {
    position=new Vector2(targetPosition.x + 1,targetPosition.y + y);
  }
 else {
    position=null;
  }
  return position;
}

Fixed version (ground truth):
public Vector2 getRandomOpenSpaceNearEntity(Entity target){
  Vector2 targetPosition=ComponentMappers.position.get(target).pos;
  Vector2 position;
  int x=MathUtils.random(-1,1);
  int y=MathUtils.random(-1,1);
  if (!isBlocked(WorldManager.world.currentMapIndex,new Vector2(targetPosition.x + x,targetPosition.y + y))) {
    position=new Vector2(targetPosition.x + x,targetPosition.y + y);
  }
 else {
    position=null;
  }
  return position;
}
Program: 68916
Project: 68916
Buggy source:
private void doThrowAnimation(Entity entity,Entity item,Vector2 position,boolean destroy){
  PositionComponent throwerPosition=ComponentMappers.position.get(entity);
  WorldManager.entityHelpers.updatePosition(item,throwerPosition.pos);
  VisualComponent itemVisual=ComponentMappers.visual.get(item);
  WorldManager.tweens.add(Tween.to(itemVisual.sprite,SpriteAccessor.XY,.5f).target(position.x * Main.SPRITE_WIDTH,position.y * Main.SPRITE_HEIGHT).setCallback((type,source) -> {
    if (type == TweenCallback.COMPLETE) {
      if (destroy) {
        WorldManager.itemHelpers.destroy(entity,item);
      }
 else {
        WorldManager.itemHelpers.drop(entity,item,position);
      }
    }
  }
));
}

Fixed version (ground truth):
private void doThrowAnimation(Entity entity,Entity item,Vector2 position,boolean destroy){
  PositionComponent throwerPosition=ComponentMappers.position.get(entity);
  WorldManager.entityHelpers.updatePosition(item,throwerPosition.pos);
  WorldManager.entityHelpers.updateSpritePosition(item,throwerPosition.pos);
  VisualComponent itemVisual=ComponentMappers.visual.get(item);
  WorldManager.tweens.add(Tween.to(itemVisual.sprite,SpriteAccessor.XY,.25f).target(position.x * Main.SPRITE_WIDTH,position.y * Main.SPRITE_HEIGHT).setCallback((type,source) -> {
    if (type == TweenCallback.COMPLETE) {
      if (destroy) {
        WorldManager.itemHelpers.destroy(entity,item);
      }
 else {
        WorldManager.itemHelpers.drop(entity,item,position);
      }
    }
  }
));
}