nus-yam/ex-repair huggingface dataset:
Program: 177841
Project: 177841
Buggy source:
@Override protected void onViewLoad(){
  super.onViewLoad();
  if (getSocialize().isAuthenticated()) {
    dialog=progressDialogFactory.show(getContext(),"String_Node_Str","String_Node_Str");
    count=1;
    doGetComment();
  }
 else {
    showError(getContext(),new SocializeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void onViewLoad(){
  super.onViewLoad();
  if (getSocialize().isAuthenticated()) {
    dialog=progressDialogFactory.show(getContext(),"String_Node_Str","String_Node_Str");
    count=1;
    doGetComment();
  }
 else {
    showError(getContext(),new SocializeException("String_Node_Str"));
  }
}
Program: 177842
Project: 177842
Buggy source:
@Override protected View getView(Bundle bundle,Object... entityKeys){
  if (entityKeys != null) {
    if (actionLayoutView == null) {
      actionLayoutView=container.getBean("String_Node_Str",entityKeys);
      LayoutParams scrollViewLayout=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      LayoutParams childViewLayout=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      ScrollView scrollView=new ScrollView(getContext());
      scrollView.setFillViewport(true);
      scrollView.setLayoutParams(scrollViewLayout);
      scrollView.addView(actionLayoutView,childViewLayout);
      LinearLayout layout=new LinearLayout(getContext());
      LayoutParams masterParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      layout.setLayoutParams(masterParams);
      layout.setBackgroundDrawable(((Drawables)container.getBean("String_Node_Str")).getDrawable("String_Node_Str",true,true,true));
      layout.addView(scrollView);
      view=layout;
    }
    return view;
  }
 else {
    Log.e("String_Node_Str","String_Node_Str" + getClass().getSimpleName());
    return null;
  }
}

Fixed version (ground truth):
@Override protected View getView(Bundle bundle,Object... entityKeys){
  if (entityKeys != null) {
    if (actionLayoutView == null) {
      actionLayoutView=container.getBean("String_Node_Str",entityKeys);
      LayoutParams scrollViewLayout=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      LayoutParams childViewLayout=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      ScrollView scrollView=new ScrollView(getContext());
      scrollView.setFillViewport(true);
      scrollView.setLayoutParams(scrollViewLayout);
      scrollView.addView(actionLayoutView,childViewLayout);
      LinearLayout layout=new LinearLayout(getContext());
      LayoutParams masterParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
      layout.setLayoutParams(masterParams);
      layout.setBackgroundDrawable(((Drawables)container.getBean("String_Node_Str")).getDrawable("String_Node_Str",true,true,true));
      layout.addView(scrollView);
      view=layout;
    }
    return view;
  }
 else {
    Log.e(SocializeLogger.LOG_TAG,"String_Node_Str" + getClass().getSimpleName());
    return null;
  }
}
Program: 177843
Project: 177843
Buggy source:
@Override protected void onViewUpdate(){
  super.onViewUpdate();
  reload();
}

Fixed version (ground truth):
@Override public void onViewUpdate(){
  super.onViewUpdate();
  reload();
}
Program: 177844
Project: 177844
Buggy source:
@Override protected void onViewLoad(){
  super.onViewLoad();
  final String entityKey=actionBarView.getEntityKey();
  ticker.startTicker();
  if (logger != null && logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + getClass().getSimpleName());
  }
  if (onActionBarEventListener != null) {
    onActionBarEventListener.onLoad(actionBarView);
  }
  CacheableEntity entity=entityCache.get(entityKey);
  if (entity == null) {
    getSocialize().view(entityKey,new ViewAddListener(){
      @Override public void onError(      SocializeException error){
        error.printStackTrace();
        getEntityData(entityKey);
      }
      @Override public void onCreate(      View entity){
        getEntityData(entityKey);
      }
    }
);
  }
 else {
    getEntityData(entityKey);
  }
}

Fixed version (ground truth):
@Override public void onViewLoad(){
  super.onViewLoad();
  final String entityKey=actionBarView.getEntityKey();
  ticker.startTicker();
  if (logger != null && logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + getClass().getSimpleName());
  }
  if (onActionBarEventListener != null) {
    onActionBarEventListener.onLoad(actionBarView);
  }
  CacheableEntity entity=entityCache.get(entityKey);
  if (entity == null) {
    getSocialize().view(entityKey,new ViewAddListener(){
      @Override public void onError(      SocializeException error){
        error.printStackTrace();
        getEntityData(entityKey);
      }
      @Override public void onCreate(      View entity){
        getEntityData(entityKey);
      }
    }
);
  }
 else {
    getEntityData(entityKey);
  }
}
Program: 177845
Project: 177845
Buggy source:
@Override public void onCreateSafe(Bundle savedInstanceState){
  Bundle extras=getIntent().getExtras();
  if (extras == null || !extras.containsKey(SocializeUI.ENTITY_KEY)) {
    Log.w("String_Node_Str","String_Node_Str");
    finish();
  }
 else {
    String entityKey=extras.getString(SocializeUI.ENTITY_KEY);
    if (StringUtils.isEmpty(entityKey)) {
      Log.w("String_Node_Str","String_Node_Str");
      finish();
    }
 else {
      view=new CommentView(this);
      setContentView(view);
    }
  }
}

Fixed version (ground truth):
@Override public void onCreateSafe(Bundle savedInstanceState){
  Bundle extras=getIntent().getExtras();
  if (extras == null || !extras.containsKey(SocializeUI.ENTITY_KEY)) {
    Log.w(SocializeLogger.LOG_TAG,"String_Node_Str");
    finish();
  }
 else {
    String entityKey=extras.getString(SocializeUI.ENTITY_KEY);
    if (StringUtils.isEmpty(entityKey)) {
      Log.w(SocializeLogger.LOG_TAG,"String_Node_Str");
      finish();
    }
 else {
      view=new CommentView(this);
      setContentView(view);
    }
  }
}
Program: 177846
Project: 177846
Buggy source:
@Override public int getCount(){
  int extra=1;
  if (!isDisplayLoading()) {
    extra=0;
  }
  return (comments == null) ? 0 : comments.size() + extra;
}

Fixed version (ground truth):
@Override public int getCount(){
  return count;
}
Program: 177848
Project: 177848
Buggy source:
public boolean isDisplayLoading(){
  return !(last || (comments != null && comments.size() == 0));
}

Fixed version (ground truth):
public boolean isDisplayLoading(){
  return !last && (comments != null && comments.size() > 0);
}
Program: 177849
Project: 177849
Buggy source:
@Override public void notifyDataSetChanged(){
  super.notifyDataSetChanged();
}

Fixed version (ground truth):
@Override public void notifyDataSetChanged(){
  super.notifyDataSetChanged();
  int extra=0;
  if (isDisplayLoading()) {
    extra=1;
  }
  count=(comments == null) ? 0 : comments.size() + extra;
}
Program: 177850
Project: 177850
Buggy source:
@Override protected void onViewLoad(){
  super.onViewLoad();
  if (getSocialize().isAuthenticated()) {
    dialog=progressDialogFactory.show(getContext(),"String_Node_Str","String_Node_Str");
    count=2;
    doGetUserProfile();
    doGetComment();
  }
 else {
    showError(getContext(),new SocializeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void onViewLoad(){
  super.onViewLoad();
  if (getSocialize().isAuthenticated()) {
    dialog=progressDialogFactory.show(getContext(),"String_Node_Str","String_Node_Str");
    count=2;
    doGetUserProfile();
    doGetComment();
  }
 else {
    showError(getContext(),new SocializeException("String_Node_Str"));
  }
}
Program: 177851
Project: 177851
Buggy source:
@Override protected View getView(Bundle bundle,Object... entityKeys){
  if (entityKeys != null) {
    if (commentLayoutView == null) {
      commentLayoutView=container.getBean("String_Node_Str",entityKeys);
    }
    return commentLayoutView;
  }
 else {
    Log.e("String_Node_Str","String_Node_Str" + getClass().getSimpleName());
    return null;
  }
}

Fixed version (ground truth):
@Override protected View getView(Bundle bundle,Object... entityKeys){
  if (entityKeys != null) {
    if (commentLayoutView == null) {
      commentLayoutView=container.getBean("String_Node_Str",entityKeys);
    }
    return commentLayoutView;
  }
 else {
    Log.e(SocializeLogger.LOG_TAG,"String_Node_Str" + getClass().getSimpleName());
    return null;
  }
}
Program: 177852
Project: 177852
Buggy source:
@Override protected void onViewRendered(int width,int height){
  super.onViewRendered(width,height);
  commentField.requestFocus();
}

Fixed version (ground truth):
@Override public void onViewRendered(int width,int height){
  super.onViewRendered(width,height);
  commentField.requestFocus();
}
Program: 177854
Project: 177854
Buggy source:
@Override public void authenticate(String consumerKey,String consumerSecret,AuthProviderData authProviderData,SocializeAuthListener listener,SocializeSessionConsumer sessionConsumer,boolean do3rdPartyAuth){
  listener.onAuthSuccess(new SocializeSessionImpl());
  if (delegate != null)   delegate.authenticate(consumerKey,consumerSecret,authProviderData,listener,sessionConsumer,do3rdPartyAuth);
}

Fixed version (ground truth):
@Override public void authenticate(String consumerKey,String consumerSecret,AuthProviderData authProviderData,SocializeAuthListener listener,SocializeSessionConsumer sessionConsumer,boolean do3rdPartyAuth){
  MockSocializeSession mockSocializeSession=new MockSocializeSession();
  listener.onAuthSuccess(mockSocializeSession);
  sessionConsumer.setSession(mockSocializeSession);
  if (delegate != null)   delegate.authenticate(consumerKey,consumerSecret,authProviderData,listener,sessionConsumer,do3rdPartyAuth);
}
Program: 177855
Project: 177855
Buggy source:
@Override public void listActivityByUser(SocializeSession session,long id,int startIndex,int endIndex,ActivityListener listener){
  if (delegate != null)   delegate.listActivityByUser(session,id,startIndex,endIndex,listener);
}

Fixed version (ground truth):
@Override public void listActivityByUser(SocializeSession session,long id,int startIndex,int endIndex,ActivityListener listener){
  if (delegate != null)   delegate.listActivityByUser(session,id,startIndex,endIndex,listener);
  listener.onList((ListResult<SocializeAction>)listResult);
}
Program: 177856
Project: 177856
Buggy source:
@Override public void listCommentsById(SocializeSession session,CommentListener listener,int... ids){
  if (delegate != null)   delegate.listCommentsById(session,listener,ids);
}

Fixed version (ground truth):
@Override public void listCommentsById(SocializeSession session,CommentListener listener,int... ids){
  if (delegate != null)   delegate.listCommentsById(session,listener,ids);
  listener.onList((ListResult<Comment>)listResult);
}
Program: 177857
Project: 177857
Buggy source:
@Override public void listLikesById(SocializeSession session,LikeListener listener,int... ids){
  if (delegate != null)   delegate.listLikesById(session,listener,ids);
}

Fixed version (ground truth):
@Override public void listLikesById(SocializeSession session,LikeListener listener,int... ids){
  if (delegate != null)   delegate.listLikesById(session,listener,ids);
  listener.onList((ListResult<Like>)listResult);
}
Program: 177858
Project: 177858
Buggy source:
@Override public void listEntitiesByKey(SocializeSession session,EntityListener listener,String... keys){
  if (delegate != null)   delegate.listEntitiesByKey(session,listener,keys);
}

Fixed version (ground truth):
@Override public void listEntitiesByKey(SocializeSession session,EntityListener listener,String... keys){
  if (delegate != null)   delegate.listEntitiesByKey(session,listener,keys);
  listener.onList((ListResult<Entity>)listResult);
}
Program: 177859
Project: 177859
Buggy source:
@Override public void listCommentsByEntity(SocializeSession session,String url,int startIndex,int endIndex,CommentListener listener){
  if (delegate != null)   delegate.listCommentsByEntity(session,url,startIndex,endIndex,listener);
}

Fixed version (ground truth):
@Override public void listCommentsByEntity(SocializeSession session,String url,int startIndex,int endIndex,CommentListener listener){
  if (delegate != null)   delegate.listCommentsByEntity(session,url,startIndex,endIndex,listener);
  listener.onList((ListResult<Comment>)listResult);
}
Program: 177861
Project: 177861
Buggy source:
@Override protected Void doInBackground(Void... params){
  Socialize.getSocialize().clearSessionCache();
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  Socialize.getSocialize().clearSessionCache(v.getContext());
  return null;
}
Program: 177862
Project: 177862
Buggy source:
@Override public void clearCache(String appId){
}

Fixed version (ground truth):
@Override public void clearCache(Context context,String appId){
}
Program: 177864
Project: 177864
Buggy source:
@Override protected Void doInBackground(Void... params){
  try {
    Socialize.getSocialize().init(SampleActivity.this);
    Socialize.getSocialize().clearSessionCache();
  }
  finally {
    Socialize.getSocialize().destroy();
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  try {
    Socialize.getSocialize().init(SampleActivity.this);
    Socialize.getSocialize().clearSessionCache(SampleActivity.this);
  }
  finally {
    Socialize.getSocialize().destroy();
  }
  return null;
}
Program: 177866
Project: 177866
Buggy source:
@Override public void onAfterAuthenticate(IOCContainer container){
  super.onAfterAuthenticate(container);
  sliderFactory=container.getBean("String_Node_Str");
  if (sliderFactory != null) {
    slider=sliderFactory.wrap(this);
  }
}

Fixed version (ground truth):
@Override public void onAfterAuthenticate(IOCContainer container){
  super.onAfterAuthenticate(container);
  sliderFactory=container.getBean("String_Node_Str");
  if (sliderFactory != null) {
    slider=sliderFactory.wrap(this,ZOrder.BEHIND,0);
  }
}
Program: 177867
Project: 177867
Buggy source:
public CommentAddButtonListener(Context context,CommentEditField field,CommentButtonCallback callback,KeyboardUtils keyboardUtils){
  this(context);
  this.field=field;
  this.callback=callback;
  this.keyboardUtils=keyboardUtils;
  this.consumerKey=getSocializeUI().getCustomConfigValue(SocializeConfig.SOCIALIZE_CONSUMER_KEY);
  this.consumerSecret=getSocializeUI().getCustomConfigValue(SocializeConfig.SOCIALIZE_CONSUMER_SECRET);
}

Fixed version (ground truth):
public CommentAddButtonListener(Context context,CommentButtonCallback callback){
  this(context);
  this.callback=callback;
  this.consumerKey=getSocializeUI().getCustomConfigValue(SocializeConfig.SOCIALIZE_CONSUMER_KEY);
  this.consumerSecret=getSocializeUI().getCustomConfigValue(SocializeConfig.SOCIALIZE_CONSUMER_SECRET);
}
Program: 177869
Project: 177869
Buggy source:
public synchronized void addResult(T result){
  if (results == null)   results=new ListResult<T>();
  List<T> list=results.getItems();
  if (list == null) {
    list=new LinkedList<T>();
    results.setItems(list);
  }
  list.add(result);
}

Fixed version (ground truth):
public void addResult(T result){
  if (results == null) {
synchronized (this) {
      if (results == null) {
        results=new ListResult<T>();
      }
    }
  }
  List<T> list=results.getItems();
  if (list == null) {
    list=new LinkedList<T>();
    results.setItems(list);
  }
  list.add(result);
}
Program: 177870
Project: 177870
Buggy source:
public synchronized T getFirstResult(){
  if (results != null) {
    List<T> list=results.getItems();
    if (list != null && list.size() > 0) {
      return list.get(0);
    }
  }
  return null;
}

Fixed version (ground truth):
public T getFirstResult(){
  if (results != null) {
    List<T> list=results.getItems();
    if (list != null && list.size() > 0) {
      return list.get(0);
    }
  }
  return null;
}
Program: 177871
Project: 177871
Buggy source:
public void merge(User user){
  setFirstName(user.getFirstName());
  setLastName(user.getLastName());
  setUsername(user.getUsername());
  setLocation(user.getLocation());
  setSmallImageUri(user.getSmallImageUri());
  setMediumImageUri(user.getMediumImageUri());
  setLargeImageUri(user.getLargeImageUri());
  setStats(user.getStats());
  setAuthData(user.getAuthData());
  setProfilePicData(user.getProfilePicData());
}

Fixed version (ground truth):
public void merge(User user){
  setFirstName(user.getFirstName());
  setLastName(user.getLastName());
  setUsername(user.getUsername());
  setLocation(user.getLocation());
  setSmallImageUri(user.getSmallImageUri());
  setMediumImageUri(user.getMediumImageUri());
  setLargeImageUri(user.getLargeImageUri());
  setStats(user.getStats());
  setAuthData(user.getAuthData());
  setProfilePicData(user.getProfilePicData());
  setAutoPostToFacebook(user.isAutoPostToFacebook());
}
Program: 177875
Project: 177875
Buggy source:
public void testDeviceUtilsUserAgentString(){
  DeviceUtils utils=new DeviceUtils();
  utils.init(getActivity());
  String userAgentString=utils.getUserAgentString();
  assertEquals("String_Node_Str" + android.os.Build.VERSION.SDK_INT + "String_Node_Str"+ android.os.Build.MODEL+ "String_Node_Str"+ Socialize.VERSION+ "String_Node_Str"+ Locale.getDefault().getLanguage()+ "String_Node_Str"+ Locale.getDefault().getCountry()+ "String_Node_Str",userAgentString + "String_Node_Str");
}

Fixed version (ground truth):
public void testDeviceUtilsUserAgentString(){
  DeviceUtils utils=new DeviceUtils();
  utils.init(getActivity());
  String userAgentString=utils.getUserAgentString();
  assertEquals("String_Node_Str" + android.os.Build.VERSION.SDK_INT + "String_Node_Str"+ android.os.Build.MODEL+ "String_Node_Str"+ Socialize.VERSION+ "String_Node_Str"+ Locale.getDefault().getLanguage()+ "String_Node_Str"+ Locale.getDefault().getCountry()+ "String_Node_Str",userAgentString);
}
Program: 177876
Project: 177876
Buggy source:
protected void onViewLoad(){
}

Fixed version (ground truth):
protected void onViewLoad(){
  loaded=true;
}
Program: 177882
Project: 177882
Buggy source:
public void testListComment() throws JSONException {
  robotium.clickOnButton("String_Node_Str");
  robotium.waitForActivity("String_Node_Str",DEFAULT_TIMEOUT_SECONDS);
  JSONObject json=getJSON("String_Node_Str");
  JSONArray jsonArray=json.getJSONArray("String_Node_Str");
  robotium.enterText(0,DEFAULT_GET_ENTITY);
  robotium.clickOnButton("String_Node_Str");
  robotium.waitForActivity("String_Node_Str",DEFAULT_TIMEOUT_SECONDS);
  robotium.waitForView(ListView.class);
  ListView comments=(ListView)robotium.getCurrentActivity().findViewById(R.id.list);
  assertEquals(jsonArray.length(),comments.getCount());
  robotium.clickInList(0);
  waitForSuccess();
  sleep(2000);
  TextView txt=(TextView)robotium.getCurrentActivity().findViewById(com.socialize.sample.R.id.txtCommentId);
  assertNotNull(txt);
  String value=txt.getText().toString();
  Integer.parseInt(value);
}

Fixed version (ground truth):
public void testListComment() throws JSONException {
  robotium.clickOnButton("String_Node_Str");
  robotium.waitForActivity("String_Node_Str",DEFAULT_TIMEOUT_SECONDS);
  robotium.enterText(0,DEFAULT_GET_ENTITY);
  robotium.clickOnButton("String_Node_Str");
  robotium.waitForActivity("String_Node_Str",DEFAULT_TIMEOUT_SECONDS);
  robotium.waitForView(ListView.class);
  ListView comments=(ListView)robotium.getCurrentActivity().findViewById(R.id.list);
  assertEquals(10,comments.getCount());
  robotium.clickInList(0);
  waitForSuccess();
  sleep(2000);
  TextView txt=(TextView)robotium.getCurrentActivity().findViewById(com.socialize.sample.R.id.txtCommentId);
  assertNotNull(txt);
  String value=txt.getText().toString();
  Integer.parseInt(value);
}
Program: 177883
Project: 177883
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  String consumerKey="String_Node_Str";
  String consumerSecret="String_Node_Str";
  SocializeUI.getInstance().setAppCredentials(this,consumerKey,consumerSecret);
  SocializeUI.getInstance().setEntityUrl(this,"String_Node_Str");
  this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.main);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  String consumerKey="String_Node_Str";
  String consumerSecret="String_Node_Str";
  this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  SocializeUI.getInstance().setAppCredentials(this,consumerKey,consumerSecret);
  SocializeUI.getInstance().setEntityUrl(this,"String_Node_Str");
  setContentView(R.layout.main);
}
Program: 177884
Project: 177884
Buggy source:
@Override protected void onPostSocializeInit(IOCContainer container){
  SocializeUI.getInstance().initUI(container);
  consumerKey=Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY);
  consumerSecret=Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET);
  fbAppId=Socialize.getSocialize().getConfig().getProperty(SocializeConfig.FACEBOOK_APP_ID);
}

Fixed version (ground truth):
@Override protected void onPostSocializeInit(IOCContainer container){
  SocializeUI.getInstance().initUI(container);
  consumerKey=SocializeUI.getInstance().getGlobalConfigValue(getContext(),SocializeConfig.SOCIALIZE_CONSUMER_KEY);
  consumerSecret=SocializeUI.getInstance().getGlobalConfigValue(getContext(),SocializeConfig.SOCIALIZE_CONSUMER_SECRET);
  fbAppId=SocializeUI.getInstance().getGlobalConfigValue(getContext(),SocializeConfig.FACEBOOK_APP_ID);
}
Program: 177885
Project: 177885
Buggy source:
/** 
 * Sets the credentials for your Socialize App.
 * @param context The current activity
 * @param consumerKey Your consumer key, obtained via registration at http://getsocialize.com
 * @param consumerSecret Your consumer secret, obtained via registration at http://getsocialize.com
 */
public void setAppCredentials(Context context,String consumerKey,String consumerSecret){
  assertSocializeInitialized(context);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY,consumerKey);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET,consumerSecret);
}

