nus-yam/ex-repair huggingface dataset:
Program: 19441
Project: 19441
Buggy source:
@Test public void getTypedCache(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache<String,Long> cache=cacheManager.getCache("String_Node_Str",String.class,Long.class);
  assertNotNull(cache);
  assertEquals(String.class,cache.getConfiguration().getKeyType());
  assertEquals(Long.class,cache.getConfiguration().getValueType());
}

Fixed version (ground truth):
@Test public void getTypedCache(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>().setTypes(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache<String,Long> cache=cacheManager.getCache("String_Node_Str",String.class,Long.class);
  assertNotNull(cache);
  assertEquals(String.class,cache.getConfiguration().getKeyType());
  assertEquals(Long.class,cache.getConfiguration().getValueType());
}
Program: 19442
Project: 19442
Buggy source:
@Test(expected=ClassCastException.class) public void getIncorrectCacheType(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache<Long,String> cache=cacheManager.getCache("String_Node_Str",Long.class,String.class);
}

Fixed version (ground truth):
@Test(expected=ClassCastException.class) public void getIncorrectCacheType(){
  CacheManager cacheManager=getCacheManager();
  MutableConfiguration<String,Long> config=new MutableConfiguration<String,Long>().setTypes(String.class,Long.class);
  cacheManager.configureCache("String_Node_Str",config);
  Cache<Long,String> cache=cacheManager.getCache("String_Node_Str",Long.class,String.class);
}
Program: 19443
Project: 19443
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19444
Project: 19444
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19445
Project: 19445
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19446
Project: 19446
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19447
Project: 19447
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19448
Project: 19448
Buggy source:
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>(Long.class,String.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Long,String> newMutableConfiguration(){
  return new MutableConfiguration<Long,String>().setTypes(Long.class,String.class);
}
Program: 19449
Project: 19449
Buggy source:
@Override protected MutableConfiguration<Date,Date> newMutableConfiguration(){
  return new MutableConfiguration<Date,Date>(Date.class,Date.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Date,Date> newMutableConfiguration(){
  return new MutableConfiguration<Date,Date>().setTypes(Date.class,Date.class);
}
Program: 19450
Project: 19450
Buggy source:
@Override protected MutableConfiguration<Date,Date> newMutableConfiguration(){
  return new MutableConfiguration<Date,Date>(Date.class,Date.class);
}

Fixed version (ground truth):
@Override protected MutableConfiguration<Date,Date> newMutableConfiguration(){
  return new MutableConfiguration<Date,Date>().setTypes(Date.class,Date.class);
}
Program: 19451
Project: 19451
Buggy source:
@Test public void createCache_StatusOK(){
  String name="String_Node_Str";
  Cache cache=getCacheManager().configureCache(name,new MutableConfiguration());
  assertSame(Status.STARTED,cache.getStatus());
}

Fixed version (ground truth):
@Test public void createCache_StatusOK(){
  String name="String_Node_Str";
  Cache cache=getCacheManager().configureCache(name,new MutableConfiguration());
  assertNotNull(cache);
  assertEquals(name,cache.getName());
}
Program: 19452
Project: 19452
Buggy source:
@Test public void createCache_Different(){
  String name1="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  assertEquals(Status.STARTED,cache1.getStatus());
  String name2="String_Node_Str";
  Cache cache2=cacheManager.configureCache(name2,new MutableConfiguration());
  assertEquals(Status.STARTED,cache2.getStatus());
  assertEquals(cache1,cacheManager.getCache(name1));
  assertEquals(cache2,cacheManager.getCache(name2));
}

Fixed version (ground truth):
@Test public void createCache_Different(){
  String name1="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  String name2="String_Node_Str";
  Cache cache2=cacheManager.configureCache(name2,new MutableConfiguration());
  assertEquals(cache1,cacheManager.getCache(name1));
  assertEquals(cache2,cacheManager.getCache(name2));
}
Program: 19453
Project: 19453
Buggy source:
@Test public void testReuseCacheManager() throws Exception {
  URI uri=new URI(this.getClass().getName());
  CachingProvider provider=Caching.getCachingProvider();
  CacheManager cacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertThat(cacheManager.getStatus(),is(STARTED));
  cacheManager.close();
  assertThat(cacheManager.getStatus(),is(STOPPED));
  try {
    cacheManager.configureCache("String_Node_Str",null);
    fail();
  }
 catch (  IllegalStateException e) {
  }
  CacheManager otherCacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertThat(otherCacheManager.getStatus(),is(STARTED));
  assertNotSame(cacheManager,otherCacheManager);
}

Fixed version (ground truth):
@Test public void testReuseCacheManager() throws Exception {
  URI uri=new URI(this.getClass().getName());
  CachingProvider provider=Caching.getCachingProvider();
  CacheManager cacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(cacheManager.isClosed());
  cacheManager.close();
  assertTrue(cacheManager.isClosed());
  try {
    cacheManager.configureCache("String_Node_Str",null);
    fail();
  }
 catch (  IllegalStateException e) {
  }
  CacheManager otherCacheManager=provider.getCacheManager(uri,provider.getDefaultClassLoader());
  assertFalse(otherCacheManager.isClosed());
  assertNotSame(cacheManager,otherCacheManager);
}
Program: 19454
Project: 19454
Buggy source:
@Test public void removeCache_CacheStopped(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  cacheManager.removeCache(name1);
  checkStopped(cache1);
}

Fixed version (ground truth):
@Test public void removeCache_CacheStopped(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  cacheManager.removeCache(name1);
  ensureClosed(cache1);
}
Program: 19455
Project: 19455
Buggy source:
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  assertEquals(cache1,cacheManager.getCache(name1));
  checkStarted(cache1);
  Cache cache2=cacheManager.configureCache(name1,new MutableConfiguration());
  assertSame(cache1,cache2);
}

Fixed version (ground truth):
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.configureCache(name1,new MutableConfiguration());
  assertEquals(cache1,cacheManager.getCache(name1));
  ensureOpen(cache1);
  Cache cache2=cacheManager.configureCache(name1,new MutableConfiguration());
  assertSame(cache1,cache2);
}
Program: 19456
Project: 19456
Buggy source:
@Test public void initialise(){
  Assert.assertEquals(Status.STARTED,cache.getStatus());
}

Fixed version (ground truth):
@Test public void initialise(){
  try {
    cache.getCacheManager();
  }
 catch (  IllegalStateException e) {
    fail("String_Node_Str");
  }
}
Program: 19458
Project: 19458
Buggy source:
@Test public void unregisterCacheEntryListener(){
  CacheEntryReadListener<Long,String> listener=new MyCacheEntryListener<Long,String>();
  cache.registerCacheEntryListener(listener,false,null,true);
  assertFalse(cache.unregisterCacheEntryListener(null));
  assertTrue(cache.unregisterCacheEntryListener(listener));
  assertFalse(cache.unregisterCacheEntryListener(listener));
}

Fixed version (ground truth):
@Test public void unregisterCacheEntryListener(){
  assertFalse(cache.unregisterCacheEntryListener(null));
}
Program: 19460
Project: 19460
Buggy source:
/** 
 * Check the listener doesn't get removes from a cache.clear
 */
@Test public void testCacheClearListener(){
  MyCacheEntryListener<Long,String> listener=new MyCacheEntryListener<Long,String>();
  cache.registerCacheEntryListener(listener,false,null,true);
  assertEquals(0,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getReads());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.put(1l,"String_Node_Str");
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getReads());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.clear();
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getReads());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
}

