nus-yam/ex-repair huggingface dataset:
Program: 54899
Project: 54899
Buggy source:
@Override public void init(FilterConfig filterConfig) throws ServletException {
  log.info(PippoUtils.getPippoLogo());
  String mode=filterConfig.getInitParameter(MODE_PARAM);
  if (!StringUtils.isNullOrEmpty(mode)) {
    System.setProperty(PippoConstants.SYSTEM_PROPERTY_PIPPO_MODE,mode);
  }
  if (application == null) {
    createApplication(filterConfig);
    log.debug("String_Node_Str",application);
  }
  try {
    String contextPath=StringUtils.addStart(filterConfig.getServletContext().getContextPath(),"String_Node_Str");
    application.getRouter().setContextPath(contextPath);
    if (filterPath == null) {
      initFilterPath(filterConfig);
    }
    String applicationPath=contextPath + "String_Node_Str" + filterPath;
    application.getRouter().setApplicationPath(applicationPath);
    if (!contextPath.equals(applicationPath)) {
      log.debug("String_Node_Str",contextPath);
    }
    log.debug("String_Node_Str",applicationPath);
    log.debug("String_Node_Str");
    routeDispatcher=new RouteDispatcher(application);
    routeDispatcher.init();
    String runtimeMode=application.getRuntimeMode().toString().toUpperCase();
    log.info("String_Node_Str",runtimeMode);
  }
 catch (  Exception e) {
    destroy();
    throw new ServletException(e);
  }
}

Fixed version (ground truth):
@Override public void init(FilterConfig filterConfig) throws ServletException {
  log.info(PippoUtils.getPippoLogo());
  String mode=filterConfig.getInitParameter(MODE_PARAM);
  if (!StringUtils.isNullOrEmpty(mode)) {
    System.setProperty(PippoConstants.SYSTEM_PROPERTY_PIPPO_MODE,mode);
  }
  if (application == null) {
    createApplication(filterConfig);
    log.debug("String_Node_Str",application);
  }
  try {
    String contextPath=StringUtils.addStart(filterConfig.getServletContext().getContextPath(),"String_Node_Str");
    application.getRouter().setContextPath(contextPath);
    if (filterPath == null) {
      initFilterPath(filterConfig);
    }
    String applicationPath=getApplicationPath(contextPath,filterPath);
    application.getRouter().setApplicationPath(applicationPath);
    if (!contextPath.equals(applicationPath)) {
      log.debug("String_Node_Str",contextPath);
    }
    log.debug("String_Node_Str",applicationPath);
    log.debug("String_Node_Str");
    routeDispatcher=new RouteDispatcher(application);
    routeDispatcher.init();
    String runtimeMode=application.getRuntimeMode().toString().toUpperCase();
    log.info("String_Node_Str",runtimeMode);
  }
 catch (  Exception e) {
    destroy();
    throw new ServletException(e);
  }
}
Program: 54900
Project: 54900
Buggy source:
@Override public String toString(){
  String toString=(getApplicationName() + "String_Node_Str" + getApplicationVersion()).trim();
  if (toString.isEmpty()) {
    super.toString();
  }
  return toString;
}

Fixed version (ground truth):
@Override public String toString(){
  String toString=(getApplicationName() + "String_Node_Str" + getApplicationVersion()).trim();
  return toString.isEmpty() ? super.toString() : toString;
}
Program: 54901
Project: 54901
Buggy source:
/** 
 * This method commits the response.
 */
public void commit(){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getStatus() == 0) {
    ok();
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.TEXT_HTML);
  }
  try {
    log.trace("String_Node_Str");
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}

Fixed version (ground truth):
private void commit(CharSequence content){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getStatus() == 0) {
    ok();
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.TEXT_HTML);
  }
  try {
    if (content != null) {
      httpServletResponse.getWriter().append(content);
    }
    log.trace("String_Node_Str");
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}
Program: 54902
Project: 54902
Buggy source:
protected void streamResource(URL resourceUrl,Request request,Response response){
  try {
    URLConnection urlConnection=resourceUrl.openConnection();
    long lastModified=urlConnection.getLastModified();
    httpCacheToolkit.addEtag(request,response,lastModified);
    if (response.getStatus() == HttpConstants.StatusCode.NOT_MODIFIED) {
      log.debug("String_Node_Str",resourceUrl);
      response.commit();
    }
 else {
      String filename=resourceUrl.getFile();
      String mimeType=mimeTypes.getContentType(request,response,filename);
      if (!StringUtils.isNullOrEmpty(mimeType)) {
        log.debug("String_Node_Str",resourceUrl);
        response.contentType(mimeType);
        response.resource(urlConnection.getInputStream());
      }
 else {
        log.debug("String_Node_Str",resourceUrl);
        response.file(filename,urlConnection.getInputStream());
      }
    }
  }
 catch (  Exception e) {
    throw new PippoRuntimeException("String_Node_Str" + resourceUrl,e);
  }
}