Fixed version (ground truth):
/** 
 * Sets the credentials for your Socialize App.
 * @param context The current activity
 * @param consumerKey Your consumer key, obtained via registration at http://getsocialize.com
 * @param consumerSecret Your consumer secret, obtained via registration at http://getsocialize.com
 */
public void setAppCredentials(Context context,String consumerKey,String consumerSecret){
  SharedPreferences prefs=context.getSharedPreferences(CONFIG_KEY,Context.MODE_PRIVATE);
  Editor editor=prefs.edit();
  editor.putString(SocializeConfig.SOCIALIZE_CONSUMER_KEY,consumerKey);
  editor.putString(SocializeConfig.SOCIALIZE_CONSUMER_SECRET,consumerSecret);
  editor.commit();
}
Program: 177886
Project: 177886
Buggy source:
/** 
 * Sets the FB credentials for the current user if available.
 * @param context The current activity
 * @param userId
 * @param token
 */
public void setFacebookUserCredentials(Activity context,String userId,String token){
  assertSocializeInitialized(context);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_ID,userId);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_TOKEN,token);
}

Fixed version (ground truth):
/** 
 * Sets the FB credentials for the current user if available.
 * @param context The current activity
 * @param userId
 * @param token
 */
public void setFacebookUserCredentials(Context context,String userId,String token){
  SharedPreferences prefs=context.getSharedPreferences(CONFIG_KEY,Context.MODE_PRIVATE);
  Editor editor=prefs.edit();
  editor.putString(SocializeConfig.FACEBOOK_USER_ID,userId);
  editor.putString(SocializeConfig.FACEBOOK_USER_TOKEN,token);
  editor.commit();
}
Program: 177889
Project: 177889
Buggy source:
@Override public void onClick(View v){
  final String text=editText.getText().toString();
  if (!StringUtils.isEmpty(text)) {
    imm.hideSoftInputFromWindow(editText.getWindowToken(),0);
    if (!Socialize.getSocialize().isAuthenticated()) {
      Socialize.getSocialize().authenticate(Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY),Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET),new SocializeAuthListener(){
        @Override public void onError(        SocializeException error){
          showError(context,error.getMessage());
        }
        @Override public void onAuthSuccess(        SocializeSession session){
          doPostComment(text);
        }
        @Override public void onAuthFail(        SocializeException error){
          showError(context,error.getMessage());
        }
      }
);
    }
 else {
      doPostComment(text);
    }
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  final String text=editText.getText().toString();
  if (!StringUtils.isEmpty(text)) {
    imm.hideSoftInputFromWindow(editText.getWindowToken(),0);
    if (!Socialize.getSocialize().isAuthenticated()) {
      Socialize.getSocialize().authenticate(consumerKey,consumerSecret,new SocializeAuthListener(){
        @Override public void onError(        SocializeException error){
          showError(context,error.getMessage());
        }
        @Override public void onAuthSuccess(        SocializeSession session){
          doPostComment(text);
        }
        @Override public void onAuthFail(        SocializeException error){
          showError(context,error.getMessage());
        }
      }
);
    }
 else {
      doPostComment(text);
    }
  }
}
Program: 177891
Project: 177891
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (!Socialize.getSocialize().isInitialized()) {
    Socialize.init(this);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Socialize.init(this);
}
Program: 177892
Project: 177892
Buggy source:
/** 
 * Returns true if this SocializeService instance has been initialized.
 * @return
 */
