Program: 177890
Project: 177890
Buggy source:
public CommentListView(final Context context,final CommentAdapter provider,final DeviceUtils deviceUtils,final Drawables drawables,final Colors colors,final String entityKey){
  super(context);
  this.provider=provider;
  this.entityKey=entityKey;
  this.drawables=drawables;
  this.colors=colors;
  int four=deviceUtils.getDIP(4);
  int eight=deviceUtils.getDIP(8);
  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);
  setBackgroundDrawable(drawables.getDrawable("String_Node_Str",true,true,true));
  setPadding(0,0,0,0);
  setVerticalFadingEdgeEnabled(false);
  LinearLayout titlePanel=new LinearLayout(context);
  LayoutParams titlePanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titlePanelLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titlePanel.setLayoutParams(titlePanelLayoutParams);
  titlePanel.setOrientation(LinearLayout.HORIZONTAL);
  titlePanel.setPadding(four,four,four,four);
  titlePanel.setBackgroundDrawable(drawables.getDrawable("String_Node_Str",true,false,true));
  titleText=new TextView(context);
  titleText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,20);
  titleText.setTextColor(colors.getColor(Colors.HEADER));
  titleText.setText("String_Node_Str");
  titleText.setPadding(0,0,0,deviceUtils.getDIP(2));
  LayoutParams titleTextLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titleTextLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titleText.setLayoutParams(titleTextLayoutParams);
  ImageView titleImage=new ImageView(context);
  titleImage.setImageDrawable(drawables.getDrawable("String_Node_Str",true));
  titleImage.setPadding(0,0,0,0);
  LayoutParams titleImageLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titleImageLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titleImageLayoutParams.setMargins(four,0,four,0);
  titleImage.setLayoutParams(titleImageLayoutParams);
  titlePanel.addView(titleImage);
  titlePanel.addView(titleText);
  LinearLayout editPanel=new LinearLayout(context);
  LayoutParams editPanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editPanelLayoutParams.setMargins(eight,eight,eight,eight);
  editPanel.setLayoutParams(editPanelLayoutParams);
  editPanel.setOrientation(LinearLayout.HORIZONTAL);
  editPanel.setPadding(0,0,0,0);
  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.setMinHeight(deviceUtils.getDIP(42));
  editText.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
  editText.setGravity(Gravity.TOP);
  editText.setVerticalScrollBarEnabled(true);
  editText.setVerticalFadingEdgeEnabled(true);
  editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,16);
  editText.setBackgroundColor(colors.getColor(Colors.TEXT_BG));
  editText.setHint("String_Node_Str");
  editText.setLayoutParams(editTextLayoutParams);
  LinearLayout.LayoutParams buttonLayoutParams=new LinearLayout.LayoutParams(deviceUtils.getDIP(42),deviceUtils.getDIP(42));
  buttonLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.TOP;
  int bottom=colors.getColor(Colors.BUTTON_BOTTOM);
  int top=colors.getColor(Colors.BUTTON_TOP);
  button=new ImageButton(context);
  button.setImageDrawable(drawables.getDrawable("String_Node_Str",true));
  GradientDrawable foreground=new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,new int[]{bottom,top});
  button.setBackgroundDrawable(foreground);
  button.setLayoutParams(buttonLayoutParams);
  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()) {
          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);
        }
      }
    }
  }
);
  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.setCacheColorHint(0);
  listView.setDividerHeight(2);
  listView.setSmoothScrollbarEnabled(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) {
        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.progressBarStyleSmall);
  progress.setLayoutParams(progressLayoutParams);
  loadingScreen.addView(progress);
  flipper.addView(loadingScreen);
  flipper.addView(contentView);
  flipper.setDisplayedChild(0);
  addView(titlePanel);
  addView(editPanel);
  addView(flipper);
}