Fixed version (ground truth):
/** 
 * Check the listener doesn't get removes from a cache.clear
 */
@Test public void testCacheClearListener(){
  MyCacheEntryListener<Long,String> listener=new MyCacheEntryListener<Long,String>();
  cache.registerCacheEntryListener(listener,false,null,true);
  assertEquals(0,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.put(1l,"String_Node_Str");
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
  cache.clear();
  assertEquals(1,listener.getCreated());
  assertEquals(0,listener.getUpdated());
  assertEquals(0,listener.getExpired());
  assertEquals(0,listener.getRemoved());
}
Program: 19461
Project: 19461
Buggy source:
private void registerCacheStatistics(Cache cache) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  CacheMXBean mBean=cache.getMBean();
  if (mBean != null) {
    mBeanServer.registerMBean(mBean,mBean.getObjectName());
  }
}

Fixed version (ground truth):
private void registerCacheStatistics(Cache cache) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
  CacheMXBean mBean=cache.getMBean();
  if (mBean != null) {
    mBeanServer.registerMBean(mBean,calculateObjectName(cacheManager.getName(),mBean.getName()));
  }
}
Program: 19462
Project: 19462
Buggy source:
/** 
 * All these work with get(Object)
 */
@Test public void genericsTest(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<Identifier,Beagle> cacheGeneric=cacheManager.getCache(cacheName);
  cacheGeneric=cacheManager.<Identifier,Beagle>createCacheBuilder(cacheName).setStoreByValue(false).build();
  Beagle pistachio=new Beagle();
  cacheGeneric.put(new Identifier("String_Node_Str"),pistachio);
  Cache cacheNonGeneric=cacheManager.getCache(cacheName);
}

Fixed version (ground truth):
/** 
 * All these work with get(Object)
 */
@Test public void genericsTest(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<Identifier,Beagle> cacheGeneric=cacheManager.getCache(cacheName);
  cacheGeneric=cacheManager.<Identifier,Beagle>createCacheBuilder(cacheName).build();
  Beagle pistachio=new Beagle();
  cacheGeneric.put(new Identifier("String_Node_Str"),pistachio);
  Cache cacheNonGeneric=cacheManager.getCache(cacheName);
}
Program: 19463
Project: 19463
Buggy source:
@Test public void simpleAPI(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<String,Integer> cache=cacheManager.getCache(cacheName);
  cache=cacheManager.<String,Integer>createCacheBuilder(cacheName).setStoreByValue(false).build();
  String key="String_Node_Str";
  Integer value1=1;
  cache.put(key,value1);
  Integer value2=cache.get(key);
  assertEquals(value1,value2);
}

Fixed version (ground truth):
@Test public void simpleAPI(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<String,Integer> cache=cacheManager.getCache(cacheName);
  cache=cacheManager.<String,Integer>createCacheBuilder(cacheName).setStoreByValue(true).build();
  String key="String_Node_Str";
  Integer value1=1;
  cache.put(key,value1);
  Integer value2=cache.get(key);
  assertEquals(value1,value2);
}
Program: 19464
Project: 19464
Buggy source:
/** 
 * We know that values can get mutated but so can keys! Which causes lookups to fail. In fact the entry get lost and cannot be retrieved. This is also how Map behaves. TODO: don't think we should dictate semantics for key mutation
 */