Fixed version (ground truth):
protected void streamResource(URL resourceUrl,Request request,Response response){
  try {
    URLConnection urlConnection=resourceUrl.openConnection();
    long lastModified=urlConnection.getLastModified();
    httpCacheToolkit.addEtag(request,response,lastModified);
    if (response.getStatus() == HttpConstants.StatusCode.NOT_MODIFIED) {
      log.debug("String_Node_Str",resourceUrl);
      response.commit();
    }
 else {
      String filename=resourceUrl.getFile();
      String mimeType=mimeTypes.getContentType(request,response,filename);
      if (!StringUtils.isNullOrEmpty(mimeType)) {
        log.debug("String_Node_Str",resourceUrl);
        response.contentType(mimeType);
        response.resource(urlConnection.getInputStream());
      }
 else {
        log.debug("String_Node_Str",resourceUrl);
        response.file(filename,urlConnection.getInputStream());
      }
    }
  }
 catch (  Exception e) {
    throw new PippoRuntimeException("String_Node_Str",e,resourceUrl);
  }
}
Program: 54903
Project: 54903
Buggy source:
/** 
 * Copies the input stream to the response output stream. <p>This method commits the response.</p>
 * @param input
 */
public void resource(InputStream input){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    httpServletResponse.flushBuffer();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}

Fixed version (ground truth):
/** 
 * Copies the input stream to the response output stream. <p>This method commits the response.</p>
 * @param input
 */