public boolean isInitialized();

Fixed version (ground truth):
/** 
 * Returns true if this SocializeService instance has been initialized.
 * @return
 * @deprecated init should always be called! 
 */
@Deprecated public boolean isInitialized();
Program: 177893
Project: 177893
Buggy source:
private IOCContainer initInternal(Context context,String... paths) throws Exception {
  boolean init=false;
  if (isInitialized()) {
    for (    String path : paths) {
      if (Arrays.binarySearch(initPaths,path) < 0) {
        if (logger != null) {
          logger.info("String_Node_Str" + path + "String_Node_Str");
        }
        this.initCount=0;
        destroy();
        init=true;
        break;
      }
    }
  }
 else {
    init=true;
  }
  if (init) {
    try {
      initPaths=paths;
      Arrays.sort(initPaths);
      SocializeIOC container=new SocializeIOC();
      ResourceLocator locator=new ResourceLocator();
      ClassLoaderProvider provider=new ClassLoaderProvider();
      locator.setClassLoaderProvider(provider);
      container.init(context,locator,paths);
      init(context,container);
    }
 catch (    Exception e) {
      throw e;
    }
  }
 else {
    this.initCount++;
  }
  return container;
}

Fixed version (ground truth):
private IOCContainer initInternal(Context context,String... paths) throws Exception {
  boolean init=false;
  if (isInitialized()) {
    for (    String path : paths) {
      if (Arrays.binarySearch(initPaths,path) < 0) {
        if (logger != null) {
          logger.info("String_Node_Str" + path + "String_Node_Str");
        }
        this.initCount=0;
        destroy();
        init=true;
        break;
      }
    }
  }
 else {
    init=true;
  }
  if (init) {
    try {
      initPaths=paths;
      Arrays.sort(initPaths);
      SocializeIOC container=new SocializeIOC();
      ResourceLocator locator=new ResourceLocator();
      ClassLoaderProvider provider=new ClassLoaderProvider();
      locator.setClassLoaderProvider(provider);
      container.init(context,locator,paths);
      init(context,container);
    }
 catch (    Exception e) {
      throw e;
    }
  }
 else {
    this.initCount++;
  }
  if (container != null) {
    container.setContext(context);
  }
  return container;
}
Program: 177894
Project: 177894
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  service.onActivityResult(requestCode,resultCode,data);
  finish();
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  service.onActivityResult(requestCode,resultCode,data);
}
Program: 177895
Project: 177895
Buggy source:
@Override public void onPageFinished(WebView view,String url){
  super.onPageFinished(view,url);
  String title=mWebView.getTitle();
  if (title != null && title.length() > 0) {
    mTitle.setText(title);
  }
  mSpinner.dismiss();
}