@Test public void get_Existing_MutateKey(){
  long now=System.currentTimeMillis();
  Date key1=new Date(now);
  LOG.info(key1.toString());
  Date key1OriginalValue=(Date)key1.clone();
  Date existingValue=new Date(now);
  cache.put(key1,existingValue);
  long later=now + 5000;
  assertTrue(cache.containsKey(key1));
  assertNotNull(cache.get(key1));
  key1.setTime(later);
  LOG.info(key1.toString());
  assertFalse(cache.containsKey(key1));
  assertNull(cache.get(key1));
  assertFalse(cache.containsKey(key1OriginalValue));
  assertNull(cache.get(key1OriginalValue));
  for (  Cache.Entry<Date,Date> entry : cache) {
    LOG.info(entry.getKey().toString());
  }
  assertFalse(cache.remove(key1));
  assertFalse(cache.remove(key1OriginalValue));
}

Fixed version (ground truth):
/** 
 * We know that values can get mutated but so can keys! Which causes lookups to fail. In fact the entry get lost and cannot be retrieved. This is also how Map behaves.
 */
@Test public void get_Existing_MutateKey(){
  long now=System.currentTimeMillis();
  Date key1=new Date(now);
  LOG.info(key1.toString());
  Date key1OriginalValue=(Date)key1.clone();
  Date existingValue=new Date(now);
  cache.put(key1,existingValue);
  long later=now + 5000;
  assertTrue(cache.containsKey(key1));
  assertNotNull(cache.get(key1));
  key1.setTime(later);
  LOG.info(key1.toString());
  assertFalse(cache.containsKey(key1));
  assertNull(cache.get(key1));
  assertFalse(cache.containsKey(key1OriginalValue));
  assertNull(cache.get(key1OriginalValue));
  for (  Cache.Entry<Date,Date> entry : cache) {
    LOG.info(entry.getKey().toString());
  }
  assertFalse(cache.remove(key1));
  assertFalse(cache.remove(key1OriginalValue));
}
Program: 19465
Project: 19465
Buggy source:
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.createCacheBuilder(name1).build();
  assertEquals(cache1,cacheManager.getCache(name1));
  checkStarted(cache1);
  Cache cache2=cacheManager.createCacheBuilder(name1).build();
  assertEquals(cache2,cacheManager.getCache(name1));
  checkStarted(cache2);
  checkStopped(cache1);
}

Fixed version (ground truth):
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.createCacheBuilder(name1).build();
  assertEquals(cache1,cacheManager.getCache(name1));
  checkStarted(cache1);
  try {
    Cache cache2=cacheManager.createCacheBuilder(name1).build();
  }
 catch (  CacheException e) {
  }
}
Program: 19466
Project: 19466
Buggy source:
@Test public void get_DeclaredImmutable(){
  CacheManager cacheManager=getCacheManager();
  cacheManager.addImmutableClass(Date.class);
  Cache<Date,Date> cache=cacheManager.<Date,Date>createCacheBuilder(getTestCacheName()).build();
  long now=System.currentTimeMillis();
  Date existingKey=new Date(now);
  Date existingValue=new Date(now);
  cache.put(existingKey,existingValue);
  if (existingValue == cache.get(existingKey)) {
    LOG.info("String_Node_Str");
  }
 else {
    assertEquals(existingValue,cache.get(existingKey));
  }
}

Fixed version (ground truth):
@Test public void get_DeclaredImmutable(){
  CacheManager cacheManager=getCacheManager();
  cacheManager.addImmutableClass(Date.class);
  cacheManager.removeCache(getTestCacheName());
  Cache<Date,Date> cache=cacheManager.<Date,Date>createCacheBuilder(getTestCacheName()).build();
  long now=System.currentTimeMillis();
  Date existingKey=new Date(now);
  Date existingValue=new Date(now);
  cache.put(existingKey,existingValue);
  if (existingValue == cache.get(existingKey)) {
    LOG.info("String_Node_Str");
  }
 else {
    assertEquals(existingValue,cache.get(existingKey));
  }
}
Program: 19467
Project: 19467
Buggy source:
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache<Integer,String> cache1=cacheManager.<Integer,String>createCacheBuilder(name1).build();
  assertEquals(cache1,cacheManager.<Integer,String>getCache(name1));
  checkStarted(cache1);
  Cache<Integer,String> cache2=cacheManager.<Integer,String>createCacheBuilder(name1).build();
  assertEquals(cache2,cacheManager.<Integer,String>getCache(name1));
  checkStarted(cache2);
  checkStopped(cache1);
}

Fixed version (ground truth):
@Test public void createCache_DifferentSameName(){
  CacheManager cacheManager=getCacheManager();
  String name1="String_Node_Str";
  Cache cache1=cacheManager.createCacheBuilder(name1).build();
  assertEquals(cache1,cacheManager.getCache(name1));
  checkStarted(cache1);
  Cache cache2=cacheManager.createCacheBuilder(name1).build();
  assertEquals(cache2,cacheManager.getCache(name1));
  checkStarted(cache2);
  checkStopped(cache1);
}
Program: 19468
Project: 19468
Buggy source:
/** 
 * Checks that stop is called on all caches. Also checks CacheManager status
 */