public void resource(InputStream input){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  try {
    IoUtils.copy(input,httpServletResponse.getOutputStream());
    httpServletResponse.flushBuffer();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}
Program: 54904
Project: 54904
Buggy source:
/** 
 * Copies the input stream to the response output stream as a download. <p>This method commits the response.</p>
 * @param filename
 * @param input
 */
public void file(String filename,InputStream input){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  if (isHeaderEmpty(HttpConstants.Header.CONTENT_DISPOSITION)) {
    if (filename != null && !filename.isEmpty()) {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str" + filename + "String_Node_Str");
    }
 else {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str");
    }
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    httpServletResponse.flushBuffer();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}

Fixed version (ground truth):
/** 
 * Copies the input stream to the response output stream as a download. <p>This method commits the response.</p>
 * @param filename
 * @param input
 */
public void file(String filename,InputStream input){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  if (isHeaderEmpty(HttpConstants.Header.CONTENT_DISPOSITION)) {
    if (filename != null && !filename.isEmpty()) {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str" + filename + "String_Node_Str");
    }
 else {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str");
    }
  }
  try {
    IoUtils.copy(input,httpServletResponse.getOutputStream());
    httpServletResponse.flushBuffer();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}
Program: 54905
Project: 54905
Buggy source:
private Map<String,String> getParameters(PatternBinding binding,String requestUri){
  Map<String,String> parameters=new HashMap<>();
  List<String> parameterNames=binding.getParameterNames();
  Matcher matcher=binding.getPattern().matcher(requestUri);
  matcher.matches();
  int groupCount=matcher.groupCount();
  if (groupCount > 0) {
    for (int i=1; i <= groupCount; i++) {
      parameters.put(parameterNames.get(i - 1),matcher.group(i));
    }
  }
  return parameters;
}

Fixed version (ground truth):
private Map<String,String> getParameters(PatternBinding binding,String requestUri){
  if (binding.getParameterNames().isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  Map<String,String> parameters=new HashMap<>();
  List<String> parameterNames=binding.getParameterNames();
  Matcher matcher=binding.getPattern().matcher(requestUri);
  matcher.matches();
  int groupCount=matcher.groupCount();
  if (groupCount > 0) {
    for (int i=1; i <= groupCount; i++) {
      parameters.put(parameterNames.get(i - 1),matcher.group(i));
    }
  }
  return parameters;
}
Program: 54906
Project: 54906
Buggy source:
/** 
 * This method commits the response.
 */
public void commit(){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getStatus() == 0) {
    ok();
  }
  if (getContentType() == null) {
    header(HttpConstants.Header.CONTENT_TYPE,HttpConstants.ContentType.TEXT_HTML);
  }
  try {
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * This method commits the response.
 */
public void commit(){
  checkCommitted();
  for (  Cookie cookie : getCookies()) {
    httpServletResponse.addCookie(cookie);
  }
  if (getStatus() == 0) {
    ok();
  }
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.TEXT_HTML);
  }
  try {
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}
Program: 54907
Project: 54907
Buggy source:
private boolean isHeaderEmpty(String name){
  String value=getHttpServletResponse().getHeader(name);
  return (value == null) || value.isEmpty();
}

Fixed version (ground truth):
private boolean isHeaderEmpty(String name){
  return StringUtils.isNullOrEmpty(getHttpServletResponse().getHeader(name));
}
Program: 54908
Project: 54908
Buggy source:
/** 
 * Copies the input stream to the response output stream. <p>This method commits the response.</p>
 * @param input
 */
public void resource(InputStream input){
  checkCommitted();
  if (isHeaderEmpty(HttpConstants.Header.CONTENT_TYPE)) {
    header(HttpConstants.Header.CONTENT_TYPE,HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    commit();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}

Fixed version (ground truth):
/** 
 * Copies the input stream to the response output stream. <p>This method commits the response.</p>
 * @param input
 */
public void resource(InputStream input){
  checkCommitted();
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    commit();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}
Program: 54909
Project: 54909
Buggy source:
/** 
 * Copies the input stream to the response output stream as a download. <p>This method commits the response.</p>
 * @param filename
 * @param input
 */
public void file(String filename,InputStream input){
  checkCommitted();
  header(HttpConstants.Header.CONTENT_TYPE,HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  if (isHeaderEmpty(HttpConstants.Header.CONTENT_DISPOSITION)) {
    if (filename != null && !filename.isEmpty()) {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str" + filename + "String_Node_Str");
    }
 else {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str");
    }
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    commit();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}

Fixed version (ground truth):
/** 
 * Copies the input stream to the response output stream as a download. <p>This method commits the response.</p>
 * @param filename
 * @param input
 */
public void file(String filename,InputStream input){
  checkCommitted();
  if (getContentType() == null) {
    contentType(HttpConstants.ContentType.APPLICATION_OCTET_STREAM);
  }
  if (isHeaderEmpty(HttpConstants.Header.CONTENT_DISPOSITION)) {
    if (filename != null && !filename.isEmpty()) {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str" + filename + "String_Node_Str");
    }
 else {
      header(HttpConstants.Header.CONTENT_DISPOSITION,"String_Node_Str");
    }
  }
  try {
    long length=IoUtils.copy(input,httpServletResponse.getOutputStream());
    if (isHeaderEmpty(HttpConstants.Header.CONTENT_LENGTH)) {
      contentLength(length);
    }
    commit();
  }
 catch (  Exception e) {
    throw new PippoRuntimeException(e);
  }
 finally {
    IoUtils.close(input);
  }
}
Program: 54910
Project: 54910
Buggy source:
/** 
 * A permanent (3XX status code) redirect. <p>This method commits the response.</p>
 * @param location
 * @param statusCode
 */
public void redirect(String location,int statusCode){
  checkCommitted();
  httpServletResponse.setStatus(statusCode);
  httpServletResponse.setHeader(HttpConstants.Header.LOCATION,location);
  httpServletResponse.setHeader(HttpConstants.Header.CONNECTION,"String_Node_Str");
  try {
    httpServletResponse.sendError(statusCode);
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * A permanent (3XX status code) redirect. <p>This method commits the response.</p>
 * @param location
 * @param statusCode
 */
public void redirect(String location,int statusCode){
  checkCommitted();
  status(statusCode);
  header(HttpConstants.Header.LOCATION,location);
  header(HttpConstants.Header.CONNECTION,"String_Node_Str");
  try {
    httpServletResponse.sendError(statusCode);
  }
 catch (  IOException e) {
    throw new PippoRuntimeException(e);
  }
}
Program: 54911
Project: 54911
Buggy source:
/** 
 * Sets the content length of the response.
 * @param length
 * @return the response
 */
public Response contentLength(long length){
  checkCommitted();
  httpServletResponse.setHeader(HttpConstants.Header.CONTENT_LENGTH,Long.toString(length));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the content length of the response.
 * @param length
 * @return the response
 */
public Response contentLength(long length){
  checkCommitted();
  httpServletResponse.setContentLength((int)length);
  return this;
}
Program: 54912
Project: 54912
Buggy source:
public static void main(String[] args){
  Pippo pippo=new Pippo(new CrudApplication());
  pippo.getServer().getSettings().staticFilesLocation("String_Node_Str");
  pippo.start();
}

Fixed version (ground truth):
public static void main(String[] args){
  Pippo pippo=new Pippo(new CrudApplication());
  pippo.getApplication().GET(new WebjarsResourceHandler());
  pippo.getApplication().GET(new PublicResourceHandler());
  pippo.start();
}
Program: 54913
Project: 54913
Buggy source:
public Application(PippoSettings settings){
  this.pippoSettings=new PippoSettings();
}

Fixed version (ground truth):
public Application(PippoSettings settings){
  this.pippoSettings=settings;
}
Program: 54914
Project: 54914
Buggy source:
public void send(CharSequence content){
  checkCommitted();
  if (getStatus() == 0) {
    status(HttpConstants.StatusCode.OK);
  }
  if (getContentType() == null) {
    header(HttpConstants.Header.CONTENT_TYPE,HttpConstants.ContentType.TEXT_HTML);
  }
  if (getCharacterEncoding() == null) {
    characterEncoding("String_Node_Str");
  }
  write(content);
  try {
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    new PippoRuntimeException(e);
  }
}

Fixed version (ground truth):
public void send(CharSequence content){
  checkCommitted();
  if (getStatus() == 0) {
    status(HttpConstants.StatusCode.OK);
  }
  if (getContentType() == null) {
    header(HttpConstants.Header.CONTENT_TYPE,HttpConstants.ContentType.TEXT_HTML);
  }
  if (getCharacterEncoding() == null) {
    characterEncoding(StandardCharsets.UTF_8.toString());
  }
  write(content);
  try {
    httpServletResponse.flushBuffer();
  }
 catch (  IOException e) {
    new PippoRuntimeException(e);
  }
}
Program: 54916
Project: 54916
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_details);
  ViewPager pager=(ViewPager)findViewById(R.id.pager);
  pager.setAdapter(new DetailsFragmentPagerAdapter(getFragmentManager()));
  int currentPosition=getIntent().getIntExtra(EXTRA_CURRENT_ALBUM_POSITION,0);
  pager.setCurrentItem(currentPosition);
  postponeEnterTransition();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_details);
  ViewPager pager=(ViewPager)findViewById(R.id.pager);
  pager.setAdapter(new DetailsFragmentPagerAdapter(getFragmentManager()));
  mStartingPosition=getIntent().getIntExtra(EXTRA_STARTING_ALBUM_POSITION,0);
  pager.setCurrentItem(mStartingPosition);
  postponeEnterTransition();
}
Program: 54917
Project: 54917
Buggy source:
@Override public Fragment getItem(int position){
  return DetailsFragment.newInstance(position);
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
  return DetailsFragment.newInstance(position,mStartingPosition);
}
Program: 54918
Project: 54918
Buggy source:
public static DetailsFragment newInstance(int position){
  Bundle args=new Bundle();
  args.putInt(ARG_SELECTED_IMAGE_POSITION,position);
  DetailsFragment fragment=new DetailsFragment();
  fragment.setArguments(args);
  return fragment;
}

Fixed version (ground truth):
public static DetailsFragment newInstance(int position,int startingPosition){
  Bundle args=new Bundle();
  args.putInt(ARG_ALBUM_IMAGE_POSITION,position);
  args.putInt(ARG_STARTING_ALBUM_IMAGE_POSITION,startingPosition);
  DetailsFragment fragment=new DetailsFragment();
  fragment.setArguments(args);
  return fragment;
}
Program: 54919
Project: 54919
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_details,container,false);
  final ImageView albumImage=(ImageView)rootView.findViewById(R.id.details_album_image);
  ImageView backgroundImage=(ImageView)rootView.findViewById(R.id.details_background_image);
  View textContainer=rootView.findViewById(R.id.details_text_container);
  TextView albumTitleText=(TextView)textContainer.findViewById(R.id.details_album_title);
  int selectedPosition=getArguments().getInt(ARG_SELECTED_IMAGE_POSITION);
  String albumImageUrl=ALBUM_IMAGE_URLS[selectedPosition];
  String backgroundImageUrl=BACKGROUND_IMAGE_URLS[selectedPosition];
  String albumName=ALBUM_NAMES[selectedPosition];
  Picasso.with(getActivity()).load(albumImageUrl).fit().centerCrop().into(albumImage);
  Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop().into(backgroundImage);
  albumTitleText.setText(albumName);
  albumImage.setTransitionName(albumName);
  albumImage.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      albumImage.getViewTreeObserver().removeOnPreDrawListener(this);
      getActivity().startPostponedEnterTransition();
      return true;
    }
  }
);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_details,container,false);
  final ImageView albumImage=(ImageView)rootView.findViewById(R.id.details_album_image);
  ImageView backgroundImage=(ImageView)rootView.findViewById(R.id.details_background_image);
  View textContainer=rootView.findViewById(R.id.details_text_container);
  TextView albumTitleText=(TextView)textContainer.findViewById(R.id.details_album_title);
  int albumPosition=getArguments().getInt(ARG_ALBUM_IMAGE_POSITION);
  String albumImageUrl=ALBUM_IMAGE_URLS[albumPosition];
  String backgroundImageUrl=BACKGROUND_IMAGE_URLS[albumPosition];
  String albumName=ALBUM_NAMES[albumPosition];
  albumImage.setTransitionName(albumName);
  Picasso.with(getActivity()).load(albumImageUrl).fit().centerCrop().into(albumImage);
  Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop().into(backgroundImage);
  albumTitleText.setText(albumName);
  int startingPosition=getArguments().getInt(ARG_STARTING_ALBUM_IMAGE_POSITION);
  if (savedInstanceState == null && albumPosition == startingPosition) {
    albumImage.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
      @Override public boolean onPreDraw(){
        albumImage.getViewTreeObserver().removeOnPreDrawListener(this);
        getActivity().startPostponedEnterTransition();
        return true;
      }
    }
);
  }
  return rootView;
}
Program: 54920
Project: 54920
Buggy source:
@Override public void onClick(View v){
  Intent intent=new Intent(MainActivity.this,DetailsActivity.class);
  intent.putExtra(EXTRA_CURRENT_ALBUM_POSITION,mAlbumPosition);
  startActivity(intent,ActivityOptions.makeSceneTransitionAnimation(MainActivity.this,mAlbumImage,mAlbumImage.getTransitionName()).toBundle());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Intent intent=new Intent(MainActivity.this,DetailsActivity.class);
  intent.putExtra(EXTRA_STARTING_ALBUM_POSITION,mAlbumPosition);
  startActivity(intent,ActivityOptions.makeSceneTransitionAnimation(MainActivity.this,mAlbumImage,mAlbumImage.getTransitionName()).toBundle());
}
Program: 54921
Project: 54921
Buggy source:
@Override public void onClick(View v){
  Intent intent=new Intent(MainActivity.this,DetailsActivity.class);
  intent.putExtra(EXTRA_STARTING_ALBUM_POSITION,mAlbumPosition);
  startActivity(intent,ActivityOptions.makeSceneTransitionAnimation(MainActivity.this,mAlbumImage,mAlbumImage.getTransitionName()).toBundle());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Intent intent=new Intent(MainActivity.this,DetailsActivity.class);
  intent.putExtra(EXTRA_STARTING_ALBUM_POSITION,mAlbumPosition);
  if (!mIsDetailsActivityStarted) {
    mIsDetailsActivityStarted=true;
    startActivity(intent,ActivityOptions.makeSceneTransitionAnimation(MainActivity.this,mAlbumImage,mAlbumImage.getTransitionName()).toBundle());
  }
}
Program: 54922
Project: 54922
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_details);
  ViewPager pager=(ViewPager)findViewById(R.id.pager);
  pager.setAdapter(new DetailsFragmentPagerAdapter(getFragmentManager()));
  int currentPosition=getIntent().getIntExtra(EXTRA_CURRENT_ALBUM_POSITION,0);
  pager.setCurrentItem(currentPosition);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_details);
  ViewPager pager=(ViewPager)findViewById(R.id.pager);
  pager.setAdapter(new DetailsFragmentPagerAdapter(getFragmentManager()));
  int currentPosition=getIntent().getIntExtra(EXTRA_CURRENT_ALBUM_POSITION,0);
  pager.setCurrentItem(currentPosition);
  postponeEnterTransition();
}
Program: 54923
Project: 54923
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_details,container,false);
  ImageView albumImage=(ImageView)rootView.findViewById(R.id.details_album_image);
  ImageView backgroundImage=(ImageView)rootView.findViewById(R.id.details_background_image);
  View textContainer=rootView.findViewById(R.id.details_text_container);
  TextView albumTitleText=(TextView)textContainer.findViewById(R.id.details_album_title);
  int selectedPosition=getArguments().getInt(ARG_SELECTED_IMAGE_POSITION);
  String albumImageUrl=ALBUM_IMAGE_URLS[selectedPosition];
  String backgroundImageUrl=BACKGROUND_IMAGE_URLS[selectedPosition];
  String albumName=ALBUM_NAMES[selectedPosition];
  Picasso.with(getActivity()).load(albumImageUrl).fit().into(albumImage);
  Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop().into(backgroundImage);
  albumTitleText.setText(albumName);
  albumImage.setTransitionName(albumName);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_details,container,false);
  final ImageView albumImage=(ImageView)rootView.findViewById(R.id.details_album_image);
  ImageView backgroundImage=(ImageView)rootView.findViewById(R.id.details_background_image);
  View textContainer=rootView.findViewById(R.id.details_text_container);
  TextView albumTitleText=(TextView)textContainer.findViewById(R.id.details_album_title);
  int selectedPosition=getArguments().getInt(ARG_SELECTED_IMAGE_POSITION);
  String albumImageUrl=ALBUM_IMAGE_URLS[selectedPosition];
  String backgroundImageUrl=BACKGROUND_IMAGE_URLS[selectedPosition];
  String albumName=ALBUM_NAMES[selectedPosition];
  Picasso.with(getActivity()).load(albumImageUrl).fit().into(albumImage);
  Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop().into(backgroundImage);
  albumTitleText.setText(albumName);
  albumImage.setTransitionName(albumName);
  albumImage.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      albumImage.getViewTreeObserver().removeOnPreDrawListener(this);
      getActivity().startPostponedEnterTransition();
      return true;
    }
  }
);
  return rootView;
}
Program: 54924
Project: 54924
Buggy source:
@Override public void onSharedElementStart(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReturning);
  if (!mIsReturning) {
    getWindow().setEnterTransition(makeEnterTransition(sharedElements.get(0)));
  }
}

