[Demonstration 1]

[Buggy Method]
private void showErrorMessage(String title, String message) {
    AlertDialog alert = new AlertDialog.Builder(RemoteCameraApi.this).create();
    alert.setTitle(title);
    alert.setMessage(message);
    alert.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
        }
    });
    alert.show();
}

[Buggy Hunk]
AlertDialog alert = new AlertDialog.Builder(RemoteCameraApi.this)

[Patch]
AlertDialog alert = new AlertDialog.Builder(this)

[Demonstration 2]

[Buggy Method]
public static void All(String collectionName, ValueEventListener valueEventListener) {
    DatabaseReference artistsRef = FirebaseDatabase.getInstance().getReference(collectionName);
    artistsRef.addValueEventListener(valueEventListener);
}

[Buggy Hunk]
artistsRef.addValueEventListener(valueEventListener);

[Patch]
artistsRef.addListenerForSingleValueEvent(valueEventListener);

[Demonstration 3]

[Buggy Method]
private ImageButton makePlusButton(final int row, final ClanMember member) {
    // Create the button
    //Drawable plus = getResources().getDrawable(R.drawable.add);
    //plus.setBounds(0, 0, (int) (plus.getIntrinsicWidth() * 0.8),
    //        (int) (plus.getIntrinsicHeight() * 0.8));
    //ScaleDrawable sd = new ScaleDrawable(plus, Gravity.RIGHT, 1f, .8f);
    ImageButton plusButton = new ImageButton(this);
    plusButton.setImageResource(R.drawable.add);
    plusButton.setLayoutParams(new TableRow.LayoutParams(110, TableRow.LayoutParams.WRAP_CONTENT));
    //plusButton.setGravity(Gravity.RIGHT|Gravity.CENTER_VERTICAL);
    //plusButton.setCompoundDrawables(sd.getDrawable(), null, null, null);
    //plusButton.setWidth(10);
    // Add the listener and alertdialog popup
    plusButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final EditText input = new EditText(ShowWarActivity.this);
            input.setHint("Your Name");
            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
            input.setLayoutParams(lp);
            AlertDialog.Builder alert = new AlertDialog.Builder(ShowWarActivity.this).setTitle("Call Target #" + (row + 1)).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    String name = input.getText().toString();
                    // Name cannot be empty
                    if (name != null && !name.isEmpty()) {
                        // Call the api
                        appendCall(clanInfo.getGeneral().getWarcode(), String.valueOf(row), name);
                        // Set the new player name
                        ClanMember mem = new ClanMember();
                        mem.setPlayername(name);
                        mem.setPosy(row);
                        if (member != null) {
                            // Find the table row for the call number
                            TableRow rowL = (TableRow) callLayout.findViewWithTag(member);
                            int index = callLayout.indexOfChild(rowL);
                            // Set the member index to the last for that call number
                            mem.setPosx(getLastMemberIndex(index));
                            // Add to the clan view
                            Log.d(SHOWTAG, "row: " + index + " New Row: " + getLastMemberIndex(index));
                            callLayout.addView(getMembersLayout(index, mem), index + getLastMemberIndex(index));
                        } else {
                            // Find the table row
                            TableRow rowL = (TableRow) callLayout.findViewWithTag(row);
                            int index = callLayout.indexOfChild(rowL);
                            mem.setPosx(0);
                            // Add to the clan view
                            callLayout.removeView(rowL);
                            callLayout.addView(getMembersLayout(row, mem), index);
                        }
                        // Add the clan member to the clan array
                        clanInfo.addClanMember(mem);
                    } else {
                        Toast.makeText(ShowWarActivity.this, "Please enter a valid name!", Toast.LENGTH_SHORT);
                    }
                    // TODO might need to refresh the log after this is called
                }
            }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // do nothing
                }
            });
            alert.setView(input);
            alert.show();
        }
    });
    return plusButton;
}

[Buggy Hunk]
plusButton.setLayoutParams(new TableRow.LayoutParams(110, TableRow.LayoutParams.WRAP_CONTENT));

[Patch]
plusButton.setLayoutParams(new TableRow.LayoutParams(PLUS_WIDTH, TableRow.LayoutParams.WRAP_CONTENT));