Fixed version (ground truth):
public CommentListView(final Context context,final CommentAdapter provider,final DeviceUtils deviceUtils,final Drawables drawables,final Colors colors,final String entityKey){
  super(context);
  this.provider=provider;
  this.entityKey=entityKey;
  this.drawables=drawables;
  this.colors=colors;
  int four=deviceUtils.getDIP(4);
  int eight=deviceUtils.getDIP(8);
  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);
  setBackgroundDrawable(drawables.getDrawable("String_Node_Str",true,true,true));
  setPadding(0,0,0,0);
  setVerticalFadingEdgeEnabled(false);
  LinearLayout titlePanel=new LinearLayout(context);
  LayoutParams titlePanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titlePanelLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titlePanel.setLayoutParams(titlePanelLayoutParams);
  titlePanel.setOrientation(LinearLayout.HORIZONTAL);
  titlePanel.setPadding(four,four,four,four);
  titlePanel.setBackgroundDrawable(drawables.getDrawable("String_Node_Str",true,false,true));
  titleText=new TextView(context);
  titleText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,20);
  titleText.setTextColor(colors.getColor(Colors.HEADER));
  titleText.setText("String_Node_Str");
  titleText.setPadding(0,0,0,deviceUtils.getDIP(2));
  LayoutParams titleTextLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titleTextLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titleText.setLayoutParams(titleTextLayoutParams);
  ImageView titleImage=new ImageView(context);
  titleImage.setImageDrawable(drawables.getDrawable("String_Node_Str",true));
  titleImage.setPadding(0,0,0,0);
  LayoutParams titleImageLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  titleImageLayoutParams.gravity=Gravity.CENTER_VERTICAL;
  titleImageLayoutParams.setMargins(four,0,four,0);
  titleImage.setLayoutParams(titleImageLayoutParams);
  titlePanel.addView(titleImage);
  titlePanel.addView(titleText);
  LinearLayout editPanel=new LinearLayout(context);
  LayoutParams editPanelLayoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  editPanelLayoutParams.setMargins(eight,eight,eight,eight);
  editPanel.setLayoutParams(editPanelLayoutParams);
  editPanel.setOrientation(LinearLayout.HORIZONTAL);
  editPanel.setPadding(0,0,0,0);
  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.setMinHeight(deviceUtils.getDIP(42));
  editText.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
  editText.setGravity(Gravity.TOP);
  editText.setVerticalScrollBarEnabled(true);
  editText.setVerticalFadingEdgeEnabled(true);
  editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP,16);
  editText.setBackgroundColor(colors.getColor(Colors.TEXT_BG));
  editText.setHint("String_Node_Str");
  editText.setLayoutParams(editTextLayoutParams);
  LinearLayout.LayoutParams buttonLayoutParams=new LinearLayout.LayoutParams(deviceUtils.getDIP(42),deviceUtils.getDIP(42));
  buttonLayoutParams.gravity=Gravity.CENTER_HORIZONTAL | Gravity.TOP;
  int bottom=colors.getColor(Colors.BUTTON_BOTTOM);
  int top=colors.getColor(Colors.BUTTON_TOP);
  button=new ImageButton(context);
  button.setImageDrawable(drawables.getDrawable("String_Node_Str",true));
  GradientDrawable foreground=new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,new int[]{bottom,top});
  button.setBackgroundDrawable(foreground);
  button.setLayoutParams(buttonLayoutParams);
  final String consumerKey=SocializeUI.getInstance().getGlobalConfigValue(getContext(),SocializeConfig.SOCIALIZE_CONSUMER_KEY);
  final String consumerSecret=SocializeUI.getInstance().getGlobalConfigValue(getContext(),SocializeConfig.SOCIALIZE_CONSUMER_SECRET);
  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()) {
          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);
        }
      }
    }
  }
);
  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.setCacheColorHint(0);
  listView.setDividerHeight(2);
  listView.setSmoothScrollbarEnabled(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) {
        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.progressBarStyleSmall);
  progress.setLayoutParams(progressLayoutParams);
  loadingScreen.addView(progress);
  flipper.addView(loadingScreen);
  flipper.addView(contentView);
  flipper.setDisplayedChild(0);
  addView(titlePanel);
  addView(editPanel);
  addView(flipper);
}