nus-yam/ex-repair huggingface dataset:
Program: 111716
Project: 111716
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String encrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,false);
    Map<String,String> keys=this.helper.getEncryptorKeys(name,profiles,input);
    String encrypted=this.helper.addPrefix(keys,this.encryptor.locate(keys).encrypt(input));
    logger.info("String_Node_Str");
    return encrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String encrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,false);
    Map<String,String> keys=this.helper.getEncryptorKeys(name,profiles,input);
    String textToEncrypt=this.helper.stripPrefix(input);
    String encrypted=this.helper.addPrefix(keys,this.encryptor.locate(keys).encrypt(textToEncrypt));
    logger.info("String_Node_Str");
    return encrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}
Program: 111717
Project: 111717
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String decrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,true);
    String decrypted=this.helper.stripPrefix(this.encryptor.locate(this.helper.getEncryptorKeys(name,profiles,input)).decrypt(this.helper.stripPrefix(input)));
    logger.info("String_Node_Str");
    return decrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String decrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,true);
    Map<String,String> encryptorKeys=this.helper.getEncryptorKeys(name,profiles,input);
    TextEncryptor encryptor=this.encryptor.locate(encryptorKeys);
    String encryptedText=this.helper.stripPrefix(input);
    String decrypted=encryptor.decrypt(encryptedText);
    logger.info("String_Node_Str");
    return decrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}
Program: 111718
Project: 111718
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String encrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,false);
    Map<String,String> keys=this.helper.getEncryptorKeys(name,profiles,input);
    String encrypted=this.helper.addPrefix(keys,this.encryptor.locate(keys).encrypt(input));
    logger.info("String_Node_Str");
    return encrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String encrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,false);
    Map<String,String> keys=this.helper.getEncryptorKeys(name,profiles,input);
    String textToEncrypt=this.helper.stripPrefix(input);
    String encrypted=this.helper.addPrefix(keys,this.encryptor.locate(keys).encrypt(textToEncrypt));
    logger.info("String_Node_Str");
    return encrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}