Fixed version (ground truth):
@Override public void onSharedElementStart(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReturning);
  if (!mIsReturning) {
    getWindow().setEnterTransition(makeEnterTransition(getSharedElement(sharedElements)));
  }
}
Program: 54925
Project: 54925
Buggy source:
@Override public void onSharedElementEnd(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReentering);
}

Fixed version (ground truth):
@Override public void onSharedElementEnd(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReentering);
  logSharedElementsInfo(sharedElementNames,sharedElements);
}
Program: 54926
Project: 54926
Buggy source:
@Override public boolean onPreDraw(){
  mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
  startPostponedEnterTransition();
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
  mRecyclerView.requestLayout();
  startPostponedEnterTransition();
  return true;
}
Program: 54927
Project: 54927
Buggy source:
@Override public void onActivityReenter(int requestCode,Intent data){
  LOG("String_Node_Str",true);
  super.onActivityReenter(requestCode,data);
  mIsReentering=true;
  mTmpState=new Bundle(data.getExtras());
  int oldPosition=mTmpState.getInt(EXTRA_OLD_ITEM_POSITION);
  int currentPosition=mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION);
  if (oldPosition != currentPosition) {
    mRecyclerView.scrollToPosition(currentPosition);
  }
  postponeEnterTransition();
  mRecyclerView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
      startPostponedEnterTransition();
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onActivityReenter(int requestCode,Intent data){
  LOG("String_Node_Str",true);
  super.onActivityReenter(requestCode,data);
  mIsReentering=true;
  mTmpState=new Bundle(data.getExtras());
  int oldPosition=mTmpState.getInt(EXTRA_OLD_ITEM_POSITION);
  int currentPosition=mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION);
  if (oldPosition != currentPosition) {
    mRecyclerView.scrollToPosition(currentPosition);
  }
  postponeEnterTransition();
  mRecyclerView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
      mRecyclerView.requestLayout();
      startPostponedEnterTransition();
      return true;
    }
  }
);
}
Program: 54928
Project: 54928
Buggy source:
@Override public void onSharedElementStart(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReentering);
}