@Test public void shutdown_status(){
  CacheManager cacheManager=getCacheManager();
  assertEquals(Status.STARTED,cacheManager.getStatus());
  cacheManager.shutdown();
  assertEquals(Status.STOPPED,cacheManager.getStatus());
}

Fixed version (ground truth):
@Test public void shutdown_status(){
  CacheManager cacheManager=getCacheManager();
  assertEquals(Status.STARTED,cacheManager.getStatus());
  cacheManager.shutdown();
  assertEquals(Status.STOPPED,cacheManager.getStatus());
}
Program: 19469
Project: 19469
Buggy source:
/** 
 * Checks that stop is called on all caches. Also checks CacheManager status
 */
@Test public void shutdown_cachesEmpty(){
  CacheManager cacheManager=getCacheManager();
  cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.shutdown();
  assertTrue(cacheManager.getCaches().isEmpty());
}

Fixed version (ground truth):
@Test public void shutdown_cachesEmpty(){
  CacheManager cacheManager=getCacheManager();
  cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.shutdown();
  assertTrue(cacheManager.getCaches().isEmpty());
}
Program: 19470
Project: 19470
Buggy source:
/** 
 * Checks that stop is called on all caches. Also checks CacheManager status
 */
@Test public void shutdown_stopCalled(){
  CacheManager cacheManager=getCacheManager();
  Cache cache1=cacheManager.createCacheBuilder("String_Node_Str").build();
  Cache cache2=cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.shutdown();
  checkStopped(cache1);
  checkStopped(cache2);
}

Fixed version (ground truth):
@Test public void shutdown_stopCalled(){
  CacheManager cacheManager=getCacheManager();
  Cache cache1=cacheManager.createCacheBuilder("String_Node_Str").build();
  Cache cache2=cacheManager.createCacheBuilder("String_Node_Str").build();
  cacheManager.shutdown();
  checkStopped(cache1);
  checkStopped(cache2);
}
Program: 19471
Project: 19471
Buggy source:
@Test public void createCache_Different(){
  String name1="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache<Integer,String> cache1=cacheManager.<Integer,String>createCacheBuilder(name1).build();
  assertEquals(Status.STARTED,cache1.getStatus());
  String name2="String_Node_Str";
  Cache<Integer,String> cache2=cacheManager.<Integer,String>createCacheBuilder(name2).build();
  assertEquals(Status.STARTED,cache2.getStatus());
  assertEquals(cache1,cacheManager.getCache(name1));
  assertEquals(cache2,cacheManager.getCache(name2));
}

Fixed version (ground truth):
@Test public void createCache_Different(){
  String name1="String_Node_Str";
  CacheManager cacheManager=getCacheManager();
  Cache cache1=cacheManager.createCacheBuilder(name1).build();
  assertEquals(Status.STARTED,cache1.getStatus());
  String name2="String_Node_Str";
  Cache cache2=cacheManager.createCacheBuilder(name2).build();
  assertEquals(Status.STARTED,cache2.getStatus());
  assertEquals(cache1,cacheManager.getCache(name1));
  assertEquals(cache2,cacheManager.getCache(name2));
}
Program: 19472
Project: 19472
Buggy source:
public BeanDefinition parse(Element element,ParserContext parserContext){
  BeanDefinitionBuilder beanBuilder=BeanDefinitionBuilder.genericBeanDefinition(JdbcConnectionRepository.class);
  String jdbcTemplate=element.getAttribute("String_Node_Str");
  beanBuilder.addConstructorArgReference(jdbcTemplate);
  String stringEncryptor=element.getAttribute("String_Node_Str");
  if (stringEncryptor != null && !stringEncryptor.isEmpty()) {
    beanBuilder.addConstructorArgReference(stringEncryptor);
  }
 else {
    beanBuilder.addConstructorArgValue(Encryptors.noOpText());
  }
  AbstractBeanDefinition beanDefinition=beanBuilder.getBeanDefinition();
  parserContext.getRegistry().registerBeanDefinition("String_Node_Str",beanDefinition);
  return beanDefinition;
}

Fixed version (ground truth):
public BeanDefinition parse(Element element,ParserContext parserContext){
  BeanDefinitionBuilder beanBuilder=BeanDefinitionBuilder.genericBeanDefinition(JdbcConnectionRepository.class);
  String dataSource=element.getAttribute("String_Node_Str");
  beanBuilder.addConstructorArgReference(dataSource);
  String stringEncryptor=element.getAttribute("String_Node_Str");
  if (stringEncryptor != null && !stringEncryptor.isEmpty()) {
    beanBuilder.addConstructorArgReference(stringEncryptor);
  }
 else {
    beanBuilder.addConstructorArgValue(Encryptors.noOpText());
  }
  AbstractBeanDefinition beanDefinition=beanBuilder.getBeanDefinition();
  parserContext.getRegistry().registerBeanDefinition("String_Node_Str",beanDefinition);
  return beanDefinition;
}
Program: 19473
Project: 19473
Buggy source:
public void retweet(long tweetId){
  @SuppressWarnings("String_Node_Str") ResponseEntity<Map> response=restOperations.postForEntity(RETWEET_URL,Collections.emptyMap(),Map.class,Collections.singletonMap("String_Node_Str",Long.toString(tweetId)));
  handleResponseErrors(response);
}