Fixed version (ground truth):
@Override public void onPageFinished(WebView view,String url){
  super.onPageFinished(view,url);
  String title=mWebView.getTitle();
  if (title != null && title.length() > 0) {
    mTitle.setText(title);
  }
  try {
    mSpinner.dismiss();
  }
 catch (  Exception ignore) {
  }
}
Program: 177896
Project: 177896
Buggy source:
@Override public void onError(SocializeException error){
  onAfterAuthenticate();
  showError(context,error.getMessage());
  error.printStackTrace();
}

Fixed version (ground truth):
@Override public void onError(SocializeException error){
  onAfterAuthenticate();
  showError(getContext(),error.getMessage());
  error.printStackTrace();
}
Program: 177897
Project: 177897
Buggy source:
@Override public void onAuthFail(SocializeException error){
  onAfterAuthenticate();
  showError(context,error.getMessage());
  error.printStackTrace();
}

Fixed version (ground truth):
@Override public void onAuthFail(SocializeException error){
  onAfterAuthenticate();
  showError(getContext(),error.getMessage());
  error.printStackTrace();
}
Program: 177898
Project: 177898
Buggy source:
@Override protected void initSocialize(){
  SocializeUI.getInstance().initSocialize(context);
}

Fixed version (ground truth):
@Override protected void initSocialize(){
  SocializeUI.getInstance().initSocialize(getContext());
}
Program: 177899
Project: 177899
Buggy source:
protected Bundle getBundle(){
  Bundle bundle=null;
  if (context instanceof Activity) {
    Activity a=(Activity)context;
    bundle=a.getIntent().getExtras();
  }
  return bundle;
}