Program: 111719
Project: 111719
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String decrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,true);
    Map<String,String> encryptorKeys=this.helper.getEncryptorKeys(name,profiles,input);
    TextEncryptor encryptor=this.encryptor.locate(encryptorKeys);
    String encryptedText=this.helper.stripPrefix(input);
    String decrypted=this.helper.stripPrefix(encryptor.decrypt(encryptedText));
    logger.info("String_Node_Str");
    return decrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String decrypt(@PathVariable String name,@PathVariable String profiles,@RequestBody String data,@RequestHeader("String_Node_Str") MediaType type){
  checkEncryptorInstalled(name,profiles);
  try {
    String input=stripFormData(data,type,true);
    Map<String,String> encryptorKeys=this.helper.getEncryptorKeys(name,profiles,input);
    TextEncryptor encryptor=this.encryptor.locate(encryptorKeys);
    String encryptedText=this.helper.stripPrefix(input);
    String decrypted=encryptor.decrypt(encryptedText);
    logger.info("String_Node_Str");
    return decrypted;
  }
 catch (  IllegalArgumentException e) {
    throw new InvalidCipherException();
  }
}
Program: 111720
Project: 111720
Buggy source:
@RequestMapping(method=RequestMethod.POST) public Set<String> notifyByPath(@RequestHeader MultiValueMap<String,String> headers,@RequestBody Map<String,Object> request){
  PropertyPathNotification notification=this.extractor.extract(headers,request);
  if (notification != null) {
    Set<String> services=new HashSet<>();
    for (    String path : notification.getPaths()) {
      services.addAll(guessServiceName(path));
    }
    if (this.applicationEventPublisher != null) {
      for (      String service : services) {
        log.info("String_Node_Str" + service);
        this.applicationEventPublisher.publishEvent(new RefreshRemoteApplicationEvent(this,this.contextId,service));
      }
      return services;
    }
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST) public Set<String> notifyByPath(@RequestHeader MultiValueMap<String,String> headers,@RequestBody Map<String,Object> request){
  PropertyPathNotification notification=this.extractor.extract(headers,request);
  if (notification != null) {
    Set<String> services=new LinkedHashSet<>();
    for (    String path : notification.getPaths()) {
      services.addAll(guessServiceName(path));
    }
    if (this.applicationEventPublisher != null) {
      for (      String service : services) {
        log.info("String_Node_Str" + service);
        this.applicationEventPublisher.publishEvent(new RefreshRemoteApplicationEvent(this,this.contextId,service));
      }
      return services;
    }
  }
  return Collections.emptySet();
}
Program: 111721
Project: 111721
Buggy source:
private void postProcessProperties(Map<String,Object> propertiesMap){
  for (  String key : propertiesMap.keySet()) {
    if (key.equals("String_Node_Str")) {
      propertiesMap.remove(key);
    }
  }
}

Fixed version (ground truth):
private void postProcessProperties(Map<String,Object> propertiesMap){
  for (Iterator<String> iter=propertiesMap.keySet().iterator(); iter.hasNext(); ) {
    String key=iter.next();
    if (key.equals("String_Node_Str")) {
      iter.remove();
    }
  }
}
Program: 111723
Project: 111723
Buggy source:
public Environment decrypt(Environment environment){
  Environment result=new Environment(environment.getName(),environment.getLabel());
  for (  PropertySource source : environment.getPropertySources()) {
    Map<Object,Object> map=new LinkedHashMap<Object,Object>(source.getSource());
    for (    Entry<Object,Object> entry : map.entrySet()) {
      Object key=entry.getKey();
      String name=key.toString();
      String value=entry.getValue().toString();
      if (value.startsWith("String_Node_Str")) {
        map.remove(key);
        if (encryptor == null) {
          map.put(name,value);
        }
 else {
          try {
            value=value == null ? null : encryptor.decrypt(value.substring("String_Node_Str".length()));
          }
 catch (          Exception e) {
            value="String_Node_Str";
            name="String_Node_Str" + name;
            logger.warn("String_Node_Str" + key + "String_Node_Str"+ e.getClass()+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
          }
          map.put(name,value);
        }
      }
    }
    result.add(new PropertySource(source.getName(),map));
  }
  return result;
}

Fixed version (ground truth):
public Environment decrypt(Environment environment){
  Environment result=new Environment(environment.getName(),environment.getLabel());
  for (  PropertySource source : environment.getPropertySources()) {
    Map<Object,Object> map=new LinkedHashMap<Object,Object>(source.getSource());
    for (    Entry<Object,Object> entry : new LinkedHashSet<>(map.entrySet())) {
      Object key=entry.getKey();
      String name=key.toString();
      String value=entry.getValue().toString();
      if (value.startsWith("String_Node_Str")) {
        map.remove(key);
        if (encryptor == null) {
          map.put(name,value);
        }
 else {
          try {
            value=value == null ? null : encryptor.decrypt(value.substring("String_Node_Str".length()));
          }
 catch (          Exception e) {
            value="String_Node_Str";
            name="String_Node_Str" + name;
            logger.warn("String_Node_Str" + key + "String_Node_Str"+ e.getClass()+ "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
          }
          map.put(name,value);
        }
      }
    }
    result.add(new PropertySource(source.getName(),map));
  }
  return result;
}
Program: 111724
Project: 111724
Buggy source:
@Override public org.springframework.core.env.PropertySource<?> locate(org.springframework.core.env.Environment environment){
  ConfigClientProperties client=defaults.override(environment);
  CompositePropertySource composite=new CompositePropertySource("String_Node_Str");
  RestTemplate restTemplate=this.restTemplate == null ? getSecureRestTemplate(client) : this.restTemplate;
  RuntimeException error=null;
  String errorBody=null;
  try {
    Environment result=restTemplate.exchange(client.getRawUri() + "String_Node_Str",HttpMethod.GET,new HttpEntity<Void>((Void)null),Environment.class,client.getName(),client.getProfile(),client.getLabel()).getBody();
    for (    PropertySource source : result.getPropertySources()) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)source.getSource();
      composite.addPropertySource(new MapPropertySource(source.getName(),map));
    }
    return composite;
  }
 catch (  HttpServerErrorException e) {
    error=e;
    if (MediaType.APPLICATION_JSON.includes(e.getResponseHeaders().getContentType())) {
      errorBody=e.getResponseBodyAsString();
    }
  }
catch (  Exception e) {
    error=new IllegalStateException("String_Node_Str",e);
  }
  if (client != null && client.isFailFast()) {
    throw error;
  }
  logger.error("String_Node_Str" + (errorBody == null ? error.getMessage() : errorBody));
  return null;
}

Fixed version (ground truth):
@Override public org.springframework.core.env.PropertySource<?> locate(org.springframework.core.env.Environment environment){
  ConfigClientProperties client=defaults.override(environment);
  CompositePropertySource composite=new CompositePropertySource("String_Node_Str");
  RestTemplate restTemplate=this.restTemplate == null ? getSecureRestTemplate(client) : this.restTemplate;
  Exception error=null;
  String errorBody=null;
  try {
    Environment result=restTemplate.exchange(client.getRawUri() + "String_Node_Str",HttpMethod.GET,new HttpEntity<Void>((Void)null),Environment.class,client.getName(),client.getProfile(),client.getLabel()).getBody();
    for (    PropertySource source : result.getPropertySources()) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)source.getSource();
      composite.addPropertySource(new MapPropertySource(source.getName(),map));
    }
    return composite;
  }
 catch (  HttpServerErrorException e) {
    error=e;
    if (MediaType.APPLICATION_JSON.includes(e.getResponseHeaders().getContentType())) {
      errorBody=e.getResponseBodyAsString();
    }
  }
catch (  Exception e) {
    error=e;
  }
  if (client != null && client.isFailFast()) {
    throw new IllegalStateException("String_Node_Str",error);
  }
  logger.error("String_Node_Str" + (errorBody == null ? error.getMessage() : errorBody));
  return null;
}
Program: 111725
Project: 111725
Buggy source:
@Test public void failFast() throws Exception {
  ClientHttpRequestFactory requestFactory=Mockito.mock(ClientHttpRequestFactory.class);
  ClientHttpRequest request=Mockito.mock(ClientHttpRequest.class);
  ClientHttpResponse response=Mockito.mock(ClientHttpResponse.class);
  Mockito.when(requestFactory.createRequest(Mockito.any(URI.class),Mockito.any(HttpMethod.class))).thenReturn(request);
  RestTemplate restTemplate=new RestTemplate(requestFactory);
  ConfigClientProperties defaults=new ConfigClientProperties(environment);
  defaults.setFailFast(true);
  locator=new ConfigServicePropertySourceLocator(defaults);
  Mockito.when(request.getHeaders()).thenReturn(new HttpHeaders());
  Mockito.when(request.execute()).thenReturn(response);
  HttpHeaders headers=new HttpHeaders();
  headers.setContentType(MediaType.APPLICATION_JSON);
  Mockito.when(response.getHeaders()).thenReturn(headers);
  Mockito.when(response.getStatusCode()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR);
  Mockito.when(response.getBody()).thenReturn(new ByteArrayInputStream("String_Node_Str".getBytes()));
  locator.setRestTemplate(restTemplate);
  expected.expect(HttpServerErrorException.class);
  expected.expectMessage("String_Node_Str");
  assertNull(locator.locate(environment));
}