Fixed version (ground truth):
public void retweet(long tweetId){
  @SuppressWarnings("String_Node_Str") ResponseEntity<Map> response=restOperations.postForEntity(RETWEET_URL,"String_Node_Str",Map.class,Collections.singletonMap("String_Node_Str",Long.toString(tweetId)));
  handleResponseErrors(response);
}
Program: 19474
Project: 19474
Buggy source:
/** 
 * Create a new instance of ScribeOAuth1RequestSigner.
 * @param accessToken the access token value
 * @param accessTokenSecret the access token secret
 * @param apiKey the API key assigned by the provider
 * @param apiSecret the API secret assigned by the provider
 */
public ScribeOAuth1RequestSigner(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.accessToken=accessToken;
  this.accessTokenSecret=accessTokenSecret;
  this.service=new ServiceBuilder().provider(TwitterApi.class).apiKey(apiKey).apiSecret(apiSecret).callback("String_Node_Str").build();
}

Fixed version (ground truth):
/** 
 * Create a new instance of ScribeOAuth1RequestSigner.
 * @param accessToken the access token value
 * @param accessTokenSecret the access token secret
 * @param apiKey the API key assigned by the provider
 * @param apiSecret the API secret assigned by the provider
 */
public ScribeOAuth1RequestSigner(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.accessToken=accessToken;
  this.accessTokenSecret=accessTokenSecret;
  this.service=new ServiceBuilder().provider(LinkedInApi.class).apiKey(apiKey).apiSecret(apiSecret).callback("String_Node_Str").build();
}
Program: 19475
Project: 19475
Buggy source:
/** 
 * Create a new instance of TwitterTemplate. This constructor creates a new TwitterTemplate given the minimal amount of information required to sign a request and builds up a  {@link RestOperations} internally using this information.
 * @param apiKey the application's API key.
 * @param apiSecret the application's API secret.
 * @param accessToken the user's access token, given after successful OAuth authentication.
 * @param accessTokenSecret the access token secret, given along with the access token after successful OAuth authentication.
 */
public TwitterTemplate(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.restOperations=new RestTemplate(new OAuthSigningClientHttpRequestFactory(new ScribeOAuth1RequestSigner(apiKey,apiSecret,accessToken,accessTokenSecret)));
}

Fixed version (ground truth):
/** 
 * Create a new instance of TwitterTemplate. This constructor creates a new TwitterTemplate given the minimal amount of information required to sign a request and builds up a  {@link RestOperations} internally using this information.
 * @param apiKey the application's API key.
 * @param apiSecret the application's API secret.
 * @param accessToken the user's access token, given after successful OAuth authentication.
 * @param accessTokenSecret the access token secret, given along with the access token after successful OAuth authentication.
 */
public TwitterTemplate(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  RestTemplate restTemplate=new RestTemplate(new OAuthSigningClientHttpRequestFactory(new ScribeOAuth1RequestSigner(apiKey,apiSecret,accessToken,accessTokenSecret)));
  restTemplate.setErrorHandler(new TwitterErrorHandler());
  this.restOperations=restTemplate;
  this.statusCodeTranslator=new TwitterResponseStatusCodeTranslator();
}
Program: 19476
Project: 19476
Buggy source:
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Long maxId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  Long sinceId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  return new SearchResults(tweets,maxId,sinceId,response.get("String_Node_Str") == null);
}

Fixed version (ground truth):
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Number maxId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  Number sinceId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  return new SearchResults(tweets,maxId.longValue(),sinceId.longValue(),response.get("String_Node_Str") == null);
}
Program: 19477
Project: 19477
Buggy source:
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}

Fixed version (ground truth):
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str",42);
  response.put("String_Node_Str",24);
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}
Program: 19478
Project: 19478
Buggy source:
private Size getOptimalSize(List<Size> sizeList){
  if (sizeList == null)   return null;
  double targetRatio=(double)mMetrics.widthPixels / mMetrics.heightPixels;
  int targetHeight=mMetrics.heightPixels;
  double diffRatio=Double.MAX_VALUE;
  Size optSize=null;
  for (  Size size : sizeList) {
    double tmpDiffRatio=(double)size.width / size.height;
    if (Math.abs(targetRatio - tmpDiffRatio) < diffRatio) {
      optSize=size;
      diffRatio=Math.abs(targetRatio - tmpDiffRatio) + Math.abs(size.height - targetHeight);
      if (diffRatio == 0)       return optSize;
    }
  }
  return optSize;
}