Fixed version (ground truth):
protected Bundle getBundle(){
  Bundle bundle=null;
  Context context=getContext();
  if (context instanceof Activity) {
    Activity a=(Activity)context;
    bundle=a.getIntent().getExtras();
  }
  return bundle;
}
Program: 177900
Project: 177900
Buggy source:
/** 
 * Sets the credentials for your Socialize App.
 * @param context The current activity
 * @param consumerKey Your consumer key, obtained via registration at http://getsocialize.com
 * @param consumerSecret Your consumer secret, obtained via registration at http://getsocialize.com
 */
public void setAppCredentials(Context context,String consumerKey,String consumerSecret){
  if (!Socialize.getSocialize().isInitialized()) {
    initSocialize(context);
  }
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY,consumerKey);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET,consumerSecret);
}

Fixed version (ground truth):
/** 
 * Sets the credentials for your Socialize App.
 * @param context The current activity
 * @param consumerKey Your consumer key, obtained via registration at http://getsocialize.com
 * @param consumerSecret Your consumer secret, obtained via registration at http://getsocialize.com
 */
public void setAppCredentials(Context context,String consumerKey,String consumerSecret){
  assertSocializeInitialized(context);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY,consumerKey);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET,consumerSecret);
}
Program: 177901
Project: 177901
Buggy source:
/** 
 * Sets the Facebook ID for FB authentication.   This is optional.  If not specified the default Socialize FB app will be used.
 * @param context
 * @param appId Your Facebook App Id, obtained from https://developers.facebook.com/
 * @see https://developers.facebook.com/
 */
