Program: 177906
Project: 177906
Buggy source:
public CommentListView(final Context context,final SocializeCommentProvider provider,final DeviceUtils deviceUtils,final String entityKey){
  super(context);
  this.context=context;
  this.provider=provider;
  this.entityKey=entityKey;
  int four=deviceUtils.getDIP(4);
  imm=(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
  LayoutParams fill=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
  setOrientation(LinearLayout.VERTICAL);
  setLayoutParams(fill);
  setBackgroundColor(SocializeUI.STANDARD_BACKGROUND_COLOR);
  LinearLayout editPanel=new LinearLayout(context);
  LayoutParams editPanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editPanelLayoutParams.setMargins(four,four,four,four);
  editPanel.setLayoutParams(editPanelLayoutParams);
  editPanel.setOrientation(LinearLayout.HORIZONTAL);
  LinearLayout.LayoutParams editTextLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editTextLayoutParams.gravity=Gravity.TOP;
  editTextLayoutParams.weight=1.0f;
  editTextLayoutParams.setMargins(0,0,four,0);
  editText=new EditText(context);
  editText.setImeOptions(EditorInfo.IME_ACTION_DONE);
  editText.setMinLines(1);
  editText.setMaxLines(5);
  editText.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
  editText.setGravity(Gravity.TOP);
  editText.setVerticalScrollBarEnabled(true);
  editText.setVerticalFadingEdgeEnabled(true);
  editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,14);
  editText.setBackgroundColor(Color.WHITE);
  editText.setHint("String_Node_Str");
  editText.setLayoutParams(editTextLayoutParams);
  button=new SocializeButton(context,deviceUtils);
  button.setText("String_Node_Str");
  button.setOnClickListener(new OnClickListener(){
    @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(AuthProviderType.FACEBOOK)) {
          Socialize.getSocialize().authenticate(Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY),Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET),AuthProviderType.FACEBOOK,Socialize.getSocialize().getConfig().getProperty(SocializeConfig.FACEBOOK_APP_ID),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);
        }
      }
    }
  }
);
  editPanel.addView(editText);
  editPanel.addView(button);
  LinearLayout contentView=new LinearLayout(context);
  LayoutParams contentViewLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  contentViewLayoutParams.weight=1.0f;
  contentView.setLayoutParams(contentViewLayoutParams);
  contentView.setOrientation(LinearLayout.VERTICAL);
  LayoutParams listViewLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  listViewLayoutParams.weight=1.0f;
  listView=new ListView(context);
  listView.setAdapter(provider);
  listView.setLayoutParams(listViewLayoutParams);
  listView.setDrawingCacheEnabled(true);
  listView.setOnScrollListener(new OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      int lastInScreen=firstVisibleItem + visibleItemCount;
      boolean last=(lastInScreen == totalItemCount);
      if (last && !loading) {
        loading=true;
        getNextSet();
      }
    }
  }
);
  listView.requestFocus();
  contentView.addView(listView);
  flipper=new ViewFlipper(context);
  LayoutParams flipperLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
  flipperLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  flipper.setLayoutParams(flipperLayoutParams);
  FrameLayout loadingScreen=new FrameLayout(context);
  FrameLayout.LayoutParams loadingScreenLayoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,FrameLayout.LayoutParams.FILL_PARENT);
  FrameLayout.LayoutParams progressLayoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT);
  loadingScreenLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  progressLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  loadingScreen.setLayoutParams(loadingScreenLayoutParams);
  ProgressBar progress=new ProgressBar(context,null,android.R.attr.progressBarStyleLarge);
  progress.setLayoutParams(progressLayoutParams);
  loadingScreen.addView(progress);
  flipper.addView(loadingScreen);
  flipper.addView(contentView);
  flipper.setDisplayedChild(0);
  addView(editPanel);
  addView(flipper);
}

Fixed version (ground truth):
public CommentListView(final Context context,final SocializeCommentProvider provider,final DeviceUtils deviceUtils,final String entityKey){
  super(context);
  this.provider=provider;
  this.entityKey=entityKey;
  int four=deviceUtils.getDIP(4);
  imm=(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
  LayoutParams fill=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
  setOrientation(LinearLayout.VERTICAL);
  setLayoutParams(fill);
  setBackgroundColor(SocializeUI.STANDARD_BACKGROUND_COLOR);
  LinearLayout editPanel=new LinearLayout(context);
  LayoutParams editPanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editPanelLayoutParams.setMargins(four,four,four,four);
  editPanel.setLayoutParams(editPanelLayoutParams);
  editPanel.setOrientation(LinearLayout.HORIZONTAL);
  LinearLayout.LayoutParams editTextLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editTextLayoutParams.gravity=Gravity.TOP;
  editTextLayoutParams.weight=1.0f;
  editTextLayoutParams.setMargins(0,0,four,0);
  editText=new EditText(context);
  editText.setImeOptions(EditorInfo.IME_ACTION_DONE);
  editText.setMinLines(1);
  editText.setMaxLines(5);
  editText.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
  editText.setGravity(Gravity.TOP);
  editText.setVerticalScrollBarEnabled(true);
  editText.setVerticalFadingEdgeEnabled(true);
  editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,14);
  editText.setBackgroundColor(Color.WHITE);
  editText.setHint("String_Node_Str");
  editText.setLayoutParams(editTextLayoutParams);
  button=new SocializeButton(context,deviceUtils);
  button.setText("String_Node_Str");
  button.setOnClickListener(new OnClickListener(){
    @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(AuthProviderType.FACEBOOK)) {
          Socialize.getSocialize().authenticate(Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_KEY),Socialize.getSocialize().getConfig().getProperty(SocializeConfig.SOCIALIZE_CONSUMER_SECRET),AuthProviderType.FACEBOOK,Socialize.getSocialize().getConfig().getProperty(SocializeConfig.FACEBOOK_APP_ID),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);
        }
      }
    }
  }
);
  editPanel.addView(editText);
  editPanel.addView(button);
  LinearLayout contentView=new LinearLayout(context);
  LayoutParams contentViewLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  contentViewLayoutParams.weight=1.0f;
  contentView.setLayoutParams(contentViewLayoutParams);
  contentView.setOrientation(LinearLayout.VERTICAL);
  LayoutParams listViewLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  listViewLayoutParams.weight=1.0f;
  listView=new ListView(context);
  listView.setAdapter(provider);
  listView.setLayoutParams(listViewLayoutParams);
  listView.setDrawingCacheEnabled(true);
  listView.setOnScrollListener(new OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      int lastInScreen=firstVisibleItem + visibleItemCount;
      boolean last=(lastInScreen == totalItemCount);
      if (last && !loading) {
        loading=true;
        getNextSet();
      }
    }
  }
);
  listView.requestFocus();
  contentView.addView(listView);
  flipper=new ViewFlipper(context);
  LayoutParams flipperLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
  flipperLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  flipper.setLayoutParams(flipperLayoutParams);
  FrameLayout loadingScreen=new FrameLayout(context);
  FrameLayout.LayoutParams loadingScreenLayoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,FrameLayout.LayoutParams.FILL_PARENT);
  FrameLayout.LayoutParams progressLayoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT);
  loadingScreenLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  progressLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
  loadingScreen.setLayoutParams(loadingScreenLayoutParams);
  ProgressBar progress=new ProgressBar(context,null,android.R.attr.progressBarStyleLarge);
  progress.setLayoutParams(progressLayoutParams);
  loadingScreen.addView(progress);
  flipper.addView(loadingScreen);
  flipper.addView(contentView);
  flipper.setDisplayedChild(0);
  addView(editPanel);
  addView(flipper);
}