Fixed version (ground truth):
private Size getOptimalSize(List<Size> sizeList){
  if (sizeList == null)   return null;
  int targetWidth=mMetrics.widthPixels;
  int targetHeight=mMetrics.heightPixels;
  int diffSize=Integer.MAX_VALUE;
  Size optSize=null;
  for (  Size size : sizeList) {
    int tmpDiffSize=(size.height - targetHeight) + (size.width - targetWidth);
    if (tmpDiffSize < 0)     continue;
    if (tmpDiffSize < diffSize) {
      optSize=size;
      diffSize=tmpDiffSize;
      if (diffSize == 0)       return optSize;
    }
  }
  return optSize;
}
Program: 19479
Project: 19479
Buggy source:
@Override protected void onStart(){
  printLivecycleStatus("String_Node_Str");
  super.onStart();
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  mColorView.setVisibility(View.INVISIBLE);
  mLoadingScreen.setVisibility(View.VISIBLE);
  initSavedPreferences();
  PackageInfo versionInfo=getPackageInfo();
  String introKey=IntroductionActivity.INTRO_PREFIX + versionInfo.versionCode;
  if (!mSharedPreferences.contains(introKey)) {
    openIntro(null);
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  printLivecycleStatus("String_Node_Str");
  super.onStart();
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  showLoadingScreen();
  initSavedPreferences();
  PackageInfo versionInfo=getPackageInfo();
  String introKey=IntroductionActivity.INTRO_PREFIX + versionInfo.versionCode;
  if (!mSharedPreferences.contains(introKey)) {
    openIntro(null);
  }
}
Program: 19480
Project: 19480
Buggy source:
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  printLivecycleStatus("String_Node_Str");
  super.onResume();
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  mOrientationEventListener.enable();
  mSurfaceView.setVisibility(View.VISIBLE);
  mOrientationEventListener.enable();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  printLivecycleStatus("String_Node_Str");
  super.onResume();
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  mOrientationEventListener.enable();
  mDummySurfaceView.setVisibility(View.VISIBLE);
  mOrientationEventListener.enable();
}
Program: 19481
Project: 19481
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void surfaceDestroyed(SurfaceHolder holder){
  printLivecycleStatus("String_Node_Str");
  if (isInWrongOrientation) {
    return;
  }
  releaseCamera();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void surfaceDestroyed(SurfaceHolder holder){
  printLivecycleStatus("String_Node_Str");
  if (isInWrongOrientation) {
    return;
  }
  setCameraLight(Camera.Parameters.FLASH_MODE_OFF);
  releaseCamera();
}
Program: 19482
Project: 19482
Buggy source:
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  printLivecycleStatus("String_Node_Str");
  if (isInWrongOrientation) {
    super.onPause();
    return;
  }
  if (mShowLoadingScreenTask != null) {
    printLivecycleStatus("String_Node_Str");
    mShowLoadingScreenTask.cancel(false);
    mShowLoadingScreenTask=null;
  }
  mOrientationEventListener.disable();
  mSurfaceView.setVisibility(View.GONE);
  super.onPause();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  printLivecycleStatus("String_Node_Str");
  if (isInWrongOrientation) {
    super.onPause();
    return;
  }
  if (mShowLoadingScreenTask != null) {
    printLivecycleStatus("String_Node_Str");
    mShowLoadingScreenTask.cancel(false);
    mShowLoadingScreenTask=null;
  }
  mOrientationEventListener.disable();
  mDummySurfaceView.setVisibility(View.GONE);
  super.onPause();
}
Program: 19483
Project: 19483
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  printLivecycleStatus("String_Node_Str");
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  setContentView(R.layout.main);
  mLoadingScreen=findViewById(R.id.hsr_loading_screen);
  mColorView=(ColorView)findViewById(R.id.cameraSurface);
  mColorView.setActivityHandler(mHandler);
  mControlBar=(ControlBar)findViewById(R.id.controlBar);
  mControlBar.setActivityHandler(mHandler);
  mControlBar.enableOnClickListeners();
  mControlBar.rotate(Orientation.UNKNOW);
  mPrimaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSecondaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSurfaceView=(SurfaceView)findViewById(id.cameraSurface_dummy);
  mSurfaceView.getHolder().addCallback(this);
  getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  createMenus();
  setToastSizes();
  initOrientationEventListener();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  printLivecycleStatus("String_Node_Str");
  super.onCreate(savedInstanceState);
  initWrongOrientationFlag();
  if (isInWrongOrientation) {
    return;
  }
  setContentView(R.layout.main);
  mLoadingScreen=findViewById(R.id.hsr_loading_screen);
  mColorView=(ColorView)findViewById(R.id.cameraSurface);
  mColorView.setActivityHandler(mHandler);
  mControlBar=(ControlBar)findViewById(R.id.controlBar);
  mControlBar.setActivityHandler(mHandler);
  mControlBar.enableOnClickListeners();
  mControlBar.rotate(Orientation.UNKNOW);
  mPrimaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSecondaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mDummySurfaceView=(SurfaceView)findViewById(id.cameraSurface_dummy);
  mDummySurfaceView.getHolder().addCallback(this);
  getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  createMenus();
  setToastSizes();
  initOrientationEventListener();
}
Program: 19484
Project: 19484
Buggy source:
/** 
 * Starting from ICS (and probably generally on Motorola devices camera preview will not be started if there is no SurfaceHolder attached due to security. In order to overcome this we have to attach a dummy SurfaceHolder and make sure it does not get displayed.
 */