public void setFacebookAppId(Context context,String appId){
  if (!Socialize.getSocialize().isInitialized()) {
    initSocialize(context);
  }
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_APP_ID,appId);
}

Fixed version (ground truth):
/** 
 * Sets the Facebook ID for FB authentication.   This is optional.  If not specified the default Socialize FB app will be used.
 * @param context
 * @param appId Your Facebook App Id, obtained from https://developers.facebook.com/
 * @see https://developers.facebook.com/
 */
public void setFacebookAppId(Context context,String appId){
  assertSocializeInitialized(context);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_APP_ID,appId);
}
Program: 177902
Project: 177902
Buggy source:
/** 
 * Sets the FB credentials for the current user if available.
 * @param context The current activity
 * @param userId
 * @param token
 */
public void setFacebookUserCredentials(Activity context,String userId,String token){
  if (!Socialize.getSocialize().isInitialized()) {
    initSocialize(context);
  }
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_ID,userId);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_TOKEN,token);
}

Fixed version (ground truth):
/** 
 * Sets the FB credentials for the current user if available.
 * @param context The current activity
 * @param userId
 * @param token
 */
public void setFacebookUserCredentials(Activity context,String userId,String token){
  assertSocializeInitialized(context);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_ID,userId);
  Socialize.getSocialize().getConfig().setProperty(SocializeConfig.FACEBOOK_USER_TOKEN,token);
}
Program: 177903
Project: 177903
Buggy source:
public SocializeView(Context context){
  super(context);
  this.context=context;
}

Fixed version (ground truth):
public SocializeView(Context context){
  super(context);
}
Program: 177904
Project: 177904
Buggy source:
public ProgressDialog show(Context context,String title,String message){
  try {
    ProgressDialog dialog=new ProgressDialog(context);
    dialog.setTitle("String_Node_Str");
    dialog.setMessage("String_Node_Str");
    dialog.show();
    return dialog;
  }
 catch (  Exception e) {
    if (logger != null) {
      logger.error("String_Node_Str",e);
    }
 else {
      e.printStackTrace();
    }
    return null;
  }
}