Fixed version (ground truth):
@Test public void failFast() throws Exception {
  ClientHttpRequestFactory requestFactory=Mockito.mock(ClientHttpRequestFactory.class);
  ClientHttpRequest request=Mockito.mock(ClientHttpRequest.class);
  ClientHttpResponse response=Mockito.mock(ClientHttpResponse.class);
  Mockito.when(requestFactory.createRequest(Mockito.any(URI.class),Mockito.any(HttpMethod.class))).thenReturn(request);
  RestTemplate restTemplate=new RestTemplate(requestFactory);
  ConfigClientProperties defaults=new ConfigClientProperties(environment);
  defaults.setFailFast(true);
  locator=new ConfigServicePropertySourceLocator(defaults);
  Mockito.when(request.getHeaders()).thenReturn(new HttpHeaders());
  Mockito.when(request.execute()).thenReturn(response);
  HttpHeaders headers=new HttpHeaders();
  headers.setContentType(MediaType.APPLICATION_JSON);
  Mockito.when(response.getHeaders()).thenReturn(headers);
  Mockito.when(response.getStatusCode()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR);
  Mockito.when(response.getBody()).thenReturn(new ByteArrayInputStream("String_Node_Str".getBytes()));
  locator.setRestTemplate(restTemplate);
  expected.expectCause(IsInstanceOf.<Throwable>instanceOf(HttpServerErrorException.class));
  expected.expectMessage("String_Node_Str");
  assertNull(locator.locate(environment));
}
Program: 111727
Project: 111727
Buggy source:
public String call() throws Exception {
  logger.debug("String_Node_Str");
  try {
    latch.countDown();
    return service.getMessage();
  }
  finally {
    logger.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
public String call() throws Exception {
  logger.debug("String_Node_Str");
  try {
    return service.getMessage();
  }
  finally {
    latch.countDown();
    logger.debug("String_Node_Str");
  }
}
Program: 111728
Project: 111728
Buggy source:
@Test @Repeat(10) @DirtiesContext public void testConcurrentRefresh() throws Exception {
  assertEquals("String_Node_Str",service.getMessage());
  properties.setMessage("String_Node_Str");
  properties.setDelay(500);
  final CountDownLatch latch=new CountDownLatch(1);
  Future<String> result=executor.submit(new Callable<String>(){
    public String call() throws Exception {
      logger.debug("String_Node_Str");
      try {
        latch.countDown();
        return service.getMessage();
      }
  finally {
        logger.debug("String_Node_Str");
      }
    }
  }
);
  assertTrue(latch.await(1500,TimeUnit.MILLISECONDS));
  logger.info("String_Node_Str");
  scope.refreshAll();
  assertEquals("String_Node_Str",service.getMessage());
  assertNotNull(result.get());
  assertEquals("String_Node_Str",result.get());
}

Fixed version (ground truth):
@Test @Repeat(10) @DirtiesContext public void testConcurrentRefresh() throws Exception {
  assertEquals("String_Node_Str",service.getMessage());
  properties.setMessage("String_Node_Str");
  properties.setDelay(500);
  final CountDownLatch latch=new CountDownLatch(1);
  Future<String> result=executor.submit(new Callable<String>(){
    public String call() throws Exception {
      logger.debug("String_Node_Str");
      try {
        return service.getMessage();
      }
  finally {
        latch.countDown();
        logger.debug("String_Node_Str");
      }
    }
  }
);
  assertTrue(latch.await(1500,TimeUnit.MILLISECONDS));
  logger.info("String_Node_Str");
  scope.refreshAll();
  assertEquals("String_Node_Str",service.getMessage());
  assertNotNull(result.get());
  assertEquals("String_Node_Str",result.get());
}
Program: 111729
Project: 111729
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case REQUEST_SPEECH:
switch (resultCode) {
case Activity.RESULT_OK:
      setSearchQuery(data,true);
    break;
case Activity.RESULT_CANCELED:
  if (FINISH_ON_RECOGNIZER_CANCELED) {
    if (!hasResults()) {
      if (DEBUG)       Log.v(TAG,"String_Node_Str");
      getActivity().onBackPressed();
    }
  }
break;
}
break;
}
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case REQUEST_SPEECH:
switch (resultCode) {
case Activity.RESULT_OK:
      setSearchQuery(data,true);
    break;
default :
  if (FINISH_ON_RECOGNIZER_CANCELED) {
    if (!hasResults()) {
      if (DEBUG)       Log.v(TAG,"String_Node_Str");
      getView().findViewById(R.id.lb_search_bar_speech_orb).requestFocus();
    }
  }
break;
}
break;
}
}
Program: 111730
Project: 111730
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case REQUEST_SPEECH:
switch (resultCode) {
case Activity.RESULT_OK:
      setSearchQuery(data,true);
    break;
case Activity.RESULT_CANCELED:
  if (FINISH_ON_RECOGNIZER_CANCELED) {
    if (!hasResults()) {
      if (DEBUG)       Log.v(TAG,"String_Node_Str");
      getActivity().onBackPressed();
    }
  }
break;
}
break;
}
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case REQUEST_SPEECH:
switch (resultCode) {
case Activity.RESULT_OK:
      setSearchQuery(data,true);
    break;
default :
  if (FINISH_ON_RECOGNIZER_CANCELED) {
    if (!hasResults()) {
      if (DEBUG)       Log.v(TAG,"String_Node_Str");
      getView().findViewById(R.id.lb_search_bar_speech_orb).requestFocus();
    }
  }
break;
}
break;
}
}
Program: 111731
Project: 111731
Buggy source:
public boolean hasResults(){
  return mRowsAdapter.size() > 0;
}