Fixed version (ground truth):
@Override public void onSharedElementStart(List<String> sharedElementNames,List<View> sharedElements,List<View> sharedElementSnapshots){
  LOG("String_Node_Str",mIsReentering);
  logSharedElementsInfo(sharedElementNames,sharedElements);
}
Program: 54930
Project: 54930
Buggy source:
@Override public void finishAfterTransition(){
  LOG("String_Node_Str",true);
  mIsReturning=true;
  getWindow().setReturnTransition(makeReturnTransition());
  Intent data=new Intent();
  data.putExtra(EXTRA_OLD_ITEM_POSITION,getIntent().getIntExtra(EXTRA_CURRENT_ITEM_POSITION,0));
  data.putExtra(EXTRA_CURRENT_ITEM_POSITION,mCurrentPosition);
  setResult(RESULT_OK,data);
  super.finishAfterTransition();
}

Fixed version (ground truth):
@Override public void finishAfterTransition(){
  LOG("String_Node_Str",true);
  mIsReturning=true;
  getWindow().setReturnTransition(makeReturnTransition());
  Intent data=new Intent();
  data.putExtra(EXTRA_OLD_ITEM_POSITION,getIntent().getExtras().getInt(EXTRA_CURRENT_ITEM_POSITION));
  data.putExtra(EXTRA_CURRENT_ITEM_POSITION,mCurrentPosition);
  setResult(RESULT_OK,data);
  super.finishAfterTransition();
}
Program: 54931
Project: 54931
Buggy source:
@Override public void onActivityReenter(int requestCode,Intent data){
  LOG("String_Node_Str",true);
  super.onActivityReenter(requestCode,data);
  mIsReentering=true;
  mTmpState=new Bundle(data.getExtras());
  mRecyclerView.scrollToPosition(mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION));
  postponeEnterTransition();
  mRecyclerView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
      startPostponedEnterTransition();
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onActivityReenter(int requestCode,Intent data){
  LOG("String_Node_Str",true);
  super.onActivityReenter(requestCode,data);
  mIsReentering=true;
  mTmpState=new Bundle(data.getExtras());
  int oldPosition=mTmpState.getInt(EXTRA_OLD_ITEM_POSITION);
  int currentPosition=mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION);
  if (oldPosition != currentPosition) {
    mRecyclerView.scrollToPosition(currentPosition);
  }
  postponeEnterTransition();
  mRecyclerView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
    @Override public boolean onPreDraw(){
      mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
      startPostponedEnterTransition();
      return true;
    }
  }
);
}
Program: 54933
Project: 54933
Buggy source:
@Override public void onMapSharedElements(List<String> names,Map<String,View> sharedElements){
  LOG("String_Node_Str",mIsReturning);
  if (mIsReturning && mCurrentPosition != mOriginalPosition) {
    names.clear();
    sharedElements.clear();
    final View sharedView=mAdapter.getCurrentDetailsFragment().getSharedView();
    if (sharedView == null) {
    }
 else {
      names.add(sharedView.getTransitionName());
      sharedElements.put(sharedView.getTransitionName(),sharedView);
    }
  }
}