Fixed version (ground truth):
public ProgressDialog show(Context context,String title,String message){
  try {
    if (context instanceof Activity) {
      Activity activity=(Activity)context;
      while (activity.getParent() != null) {
        activity=activity.getParent();
      }
      context=activity;
    }
    ProgressDialog dialog=new ProgressDialog(context);
    dialog.setTitle("String_Node_Str");
    dialog.setMessage("String_Node_Str");
    dialog.show();
    return dialog;
  }
 catch (  Exception e) {
    if (logger != null) {
      logger.error("String_Node_Str",e);
    }
 else {
      e.printStackTrace();
    }
    return null;
  }
}
Program: 177905
Project: 177905
Buggy source:
@Override protected void onBeforeSocializeInit(){
  progress=ProgressDialog.show(context,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override protected void onBeforeSocializeInit(){
  progress=ProgressDialog.show(getContext(),"String_Node_Str","String_Node_Str");
}
Program: 177907
Project: 177907
Buggy source:
public void doPostComment(String comment){
  dialog=progressDialogFactory.show(context,"String_Node_Str","String_Node_Str");
  Socialize.getSocialize().addComment(entityKey,comment,new CommentAddListener(){
    @Override public void onError(    SocializeException error){
      showError(getContext(),error.getMessage());
      dialog.dismiss();
    }
    @Override public void onCreate(    Comment entity){
      doListComments();
    }
  }
);
}

Fixed version (ground truth):
public void doPostComment(String comment){
  dialog=progressDialogFactory.show(getContext(),"String_Node_Str","String_Node_Str");
  Socialize.getSocialize().addComment(entityKey,comment,new CommentAddListener(){
    @Override public void onError(    SocializeException error){
      showError(getContext(),error.getMessage());
      dialog.dismiss();
    }
    @Override public void onCreate(    Comment entity){
      doListComments();
    }
  }
);
}
Program: 177908
Project: 177908
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  if (Socialize.getSocialize().isInitialized()) {
    if (Socialize.getSocialize().isAuthenticated()) {
      doListComments();
    }
 else {
      showError(getContext(),"String_Node_Str");
      flipper.setDisplayedChild(1);
    }
  }
 else {
    showError(getContext(),"String_Node_Str");
    flipper.setDisplayedChild(1);
  }
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  if (Socialize.getSocialize().isAuthenticated()) {
    doListComments();
  }
 else {
    showError(getContext(),"String_Node_Str");
    flipper.setDisplayedChild(1);
  }
}
Program: 177909
Project: 177909
Buggy source:
public void getAllComments(SocializeSession session,String key,CommentListener listener){
  super.listAsync(session,endpoint,key,listener);
}

Fixed version (ground truth):
public void getAllComments(SocializeSession session,String key,CommentListener listener){
  super.listAsync(session,ENDPOINT,key,listener);
}
Program: 177910
Project: 177910
Buggy source:
public void addComment(SocializeSession session,String key,String comment,CommentListener listener){
  Comment c=new Comment();
  c.setText(comment);
  super.putAsync(session,endpoint,c,listener);
}

Fixed version (ground truth):
public void addComment(SocializeSession session,String key,String comment,CommentListener listener){
  Comment c=new Comment();
  c.setText(comment);
  super.putAsync(session,ENDPOINT,c,listener);
}
Program: 177912
Project: 177912
Buggy source:
public void testFromJSON() throws JSONException, ParseException {
  AndroidMock.expect(factoryService.getFactoryFor(Application.class)).andReturn(appFactoryMock);
  AndroidMock.expect(factoryService.getFactoryFor(User.class)).andReturn(userFactoryMock);
  AndroidMock.expect(factoryService.getFactoryFor(Entity.class)).andReturn(entityFactoryMock);
  AndroidMock.expect(appFactoryMock.fromJSON(json)).andReturn(application);
  AndroidMock.expect(userFactoryMock.fromJSON(json)).andReturn(user);
  AndroidMock.expect(entityFactoryMock.fromJSON(json)).andReturn(entity);
  action.setApplication(application);
  action.setUser(user);
  action.setEntity(entity);
  AndroidMock.expect((float)json.getDouble("String_Node_Str")).andReturn(lat);
  AndroidMock.expect((float)json.getDouble("String_Node_Str")).andReturn(lon);
  AndroidMock.expect(json.getString("String_Node_Str")).andReturn(SocializeObjectFactory.UTC_FORMAT.format(date));
  AndroidMock.replay(factoryService);
  AndroidMock.replay(appFactoryMock);
  AndroidMock.replay(userFactoryMock);
  AndroidMock.replay(entityFactoryMock);
  setupFromJSONExpectations();
  factory.fromJSON(json);
  doFromJSONVerify();
}

Fixed version (ground truth):
public void testFromJSON() throws JSONException, ParseException {
  AndroidMock.expect(factoryService.getFactoryFor(Application.class)).andReturn(appFactoryMock);
  AndroidMock.expect(factoryService.getFactoryFor(User.class)).andReturn(userFactoryMock);
  AndroidMock.expect(factoryService.getFactoryFor(Entity.class)).andReturn(entityFactoryMock);
  AndroidMock.expect(appFactoryMock.fromJSON(json)).andReturn(application);
  AndroidMock.expect(userFactoryMock.fromJSON(json)).andReturn(user);
  AndroidMock.expect(entityFactoryMock.fromJSON(json)).andReturn(entity);
  action.setApplication(application);
  action.setUser(user);
  action.setEntity(entity);
  AndroidMock.expect((float)json.getDouble("String_Node_Str")).andReturn(lat);
  AndroidMock.expect((float)json.getDouble("String_Node_Str")).andReturn(lon);
  AndroidMock.expect(json.getString("String_Node_Str")).andReturn(UTC_FORMAT.format(date));
  AndroidMock.replay(factoryService);
  AndroidMock.replay(appFactoryMock);
  AndroidMock.replay(userFactoryMock);
  AndroidMock.replay(entityFactoryMock);
  setupFromJSONExpectations();
  factory.fromJSON(json);
  doFromJSONVerify();
}
Program: 177915
Project: 177915
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T populatePojo(T pojo,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojo.getClass(),0);
  final Map<String,Type> typeArgsMap=new HashMap<String,Type>();
  Type[] genericTypeArgsExtra=TypeManufacturerUtil.fillTypeArgMap(typeArgsMap,pojo.getClass(),genericTypeArgs);
  try {
    List<Annotation> annotations=null;
    return this.populatePojoInternal(pojo,annotations,manufacturingCtx,typeArgsMap,genericTypeArgsExtra);
  }
 catch (  InstantiationException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  IllegalAccessException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  InvocationTargetException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  ClassNotFoundException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T populatePojo(T pojo,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojo.getClass(),1);
  final Map<String,Type> typeArgsMap=new HashMap<String,Type>();
  Type[] genericTypeArgsExtra=TypeManufacturerUtil.fillTypeArgMap(typeArgsMap,pojo.getClass(),genericTypeArgs);
  try {
    List<Annotation> annotations=null;
    return this.populatePojoInternal(pojo,annotations,manufacturingCtx,typeArgsMap,genericTypeArgsExtra);
  }
 catch (  InstantiationException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  IllegalAccessException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  InvocationTargetException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
catch (  ClassNotFoundException e) {
    throw new PodamMockeryException(e.getMessage(),e);
  }
}
Program: 177916
Project: 177916
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojoWithFullData(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,0);
  manufacturingCtx.setConstructorOrdering(Order.HEAVY_FIRST);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojoWithFullData(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,1);
  manufacturingCtx.setConstructorOrdering(Order.HEAVY_FIRST);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}
Program: 177918
Project: 177918
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojo(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,0);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T>T manufacturePojo(Class<T> pojoClass,Type... genericTypeArgs){
  ManufacturingContext manufacturingCtx=new ManufacturingContext();
  manufacturingCtx.getPojos().put(pojoClass,1);
  return doManufacturePojo(pojoClass,manufacturingCtx,genericTypeArgs);
}
Program: 177919
Project: 177919
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int getMaxDepth(Class<?> type){
  return -1;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int getMaxDepth(Class<?> type){
  return 1;
}
Program: 177920
Project: 177920
Buggy source:
private void createPojoWithCircularDependencies(PodamFactory podamFactory) throws Exception {
  Parent parent=podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class,podamFactory);
  int depth=0;
  while (null != parent) {
    podamValidationSteps.thePojoMustBeOfTheType(parent,Parent.class);
    Child child=parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child,Child.class);
    parent=child.getParent();
    depth++;
  }
  podamValidationSteps.theIntFieldShouldHaveThePreciseValueOf(depth,podamFactory.getStrategy().getMaxDepth(Parent.class) + 2);
}