Fixed version (ground truth):
public boolean hasResults(){
  return mRowsAdapter.size() > 0 && mResultsFound;
}
Program: 111732
Project: 111732
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor cursor){
  if (cursor != null && cursor.moveToFirst()) {
    mVideoCursorAdapter.changeCursor(cursor);
    mRowsAdapter.clear();
    HeaderItem header=new HeaderItem(getString(R.string.search_results,mQuery));
    ListRow row=new ListRow(header,mVideoCursorAdapter);
    mRowsAdapter.add(row);
  }
 else {
    mRowsAdapter.clear();
    HeaderItem header=new HeaderItem(getString(R.string.no_search_results,mQuery));
    ListRow row=new ListRow(header,new ArrayObjectAdapter());
    mRowsAdapter.add(row);
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor cursor){
  int titleRes;
  if (cursor != null && cursor.moveToFirst()) {
    mResultsFound=true;
    titleRes=R.string.search_results;
  }
 else {
    mResultsFound=false;
    titleRes=R.string.no_search_results;
  }
  mVideoCursorAdapter.changeCursor(cursor);
  HeaderItem header=new HeaderItem(getString(titleRes,mQuery));
  mRowsAdapter.clear();
  ListRow row=new ListRow(header,mVideoCursorAdapter);
  mRowsAdapter.add(row);
}
Program: 111733
Project: 111733
Buggy source:
/** 
 * Handles all the video searches and suggestion queries from the Search Manager. When requesting a specific word, the uri alone is required. When searching all of the video for matches, the selectionArgs argument must carry the search query as the first element. All other arguments are ignored.
 */
@Override public Cursor query(Uri uri,String[] projection,String selection,String[] selectionArgs,String sortOrder){
switch (URI_MATCHER.match(uri)) {
case SEARCH_SUGGEST:
    Log.d(TAG,"String_Node_Str" + selectionArgs[0] + "String_Node_Str"+ uri);
  if (selectionArgs == null) {
    throw new IllegalArgumentException("String_Node_Str" + uri);
  }
return getSuggestions(selectionArgs[0]);
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
}

Fixed version (ground truth):
/** 
 * Handles all the video searches and suggestion queries from the Search Manager. When requesting a specific word, the uri alone is required. When searching all of the video for matches, the selectionArgs argument must carry the search query as the first element. All other arguments are ignored.
 */
@Override public Cursor query(Uri uri,String[] projection,String selection,String[] selectionArgs,String sortOrder){
switch (URI_MATCHER.match(uri)) {
case SEARCH_SUGGEST:
    Log.d(TAG,"String_Node_Str" + Arrays.toString(selectionArgs) + "String_Node_Str"+ uri);
  if (selectionArgs == null || 0 == selectionArgs.length) {
    throw new IllegalArgumentException("String_Node_Str" + uri);
  }
return getSuggestions(selectionArgs[0]);
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
}
Program: 111734
Project: 111734
Buggy source:
@Override public void onDestroy(){
  super.onDestroy();
  if (null != mBackgroundTimer) {
    Log.d(TAG,"String_Node_Str" + mBackgroundTimer.toString());
    mBackgroundTimer.cancel();
  }
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (null != mBackgroundTimer) {
    Log.d(TAG,"String_Node_Str" + mBackgroundTimer.toString());
    mBackgroundTimer.cancel();
    mBackgroundTimer=null;
  }
  mBackgroundManager=null;
  super.onDestroy();
}
Program: 111735
Project: 111735
Buggy source:
@Override public void onResourceReady(GlideDrawable resource,GlideAnimation<? super GlideDrawable> glideAnimation){
  mBackgroundManager.setDrawable(resource);
}

Fixed version (ground truth):
@Override public void onResourceReady(Bitmap resource,GlideAnimation<? super Bitmap> glideAnimation){
  mBackgroundManager.setBitmap(resource);
}
Program: 111736
Project: 111736
Buggy source:
protected void updateBackground(Drawable drawable){
  BackgroundManager.getInstance(getActivity()).setDrawable(drawable);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  int width=mMetrics.widthPixels;
  int height=mMetrics.heightPixels;
  Glide.with(getActivity()).load(uri).asBitmap().centerCrop().error(mDefaultBackground).into(new SimpleTarget<Bitmap>(width,height){
    @Override public void onResourceReady(    Bitmap resource,    GlideAnimation<? super Bitmap> glideAnimation){
      mBackgroundManager.setBitmap(resource);
    }
  }
);
  mBackgroundTimer.cancel();
}
Program: 111737
Project: 111737
Buggy source:
protected void updateBackground(String uri){
  Glide.with(getActivity()).load(uri).centerCrop().error(mDefaultBackground).into(new SimpleTarget<GlideDrawable>(mMetrics.widthPixels,mMetrics.heightPixels){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      mBackgroundManager.setDrawable(resource);
    }
  }
);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  Glide.with(getActivity()).load(uri).asBitmap().centerCrop().error(mDefaultBackground).into(new SimpleTarget<Bitmap>(mMetrics.widthPixels,mMetrics.heightPixels){
    @Override public void onResourceReady(    Bitmap resource,    GlideAnimation<? super Bitmap> glideAnimation){
      mBackgroundManager.setBitmap(resource);
    }
  }
);
}
Program: 111738
Project: 111738
Buggy source:
private void setupDetailsOverviewRow(){
  Log.d(TAG,"String_Node_Str" + mSelectedMovie.toString());
  final DetailsOverviewRow row=new DetailsOverviewRow(mSelectedMovie);
  row.setImageDrawable(getResources().getDrawable(R.drawable.default_background));
  int width=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH);
  int height=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT);
  Glide.with(getActivity()).load(mSelectedMovie.getCardImageUrl()).centerCrop().error(R.drawable.default_background).into(new SimpleTarget<GlideDrawable>(width,height){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      Log.d(TAG,"String_Node_Str" + resource);
      row.setImageDrawable(resource);
      mAdapter.notifyArrayItemRangeChanged(0,mAdapter.size());
    }
  }
);
  row.addAction(new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  row.addAction(new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  row.addAction(new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  mAdapter.add(row);
}

Fixed version (ground truth):
private void setupDetailsOverviewRow(){
  Log.d(TAG,"String_Node_Str" + mSelectedMovie.toString());
  final DetailsOverviewRow row=new DetailsOverviewRow(mSelectedMovie);
  row.setImageDrawable(getResources().getDrawable(R.drawable.default_background));
  int width=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH);
  int height=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT);
  Glide.with(getActivity()).load(mSelectedMovie.getCardImageUrl()).centerCrop().error(R.drawable.default_background).into(new SimpleTarget<GlideDrawable>(width,height){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      Log.d(TAG,"String_Node_Str" + resource);
      row.setImageDrawable(resource);
      mAdapter.notifyArrayItemRangeChanged(0,mAdapter.size());
    }
  }
);
  SparseArrayObjectAdapter adapter=new SparseArrayObjectAdapter();
  adapter.set(ACTION_WATCH_TRAILER,new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  adapter.set(ACTION_RENT,new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  adapter.set(ACTION_BUY,new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  row.setActionsAdapter(adapter);
  mAdapter.add(row);
}
Program: 111739
Project: 111739
Buggy source:
@Override public void onStop(){
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  mBackgroundManager.release();
  super.onStop();
}
Program: 111740
Project: 111740
Buggy source:
@Override public void onDestroy(){
  super.onDestroy();
  stopPlayback();
  mVideoView.suspend();
  mSession.release();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  super.onDestroy();
  stopPlayback();
  mVideoView.suspend();
  mVideoView.setVideoPath(null);
  mSession.release();
}
Program: 111741
Project: 111741
Buggy source:
@Override public void onStop(){
  stopProgressAutomation();
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  stopProgressAutomation();
  mRowsAdapter=null;
  super.onStop();
}
Program: 111742
Project: 111742
Buggy source:
public ThirdStepFragment(int option){
  mOption=option;
}

Fixed version (ground truth):
public ThirdStepFragment(){
}
Program: 111743
Project: 111743
Buggy source:
@Override public void onDestroy(){
  super.onDestroy();
  if (null != mBackgroundTimer) {
    Log.d(TAG,"String_Node_Str" + mBackgroundTimer.toString());
    mBackgroundTimer.cancel();
  }
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (null != mBackgroundTimer) {
    Log.d(TAG,"String_Node_Str" + mBackgroundTimer.toString());
    mBackgroundTimer.cancel();
    mBackgroundTimer=null;
  }
  mBackgroundManager=null;
  super.onDestroy();
}
Program: 111744
Project: 111744
Buggy source:
@Override public void onResourceReady(GlideDrawable resource,GlideAnimation<? super GlideDrawable> glideAnimation){
  mBackgroundManager.setDrawable(resource);
}

Fixed version (ground truth):
@Override public void onResourceReady(Bitmap resource,GlideAnimation<? super Bitmap> glideAnimation){
  mBackgroundManager.setBitmap(resource);
}
Program: 111745
Project: 111745
Buggy source:
protected void updateBackground(Drawable drawable){
  BackgroundManager.getInstance(getActivity()).setDrawable(drawable);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  int width=mMetrics.widthPixels;
  int height=mMetrics.heightPixels;
  Glide.with(getActivity()).load(uri).asBitmap().centerCrop().error(mDefaultBackground).into(new SimpleTarget<Bitmap>(width,height){
    @Override public void onResourceReady(    Bitmap resource,    GlideAnimation<? super Bitmap> glideAnimation){
      mBackgroundManager.setBitmap(resource);
    }
  }
);
  mBackgroundTimer.cancel();
}
Program: 111746
Project: 111746
Buggy source:
protected void updateBackground(String uri){
  Glide.with(getActivity()).load(uri).centerCrop().error(mDefaultBackground).into(new SimpleTarget<GlideDrawable>(mMetrics.widthPixels,mMetrics.heightPixels){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      mBackgroundManager.setDrawable(resource);
    }
  }
);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  Glide.with(getActivity()).load(uri).asBitmap().centerCrop().error(mDefaultBackground).into(new SimpleTarget<Bitmap>(mMetrics.widthPixels,mMetrics.heightPixels){
    @Override public void onResourceReady(    Bitmap resource,    GlideAnimation<? super Bitmap> glideAnimation){
      mBackgroundManager.setBitmap(resource);
    }
  }
);
}
Program: 111747
Project: 111747
Buggy source:
private void setupDetailsOverviewRow(){
  Log.d(TAG,"String_Node_Str" + mSelectedMovie.toString());
  final DetailsOverviewRow row=new DetailsOverviewRow(mSelectedMovie);
  row.setImageDrawable(getResources().getDrawable(R.drawable.default_background));
  int width=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH);
  int height=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT);
  Glide.with(getActivity()).load(mSelectedMovie.getCardImageUrl()).centerCrop().error(R.drawable.default_background).into(new SimpleTarget<GlideDrawable>(width,height){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      Log.d(TAG,"String_Node_Str" + resource);
      row.setImageDrawable(resource);
      mAdapter.notifyArrayItemRangeChanged(0,mAdapter.size());
    }
  }
);
  row.addAction(new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  row.addAction(new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  row.addAction(new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  mAdapter.add(row);
}

Fixed version (ground truth):
private void setupDetailsOverviewRow(){
  Log.d(TAG,"String_Node_Str" + mSelectedMovie.toString());
  final DetailsOverviewRow row=new DetailsOverviewRow(mSelectedMovie);
  row.setImageDrawable(getResources().getDrawable(R.drawable.default_background));
  int width=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH);
  int height=Utils.convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT);
  Glide.with(getActivity()).load(mSelectedMovie.getCardImageUrl()).centerCrop().error(R.drawable.default_background).into(new SimpleTarget<GlideDrawable>(width,height){
    @Override public void onResourceReady(    GlideDrawable resource,    GlideAnimation<? super GlideDrawable> glideAnimation){
      Log.d(TAG,"String_Node_Str" + resource);
      row.setImageDrawable(resource);
      mAdapter.notifyArrayItemRangeChanged(0,mAdapter.size());
    }
  }
);
  SparseArrayObjectAdapter adapter=new SparseArrayObjectAdapter();
  adapter.set(ACTION_WATCH_TRAILER,new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  adapter.set(ACTION_RENT,new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  adapter.set(ACTION_BUY,new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  row.setActionsAdapter(adapter);
  mAdapter.add(row);
}
Program: 111748
Project: 111748
Buggy source:
@Override public void onStop(){
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  mBackgroundManager.release();
  super.onStop();
}
Program: 111749
Project: 111749
Buggy source:
@Override public void onDestroy(){
  super.onDestroy();
  stopPlayback();
  mVideoView.suspend();
  mSession.release();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  super.onDestroy();
  stopPlayback();
  mVideoView.suspend();
  mVideoView.setVideoPath(null);
  mSession.release();
}
Program: 111750
Project: 111750
Buggy source:
@Override public void onStop(){
  stopProgressAutomation();
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  stopProgressAutomation();
  mRowsAdapter=null;
  super.onStop();
}
Program: 111751
Project: 111751
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  sContext=getActivity();
  mItems=new ArrayList<Movie>();
  mSelectedMovie=(Movie)getActivity().getIntent().getSerializableExtra(MovieDetailsActivity.MOVIE);
  HashMap<String,List<Movie>> movies=VideoProvider.getMovieList();
  ArrayObjectAdapter listRowAdapter=new ArrayObjectAdapter(new CardPresenter());
  for (  Map.Entry<String,List<Movie>> entry : movies.entrySet()) {
    if (mSelectedMovie.getCategory().contains(entry.getKey())) {
      List<Movie> list=entry.getValue();
      for (int j=0; j < list.size(); j++) {
        mItems.add(list.get(j));
        if (mSelectedMovie.getTitle().contentEquals(list.get(j).getTitle())) {
          mCurrentItem=j;
        }
      }
    }
  }
  mHandler=new Handler();
  setBackgroundType(BACKGROUND_TYPE);
  setFadingEnabled(false);
  setupRows();
  setOnItemViewSelectedListener(new OnItemViewSelectedListener(){
    @Override public void onItemSelected(    Presenter.ViewHolder itemViewHolder,    Object item,    RowPresenter.ViewHolder rowViewHolder,    Row row){
      Log.i(TAG,"String_Node_Str" + item + "String_Node_Str"+ row);
    }
  }
);
  setOnItemViewClickedListener(new OnItemViewClickedListener(){
    @Override public void onItemClicked(    Presenter.ViewHolder itemViewHolder,    Object item,    RowPresenter.ViewHolder rowViewHolder,    Row row){
      Log.i(TAG,"String_Node_Str" + item + "String_Node_Str"+ row);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  sContext=getActivity();
  mItems=new ArrayList<Movie>();
  mSelectedMovie=(Movie)getActivity().getIntent().getSerializableExtra(MovieDetailsActivity.MOVIE);
  HashMap<String,List<Movie>> movies=VideoProvider.getMovieList();
  ArrayObjectAdapter listRowAdapter=new ArrayObjectAdapter(new CardPresenter());
  for (  Map.Entry<String,List<Movie>> entry : movies.entrySet()) {
    if (mSelectedMovie.getCategory().contains(entry.getKey())) {
      List<Movie> list=entry.getValue();
      for (int j=0; j < list.size(); j++) {
        mItems.add(list.get(j));
        if (mSelectedMovie.getTitle().contentEquals(list.get(j).getTitle())) {
          mCurrentItem=j;
        }
      }
    }
  }
  mHandler=new Handler();
  setBackgroundType(BACKGROUND_TYPE);
  setFadingEnabled(false);
  setupRows();
  setOnItemViewSelectedListener(new OnItemViewSelectedListener(){
    @Override public void onItemSelected(    Presenter.ViewHolder itemViewHolder,    Object item,    RowPresenter.ViewHolder rowViewHolder,    Row row){
      Log.i(TAG,"String_Node_Str" + item + "String_Node_Str"+ row);
    }
  }
);
  setOnItemViewClickedListener(new ItemViewClickedListener());
}
Program: 111752
Project: 111752
Buggy source:
@Override public void onItemClicked(Presenter.ViewHolder itemViewHolder,Object item,RowPresenter.ViewHolder rowViewHolder,Row row){
  Log.i(TAG,"String_Node_Str" + item + "String_Node_Str"+ row);
}

Fixed version (ground truth):
@Override public void onItemClicked(Presenter.ViewHolder itemViewHolder,Object item,RowPresenter.ViewHolder rowViewHolder,Row row){
  if (item instanceof Movie) {
    Movie movie=(Movie)item;
    Log.d(TAG,"String_Node_Str" + item.toString());
    Intent intent=new Intent(getActivity(),PlaybackOverlayActivity.class);
    intent.putExtra(MovieDetailsActivity.MOVIE,movie);
    Bundle bundle=ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),((ImageCardView)itemViewHolder.view).getMainImageView(),MovieDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
    getActivity().startActivity(intent,bundle);
  }
}
Program: 111753
Project: 111753
Buggy source:
@Override public void setSelected(boolean selected){
  int color1=mContext.getResources().getColor(R.color.detail_background);
  int color2=mContext.getResources().getColor(R.color.default_background);
  int color=selected ? color1 : color2;
  findViewById(R.id.info_field).setBackgroundColor(color);
  super.setSelected(selected);
}

Fixed version (ground truth):
@Override public void setSelected(boolean selected){
  int selected_background=mContext.getResources().getColor(R.color.detail_background);
  int default_background=mContext.getResources().getColor(R.color.default_background);
  int color=selected ? selected_background : default_background;
  findViewById(R.id.info_field).setBackgroundColor(color);
  super.setSelected(selected);
}
Program: 111754
Project: 111754
Buggy source:
@Override public ViewHolder onCreateViewHolder(ViewGroup parent){
  Log.d(TAG,"String_Node_Str");
  mContext=parent.getContext();
  ImageCardView cardView=new ImageCardView(mContext){
    @Override public void setSelected(    boolean selected){
      int color1=mContext.getResources().getColor(R.color.detail_background);
      int color2=mContext.getResources().getColor(R.color.default_background);
      int color=selected ? color1 : color2;
      findViewById(R.id.info_field).setBackgroundColor(color);
      super.setSelected(selected);
    }
  }
;
  cardView.setFocusable(true);
  cardView.setFocusableInTouchMode(true);
  return new ViewHolder(cardView);
}

Fixed version (ground truth):
@Override public ViewHolder onCreateViewHolder(ViewGroup parent){
  Log.d(TAG,"String_Node_Str");
  mContext=parent.getContext();
  ImageCardView cardView=new ImageCardView(mContext){
    @Override public void setSelected(    boolean selected){
      int selected_background=mContext.getResources().getColor(R.color.detail_background);
      int default_background=mContext.getResources().getColor(R.color.default_background);
      int color=selected ? selected_background : default_background;
      findViewById(R.id.info_field).setBackgroundColor(color);
      super.setSelected(selected);
    }
  }
;
  cardView.setFocusable(true);
  cardView.setFocusableInTouchMode(true);
  return new ViewHolder(cardView);
}
Program: 111755
Project: 111755
Buggy source:
public URI getCardImageURI(){
  try {
    return new URI(getCardImageUrl());
  }
 catch (  URISyntaxException e) {
    return null;
  }
}

Fixed version (ground truth):
public URI getCardImageURI(){
  try {
    String cardImageUrl=getCardImageUrl();
    return new URI(cardImageUrl);
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 111756
Project: 111756
Buggy source:
private void loadViews(){
  mVideoView=(VideoView)findViewById(R.id.videoView);
}

Fixed version (ground truth):
private void loadViews(){
  mVideoView=(VideoView)findViewById(R.id.videoView);
  mPlaybackOverlayFragment=(PlaybackOverlayFragment)getFragmentManager().findFragmentById(R.id.playback_controls_fragment);
  mPlaybackOverlayFragment.pressPlay();
}
Program: 111757
Project: 111757
Buggy source:
protected void updateVideoImage(URI uri){
  Picasso.with(sContext).load(uri.toString()).resize(Utils.convertDpToPixel(sContext,CARD_WIDTH),Utils.convertDpToPixel(sContext,CARD_HEIGHT)).into(mPlaybackControlsRowTarget);
}

Fixed version (ground truth):
protected void updateVideoImage(URI uri){
  String uriStr=uri.toString();
  Picasso.with(sContext).load(uriStr).resize(Utils.convertDpToPixel(sContext,CARD_WIDTH),Utils.convertDpToPixel(sContext,CARD_HEIGHT)).into(mPlaybackControlsRowTarget);
}
Program: 111758
Project: 111758
Buggy source:
private void updatePlaybackRow(int index){
  if (mPlaybackControlsRow.getItem() != null) {
    Movie item=(Movie)mPlaybackControlsRow.getItem();
    item.setTitle(mItems.get(mCurrentItem).getTitle());
    item.setStudio(mItems.get(mCurrentItem).getStudio());
  }
  if (SHOW_IMAGE) {
    mPlaybackControlsRowTarget=new PicassoPlaybackControlsRowTarget(mPlaybackControlsRow);
    updateVideoImage(mItems.get(mCurrentItem).getCardImageURI());
  }
  mRowsAdapter.notifyArrayItemRangeChanged(0,1);
  mPlaybackControlsRow.setTotalTime(getDuration());
  mPlaybackControlsRow.setCurrentTime(0);
  mPlaybackControlsRow.setBufferedProgress(0);
}

Fixed version (ground truth):
private void updatePlaybackRow(int index){
  if (mPlaybackControlsRow.getItem() != null) {
    Movie item=(Movie)mPlaybackControlsRow.getItem();
    item.setTitle(mItems.get(mCurrentItem).getTitle());
    item.setStudio(mItems.get(mCurrentItem).getStudio());
  }
  if (SHOW_IMAGE) {
    mPlaybackControlsRowTarget=new PicassoPlaybackControlsRowTarget(mPlaybackControlsRow);
    Movie movie=mItems.get(mCurrentItem);
    updateVideoImage(movie.getCardImageURI());
  }
  mRowsAdapter.notifyArrayItemRangeChanged(0,1);
  mPlaybackControlsRow.setTotalTime(getDuration());
  mPlaybackControlsRow.setCurrentTime(0);
  mPlaybackControlsRow.setBufferedProgress(0);
}
Program: 111759
Project: 111759
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  selectedMovie=(Movie)getActivity().getIntent().getSerializableExtra("String_Node_Str");
  Log.d(TAG,"String_Node_Str" + selectedMovie.toString());
  new DetailRowBuilderTask().execute(selectedMovie);
  setOnItemClickedListener(getDefaultItemClickedListener());
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  selectedMovie=(Movie)getActivity().getIntent().getSerializableExtra("String_Node_Str");
  Log.d(TAG,"String_Node_Str" + selectedMovie.toString());
  new DetailRowBuilderTask().execute(selectedMovie);
  setOnItemClickedListener(getDefaultItemClickedListener());
  updateBackground(selectedMovie.getBackgroundImageURI());
}
Program: 111760
Project: 111760
Buggy source:
@Override protected DetailsOverviewRow doInBackground(Movie... movies){
  selectedMovie=movies[0];
  Log.d(TAG,"String_Node_Str" + selectedMovie.toString());
  DetailsOverviewRow row=new DetailsOverviewRow(selectedMovie);
  try {
    Bitmap poster=Picasso.with(getActivity()).load(selectedMovie.getCardImageUrl()).resize(Utils.dpToPx(DETAIL_THUMB_WIDTH,getActivity().getApplicationContext()),Utils.dpToPx(DETAIL_THUMB_HEIGHT,getActivity().getApplicationContext())).centerCrop().get();
    row.setImageBitmap(getActivity(),poster);
    updateBackground(selectedMovie.getBackgroundImageURI());
  }
 catch (  IOException e) {
  }
  row.addAction(new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  row.addAction(new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  row.addAction(new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  return row;
}

Fixed version (ground truth):
@Override protected DetailsOverviewRow doInBackground(Movie... movies){
  selectedMovie=movies[0];
  Log.d(TAG,"String_Node_Str" + selectedMovie.toString());
  DetailsOverviewRow row=new DetailsOverviewRow(selectedMovie);
  try {
    Bitmap poster=Picasso.with(getActivity()).load(selectedMovie.getCardImageUrl()).resize(Utils.dpToPx(DETAIL_THUMB_WIDTH,getActivity().getApplicationContext()),Utils.dpToPx(DETAIL_THUMB_HEIGHT,getActivity().getApplicationContext())).centerCrop().get();
    row.setImageBitmap(getActivity(),poster);
  }
 catch (  IOException e) {
  }
  row.addAction(new Action(ACTION_WATCH_TRAILER,getResources().getString(R.string.watch_trailer_1),getResources().getString(R.string.watch_trailer_2)));
  row.addAction(new Action(ACTION_RENT,getResources().getString(R.string.rent_1),getResources().getString(R.string.rent_2)));
  row.addAction(new Action(ACTION_BUY,getResources().getString(R.string.buy_1),getResources().getString(R.string.buy_2)));
  return row;
}