Fixed version (ground truth):
@Override public void onMapSharedElements(List<String> names,Map<String,View> sharedElements){
  LOG("String_Node_Str",mIsReturning);
  if (mIsReturning && mCurrentPosition != mOriginalPosition) {
    final View sharedView=mAdapter.getCurrentDetailsFragment().getSharedView();
    if (sharedView == null) {
    }
 else {
      names.add(sharedView.getTransitionName());
      sharedElements.put(sharedView.getTransitionName(),sharedView);
    }
  }
  LOG("String_Node_Str" + names.toString(),mIsReturning);
  LOG("String_Node_Str" + makeString(sharedElements.keySet()),mIsReturning);
}
Program: 54935
Project: 54935
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  Resources res=getResources();
  mRecyclerView=(RecyclerView)findViewById(R.id.recycler_view);
  mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(res.getInteger(R.integer.num_columns),StaggeredGridLayoutManager.VERTICAL));
  mRecyclerView.setAdapter(new CardAdapter());
  setExitSharedElementCallback(mCallback);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  Resources res=getResources();
  mRecyclerView=(RecyclerView)findViewById(R.id.recycler_view);
  mRecyclerView.setLayoutManager(new GridLayoutManager(this,res.getInteger(R.integer.num_columns)));
  mRecyclerView.setAdapter(new CardAdapter());
  setExitSharedElementCallback(mCallback);
}
Program: 54936
Project: 54936
Buggy source:
@Override public void onMapSharedElements(List<String> names,Map<String,View> sharedElements){
  LOG("String_Node_Str",mIsReentering);
  if (mTmpState != null) {
    final int oldPosition=mTmpState.getInt(EXTRA_OLD_ITEM_POSITION);
    final int currentPosition=mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION);
    if (currentPosition != oldPosition) {
      final String newTransitionName=CAPTIONS[currentPosition];
      final View newSharedView=mRecyclerView.findViewWithTag(newTransitionName);
      if (newSharedView != null) {
        names.clear();
        names.add(newTransitionName);
        sharedElements.clear();
        sharedElements.put(newTransitionName,newSharedView);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onMapSharedElements(List<String> names,Map<String,View> sharedElements){
  LOG("String_Node_Str",mIsReentering);
  if (mTmpState != null) {
    final int oldPosition=mTmpState.getInt(EXTRA_OLD_ITEM_POSITION);
    final int currentPosition=mTmpState.getInt(EXTRA_CURRENT_ITEM_POSITION);
    if (currentPosition != oldPosition) {
      final String newTransitionName=CAPTIONS[currentPosition];
      final View newSharedView=mRecyclerView.findViewWithTag(newTransitionName);
      if (newSharedView != null) {
        names.clear();
        names.add(newTransitionName);
        sharedElements.clear();
        sharedElements.put(newTransitionName,newSharedView);
      }
    }
  }
  View decor=getWindow().getDecorView();
  View navigationBar=decor.findViewById(android.R.id.navigationBarBackground);
  View statusBar=decor.findViewById(android.R.id.statusBarBackground);
  View actionBar=decor.findViewById(getResources().getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!mIsReentering) {
    if (navigationBar != null) {
      names.add("String_Node_Str");
      sharedElements.put("String_Node_Str",navigationBar);
    }
    if (statusBar != null) {
      names.add("String_Node_Str");
      sharedElements.put("String_Node_Str",statusBar);
    }
    if (actionBar != null) {
      names.add("String_Node_Str");
      sharedElements.put("String_Node_Str",actionBar);
    }
  }
 else {
    names.remove("String_Node_Str");
    sharedElements.remove("String_Node_Str");
    names.remove("String_Node_Str");
    sharedElements.remove("String_Node_Str");
    names.remove("String_Node_Str");
    sharedElements.remove("String_Node_Str");
  }
  LOG("String_Node_Str" + names.toString(),mIsReentering);
  LOG("String_Node_Str" + makeString(sharedElements.keySet()),mIsReentering);
}
Program: 54937
Project: 54937
Buggy source:
@Override public void onClick(View v){
  if (RecommendCardView.class.isInstance(v)) {
    RecommendCardView rcv=(RecommendCardView)v;
    DisplayItem item=rcv.getContentData();
    if (null != item) {
      String target=item.target;
      if (null != target) {
        if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else {
        }
        Intent intent=new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("String_Node_Str" + item.ns + "String_Node_Str"+ item.type+ "String_Node_Str"+ item.id));
        intent.putExtra("String_Node_Str",item);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        v.getContext().startActivity(intent);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (RecommendCardView.class.isInstance(v)) {
    RecommendCardView rcv=(RecommendCardView)v;
    DisplayItem item=rcv.getContentData();
    if (null != item) {
      DisplayItem.Target target=item.target;
      if (null != target) {
        if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else {
        }
        Intent intent=new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("String_Node_Str" + item.ns + "String_Node_Str"+ item.type+ "String_Node_Str"+ item.id));
        intent.putExtra("String_Node_Str",item);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        v.getContext().startActivity(intent);
      }
    }
  }
}
Program: 54938
Project: 54938
Buggy source:
protected void createTabsLoader(){
  mLoader=new AppTabsGsonLoader(this);
}

Fixed version (ground truth):
protected void createTabsLoader(){
  mLoader=new AppTabsGsonLoader(this,null);
}
Program: 54939
Project: 54939
Buggy source:
@Override public void onClick(View v){
  if (RecommendCardView.class.isInstance(v)) {
    RecommendCardView rcv=(RecommendCardView)v;
    DisplayItem item=rcv.getContentData();
    if (null != item) {
      String target=item.target;
      if (null != target) {
        if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else         if (target.equals("String_Node_Str")) {
        }
 else {
        }
        Intent intent=new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("String_Node_Str" + item.ns + "String_Node_Str"+ item.type+ "String_Node_Str"+ item.id));
        intent.putExtra("String_Node_Str",item);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        v.getContext().startActivity(intent);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (RecommendCardView.class.isInstance(v)) {
    RecommendCardView rcv=(RecommendCardView)v;
    DisplayItem item=rcv.getContentData();
    if (null != item) {
      DisplayItem.Target target=item.target;
      if (null != target) {
        if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else         if (target.type.equals("String_Node_Str")) {
        }
 else {
        }
        Intent intent=new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("String_Node_Str" + item.ns + "String_Node_Str"+ item.type+ "String_Node_Str"+ item.id));
        intent.putExtra("String_Node_Str",item);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        v.getContext().startActivity(intent);
      }
    }
  }
}
Program: 54940
Project: 54940
Buggy source:
protected void createTabsLoader(){
  mLoader=new GameTabsGsonLoader(this);
}

Fixed version (ground truth):
protected void createTabsLoader(){
  mLoader=new GameTabsGsonLoader(this,null);
}
Program: 54941
Project: 54941
Buggy source:
public AppTabsGsonLoader(Context context){
  super(context);
}

Fixed version (ground truth):
public AppTabsGsonLoader(Context context,DisplayItem item){
  super(context,item);
}
Program: 54942
Project: 54942
Buggy source:
public GameTabsGsonLoader(Context context){
  super(context);
}

Fixed version (ground truth):
public GameTabsGsonLoader(Context context,DisplayItem item){
  super(context,item);
}
Program: 54946
Project: 54946
Buggy source:
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
switch (requestCode) {
case PERMISSION_REQUEST_FILE_SOURCE_READ_FILES:
{
      if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        if (source != null && source instanceof FileIQSource) {
          if (!source.open(this,this))           Log.e(LOGTAG,"String_Node_Str");
        }
 else {
          Log.e(LOGTAG,"String_Node_Str");
        }
      }
    }
case PERMISSION_REQUEST_RECORDING_WRITE_FILES:
{
    if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
      showRecordingDialog();
    }
  }
}
}

Fixed version (ground truth):
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
switch (requestCode) {
case PERMISSION_REQUEST_FILE_SOURCE_READ_FILES:
{
      if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        if (source != null && source instanceof FileIQSource) {
          if (!source.open(this,this))           Log.e(LOGTAG,"String_Node_Str");
        }
 else {
          Log.e(LOGTAG,"String_Node_Str");
        }
      }
      break;
    }
case PERMISSION_REQUEST_RECORDING_WRITE_FILES:
{
    if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
      showRecordingDialog();
    }
    break;
  }
}
}
Program: 54947
Project: 54947
Buggy source:
/** 
 * @param enabled true: will prevent the analyzerSurface from re-tune the frequency or change the sample rate.
 */