Fixed version (ground truth):
private void createPojoWithCircularDependencies(PodamFactory podamFactory) throws Exception {
  Parent parent=podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class,podamFactory);
  int depth=0;
  while (null != parent) {
    podamValidationSteps.thePojoMustBeOfTheType(parent,Parent.class);
    Child child=parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child,Child.class);
    parent=child.getParent();
    depth++;
  }
  podamValidationSteps.theIntFieldShouldHaveThePreciseValueOf(depth,podamFactory.getStrategy().getMaxDepth(Parent.class));
}
Program: 177930
Project: 177930
Buggy source:
/** 
 * It returns a   {@link Field} matching the attribute name or null if a fieldwas not found.
 * @param pojoClass The class supposed to contain the field
 * @param attributeName The field name
 * @return a {@link Field} matching the attribute name or null if a fieldwas not found.
 */
public static Field getField(Class<?> pojoClass,String attributeName){
  Field field=null;
  Class<?> clazz=pojoClass;
  while (clazz != null) {
    try {
      field=clazz.getDeclaredField(attributeName);
      break;
    }
 catch (    NoSuchFieldException e) {
      clazz=clazz.getSuperclass();
    }
  }
  if (field == null) {
    LOG.warn("String_Node_Str",pojoClass,attributeName);
  }
  return field;
}

Fixed version (ground truth):
/** 
 * It returns a   {@link Field} matching the attribute name or null if a fieldwas not found.
 * @param pojoClass The class supposed to contain the field
 * @param attributeName The field name
 * @return a {@link Field} matching the attribute name or null if a fieldwas not found.
 */
public static Field getField(Class<?> pojoClass,String attributeName){
  Class<?> clazz=pojoClass;
  while (clazz != null) {
    try {
      return clazz.getDeclaredField(attributeName);
    }
 catch (    NoSuchFieldException e) {
      clazz=clazz.getSuperclass();
    }
  }
  LOG.warn("String_Node_Str",pojoClass,attributeName);
  return null;
}
Program: 177931
Project: 177931
Buggy source:
private void log(AttributeMetadata attributeMetadata){
  LOG.trace("String_Node_Str",attributeMetadata.getPojoClass().getName(),attributeMetadata.getAttributeName() != null ? attributeMetadata.getAttributeName() : "String_Node_Str");
}

Fixed version (ground truth):
private void log(AttributeMetadata attributeMetadata){
  LOG.trace("String_Node_Str",attributeMetadata.getPojoClass() != null ? attributeMetadata.getPojoClass().getName() : "String_Node_Str",attributeMetadata.getAttributeName() != null ? attributeMetadata.getAttributeName() : "String_Node_Str");
}