private void makeSureCameraPreviewStarts(){
  try {
    mCamera.setPreviewDisplay(mSurfaceView.getHolder());
  }
 catch (  IOException e) {
    Log.e(LOG_TAG,"String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Starting from ICS (and probably generally on Motorola devices camera preview will not be started if there is no SurfaceHolder attached due to security. In order to overcome this we have to attach a dummy SurfaceHolder and make sure it does not get displayed.
 */
private void makeSureCameraPreviewStarts(){
  try {
    mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
  }
 catch (  IOException e) {
    Log.e(LOG_TAG,"String_Node_Str");
    e.printStackTrace();
  }
}
Program: 19485
Project: 19485
Buggy source:
/** 
 * Rotate all children of the ContorlBar to the given orientation, with animation.
 * @param orientation
 */
public void rotate(Orientation orientation){
  if (mLastKnowOrientation == Orientation.LANDSCAPE_LEFT && orientation == Orientation.PORTRAIT)   rotateChildViews(mAnimationPortraitLeft);
  if (mLastKnowOrientation == Orientation.LANDSCAPE_RIGHT && orientation == Orientation.PORTRAIT)   rotateChildViews(mAnimationPortraitRight);
  if (orientation == Orientation.LANDSCAPE_LEFT)   rotateChildViews(mAnimationLeft);
  if (orientation == Orientation.LANDSCAPE_RIGHT)   rotateChildViews(mAnimationRight);
  if (orientation == Orientation.UNKNOW) {
    rotateChildViews(mAnimationPortraitLeft);
  }
  Debug.msg(LOG_TAG,"String_Node_Str" + orientation);
  mLastKnowOrientation=orientation;
}

Fixed version (ground truth):
public void rotate(Orientation orientation){
  if (mLastKnowOrientation == Orientation.LANDSCAPE_LEFT && orientation == Orientation.PORTRAIT)   rotateChildViews(mAnimationPortraitLeft);
  if (mLastKnowOrientation == Orientation.LANDSCAPE_RIGHT && orientation == Orientation.PORTRAIT)   rotateChildViews(mAnimationPortraitRight);
  if (orientation == Orientation.LANDSCAPE_LEFT)   rotateChildViews(mAnimationLeft);
  if (orientation == Orientation.LANDSCAPE_RIGHT)   rotateChildViews(mAnimationRight);
  if (orientation == Orientation.UNKNOW) {
    rotateChildViews(mAnimationPortraitLeft);
  }
  Debug.msg(LOG_TAG,"String_Node_Str" + orientation);
  mLastKnowOrientation=orientation;
}
Program: 19486
Project: 19486
Buggy source:
/** 
 * This method sets the activity handler used to send messages for starting and stopping the Camera preview since ControlBar doesn't and shouldn't know about the Camera instance itself.
 * @param handler the activity handler used for message passing.
 * @see <a href="http://developer.android.com/reference/android/os/Handler.html"> android.os.Handler</a>
 */
public void setActivityHandler(Handler handler){
  mActivityHandler=handler;
}

Fixed version (ground truth):
public void setActivityHandler(Handler handler){
  mActivityHandler=handler;
}
Program: 19487
Project: 19487
Buggy source:
/** 
 * Manage the image change of the filter button
 * @param isPrimaryFilter
 */
public void setButtonFilter(boolean isPrimaryFilter){
  mButtonFilter.setChecked(isPrimaryFilter);
}

Fixed version (ground truth):
public void setButtonFilter(boolean isPrimaryFilter){
  mButtonFilter.setChecked(isPrimaryFilter);
}
Program: 19488
Project: 19488
Buggy source:
/** 
 * Manage the image change of the play button
 * @param isPlaying
 */
public void setButtonPlay(boolean isPlaying){
  mButtonPlayPause.setChecked(isPlaying);
}

Fixed version (ground truth):
public void setButtonPlay(boolean isPlaying){
  mButtonPlayPause.setChecked(isPlaying);
}
Program: 19489
Project: 19489
Buggy source:
/** 
 * Manage the image change of the light button
 * @param hasLight
 */
public void setButtonLight(boolean hasLight){
  mButtonLight.setChecked(hasLight);
}

Fixed version (ground truth):
public void setButtonLight(boolean hasLight){
  mButtonLight.setChecked(hasLight);
}
Program: 19490
Project: 19490
Buggy source:
/** 
 * Check wether primary filter button is checked.
 */
public boolean isPrimaryFilterRunning(){
  return !mButtonFilter.isChecked();
}

Fixed version (ground truth):
public boolean isPrimaryFilterRunning(){
  return !mButtonFilter.isChecked();
}
Program: 19491
Project: 19491
Buggy source:
/** 
 * You can only add a OnClickListener to a Object when it has passed the initialization process. So you will need to call this method at first after you had build the ControlBar-Object, to enable all OnlickListeners for the children of the ContorlBar-Object.
 */
public void enableOnClickListeners(){
  mButtonPlayPause=(StateImageButton)findViewById(R.id.imageButton_Pause);
  mButtonLight=(StateImageButton)findViewById(R.id.imageButton_Light);
  mButtonFilter=(StateImageButton)findViewById(R.id.imageButton_Filter);
  mButtonPlayPause.setOnClickListener(mOnClickPlayPause);
  mButtonLight.setOnClickListener(mOnClickLight);
  mButtonFilter.setOnClickListener(mOnClickFilter);
  mButtonFilter.setOnLongClickListener(mOnLongClickFilter);
  mButtonPlayPause.setImageChange(false);
  mButtonLight.setImageChange(false);
  mButtonFilter.setImageChange(false);
}

Fixed version (ground truth):
public void enableOnClickListeners(){
  mButtonPlayPause=(StateImageButton)findViewById(R.id.imageButton_Pause);
  mButtonLight=(StateImageButton)findViewById(R.id.imageButton_Light);
  mButtonFilter=(StateImageButton)findViewById(R.id.imageButton_Filter);
  mButtonPlayPause.setOnClickListener(mOnClickPlayPause);
  mButtonLight.setOnClickListener(mOnClickLight);
  mButtonFilter.setOnClickListener(mOnClickFilter);
  mButtonFilter.setOnLongClickListener(mOnLongClickFilter);
  mButtonPlayPause.setImageChange(false);
  mButtonLight.setImageChange(false);
  mButtonFilter.setImageChange(false);
}
Program: 19492
Project: 19492
Buggy source:
/** 
 * This method is indirection to hold the communication-design clean.
 * @param isEnabled
 */
public void enableLightButton(boolean isEnabled){
  mButtonLight.setEnabled(isEnabled);
}

Fixed version (ground truth):
public void enableLightButton(boolean isEnabled){
  mButtonLight.setEnabled(isEnabled);
}
Program: 19493
Project: 19493
Buggy source:
@Override protected void onStart(){
  super.onStart();
  mColorView.setVisibility(View.INVISIBLE);
  mLoadingScreen.setVisibility(View.VISIBLE);
  initSavedPreferences();
  PackageInfo versionInfo=getPackageInfo();
  String introKey=IntroductionActivity.INTRO_PREFIX + versionInfo.versionCode;
  if (!mSharedPreferences.contains(introKey)) {
    openIntro(null);
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  printLivecycleStatus("String_Node_Str");
  super.onStart();
  mColorView.setVisibility(View.INVISIBLE);
  mLoadingScreen.setVisibility(View.VISIBLE);
  initSavedPreferences();
  PackageInfo versionInfo=getPackageInfo();
  String introKey=IntroductionActivity.INTRO_PREFIX + versionInfo.versionCode;
  if (!mSharedPreferences.contains(introKey)) {
    openIntro(null);
  }
}
Program: 19494
Project: 19494
Buggy source:
@Override protected Void doInBackground(Void... params){
  Debug.msg(LOG_TAG,"String_Node_Str");
synchronized (this) {
    try {
      while (!mIsCameraReady)       wait(800);
    }
 catch (    InterruptedException e) {
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  Debug.msg(LOG_TAG,"String_Node_Str");
synchronized (this) {
    try {
      while (!mIsCameraReady) {
        if (isCancelled()) {
          printLivecycleStatus("String_Node_Str");
          break;
        }
        wait(800);
        printLivecycleStatus("String_Node_Str");
      }
    }
 catch (    InterruptedException e) {
      printLivecycleStatus("String_Node_Str");
    }
  }
  return null;
}
Program: 19495
Project: 19495
Buggy source:
@Override protected void onPostExecute(Void result){
  Debug.msg(LOG_TAG,"String_Node_Str");
  if (isCancelled())   return;
  mColorView.setVisibility(View.VISIBLE);
  mLoadingScreen.setVisibility(View.INVISIBLE);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Void result){
  printLivecycleStatus("String_Node_Str");
  Debug.msg(LOG_TAG,"String_Node_Str");
  if (isCancelled())   return;
  mColorView.setVisibility(View.VISIBLE);
  mLoadingScreen.setVisibility(View.INVISIBLE);
  mShowLoadingScreenTask=null;
}
Program: 19496
Project: 19496
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void surfaceCreated(SurfaceHolder holder){
  openCamera();
  configEnvByCameraParams();
  makeSureCameraPreviewStarts();
  if (mControlBar.isPrimaryFilterRunning())   setPrimaryFilter();
 else   setSecondaryFilter();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void surfaceCreated(SurfaceHolder holder){
  printLivecycleStatus("String_Node_Str");
  openCamera();
  configEnvByCameraParams();
  makeSureCameraPreviewStarts();
  if (mControlBar.isPrimaryFilterRunning())   setPrimaryFilter();
 else   setSecondaryFilter();
}
Program: 19497
Project: 19497
Buggy source:
/** 
 * {@inheritDoc}Is overwritten in order to dismiss the menu popups when pressing back.
 */
@Override public void onBackPressed(){
  if (menuIsShowing())   dismissMenus();
 else   super.onBackPressed();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Is overwritten in order to dismiss the menu popups when pressing back.
 */
@Override public void onBackPressed(){
  printLivecycleStatus("String_Node_Str");
  if (menuIsShowing())   dismissMenus();
 else   super.onBackPressed();
}
Program: 19498
Project: 19498
Buggy source:
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  super.onResume();
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  mOrientationEventListener.enable();
  mSurfaceView.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  printLivecycleStatus("String_Node_Str");
  super.onResume();
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  mOrientationEventListener.enable();
  mSurfaceView.setVisibility(View.VISIBLE);
  mOrientationEventListener.enable();
}
Program: 19499
Project: 19499
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void surfaceDestroyed(SurfaceHolder holder){
  releaseCamera();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void surfaceDestroyed(SurfaceHolder holder){
  printLivecycleStatus("String_Node_Str");
  releaseCamera();
}