public void setRecordingEnabled(boolean enabled){
  this.recordingEnabled=enabled;
  virtualFrequency=source.getFrequency();
  virtualSampleRate=source.getSampleRate();
}

Fixed version (ground truth):
/** 
 * @param enabled true: will prevent the analyzerSurface from re-tune the frequency or change the sample rate.
 */
public void setRecordingEnabled(boolean enabled){
  this.recordingEnabled=enabled;
  if (enabled) {
    virtualFrequency=source.getFrequency();
    virtualSampleRate=source.getSampleRate();
  }
}
Program: 54950
Project: 54950
Buggy source:
/** 
 * Will set the screen orientation of the hosting activity
 * @param orientation		auto, landscape, portrait, reverse_landscape or reverse_portrait
 */
public void setScreenOrientation(String orientation){
  if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
}

Fixed version (ground truth):
/** 
 * Will set the screen orientation of the hosting activity
 * @param orientation		auto, landscape, portrait, reverse_landscape or reverse_portrait
 */
public void setScreenOrientation(String orientation){
  if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
 else   if (orientation.equals("String_Node_Str"))   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
}
Program: 54952
Project: 54952
Buggy source:
/** 
 * @param enabled true: will prevent the analyzerSurface from re-tune the frequency or change the sample rate.
 */
public void setRecordingEnabled(boolean enabled){
  this.recordingEnabled=enabled;
  virtualFrequency=source.getFrequency();
  virtualSampleRate=source.getSampleRate();
}

Fixed version (ground truth):
/** 
 * @param enabled true: will prevent the analyzerSurface from re-tune the frequency or change the sample rate.
 */
public void setRecordingEnabled(boolean enabled){
  this.recordingEnabled=enabled;
  if (enabled) {
    virtualFrequency=source.getFrequency();
    virtualSampleRate=source.getSampleRate();
  }
}