[Demonstration 1]

[Buggy Method]
public static String validate(String e) {
    Parser.LPM_COMMANDS pmCmd = Parser.LPM_COMMANDS.valueOf(e.substring(INDICATE_EXECUTION_SUCCESS));
    String errorMsg = "";
    switch(pmCmd) {
        case COUNT_CAPABILITIES_CLASSES:
            if (Parse_and_Execute.command_COUNT_CAPABILITIES_CLASSES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = Parser.LPM_ERRORS.COUNT_CAPABILITIES_CLASSES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_NONE.toString();
            }
            break;
        case SHOW_CAPABILITIES_CLASSES:
            if (Parse_and_Execute.command_SHOW_CAPABILITIES_CLASSES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = Parser.LPM_ERRORS.SHOW_CAPABILITIES_CLASSES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_NONE.toString();
            }
            break;
        case CREATE_CAPABILITIES_CLASS:
            if (Parse_and_Execute.command_CREATE_CAPABILITIES_CLASS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = Parser.LPM_ERRORS.CREATE_CAPABILITIES_CLASS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString();
            }
            break;
        case ADD_CAPABILITIES_CLASS_CAPABILITY:
            if (Parse_and_Execute.command_ADD_CAPABILITIES_CLASS_CAPABILITY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = Parser.LPM_ERRORS.ADD_CAPABILITIES_CLASS_CAPABILITY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString();
            }
            break;
        case SHOW_CAPABILITIES_CLASS_CAPABILITIES:
            if (Parse_and_Execute.command_SHOW_CAPABILITIES_CLASS_CAPABILITIES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_CAPABILITIES_CLASS_CAPABILITIES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case REMOVE_CAPABILITIES_CLASS_CAPABILITY:
            if (Parse_and_Execute.command_REMOVE_CAPABILITIES_CLASS_CAPABILITY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.REMOVE_CAPABILITIES_CLASS_CAPABILITY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString());
            }
            break;
        case COUNT_CAPABILITIES_CLASS_COMPONENTS:
            if (Parse_and_Execute.command_COUNT_CAPABILITIES_CLASS_COMPONENTS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.COUNT_CAPABILITIES_CLASS_COMPONENTS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case SHOW_CAPABILITIES_CLASS_COMPONENTS:
            if (Parse_and_Execute.command_SHOW_CAPABILITIES_CLASS_COMPONENTS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_CAPABILITIES_CLASS_COMPONENTS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case MOVE_COMPONENT_TO_CAPABILITIES_CLASS:
            if (Parse_and_Execute.command_MOVE_COMPONENT_TO_CAPABILITIES_CLASS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.MOVE_COMPONENT_TO_CAPABILITIES_CLASS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString());
            }
            break;
        case COUNT_COMMUNICATIVE_CLASSES:
            if (Parse_and_Execute.command_COUNT_COMMUNICATIVE_CLASSES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.COUNT_COMMUNICATIVE_CLASSES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_NONE.toString());
            }
            break;
        case SHOW_COMMUNICATIVE_CLASSES:
            if (Parse_and_Execute.command_SHOW_COMMUNICATIVE_CLASSES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_COMMUNICATIVE_CLASSES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_NONE.toString());
            }
            break;
        case CREATE_COMMUNICATIVE_CLASS:
            if (Parse_and_Execute.command_CREATE_COMMUNICATIVE_CLASS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.CREATE_COMMUNICATIVE_CLASS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString());
            }
            break;
        case SHOW_COMMUNICATIVE_CLASS_COMPONENTS:
            if (Parse_and_Execute.command_SHOW_COMMUNICATIVE_CLASS_COMPONENTS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_COMMUNICATIVE_CLASS_COMPONENTS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case COUNT_COMMUNICATIVE_CLASS_COMPONENTS:
            if (Parse_and_Execute.command_COUNT_COMMUNICATIVE_CLASS_COMPONENTS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.COUNT_COMMUNICATIVE_CLASS_COMPONENTS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case MOVE_COMPONENT_TO_COMMUNICATIVE_CLASS:
            if (Parse_and_Execute.command_MOVE_COMPONENT_TO_COMMUNICATIVE_CLASS(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.MOVE_COMPONENT_TO_COMMUNICATIVE_CLASS_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_2.toString());
            }
            break;
        case SHOW_COMMUNICATIVE_CLASS_COLLABORATION_POLICIES:
            if (Parse_and_Execute.command_SHOW_COMMUNICATIVE_CLASS_COLLABORATION_POLICIES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_COMMUNICATIVE_CLASS_COLLABORATION_POLICIES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case SHOW_COMMUNICATIVE_CLASS_COORDINATION_POLICIES:
            if (Parse_and_Execute.command_SHOW_COMMUNICATIVE_CLASS_COORDINATION_POLICIES(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.SHOW_COMMUNICATIVE_CLASS_COORDINATION_POLICIES_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_1.toString());
            }
            break;
        case ADD_COMMUNICATIVE_CLASS_COLLABORATION_POLICY:
            if (Parse_and_Execute.command_ADD_COMMUNICATIVE_CLASS_COLLABORATION_POLICY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.ADD_COMMUNICATIVE_CLASS_COLLABORATION_POLICY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_3.toString());
            }
            break;
        case ADD_COMMUNICATIVE_CLASS_COORDINATION_POLICY:
            if (Parse_and_Execute.command_ADD_COMMUNICATIVE_CLASS_COORDINATION_POLICY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.ADD_COMMUNICATIVE_CLASS_COORDINATION_POLICY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_3.toString());
            }
            break;
        case REMOVE_COMMUNICATIVE_CLASS_COLLABORATION_POLICY:
            if (Parse_and_Execute.command_REMOVE_COMMUNICATIVE_CLASS_COLLABORATION_POLICY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.REMOVE_COMMUNICATIVE_CLASS_COLLABORATION_POLICY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_3.toString());
            }
            break;
        case REMOVE_COMMUNICATIVE_CLASS_COORDINATION_POLICY:
            if (Parse_and_Execute.command_REMOVE_COMMUNICATIVE_CLASS_COORDINATION_POLICY(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.REMOVE_COMMUNICATIVE_CLASS_COORDINATION_POLICY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_3.toString());
            }
            break;
        case CHANGE_PASSWORD:
            if (Parse_and_Execute.command_CHANGE_PASSWORD(e) == INDICATE_ARGUMENT_MISMATCH) {
                errorMsg = (Parser.LPM_ERRORS.REMOVE_COMMUNICATIVE_CLASS_COORDINATION_POLICY_ERROR_NUMBER_OF_ARGUMENTS_SHOULD_BE_3.toString());
            }
            break;
    }
    return errorMsg;
}

[Buggy Hunk]
Parser.LPM_COMMANDS pmCmd = Parser.LPM_COMMANDS.valueOf(e.substring(INDICATE_EXECUTION_SUCCESS));

[Patch]
Parser.LPM_COMMANDS pmCmd = Parser.LPM_COMMANDS.valueOf(e.split(" ")[0]);

[Demonstration 2]

[Buggy Method]
@Override
public void handleError(ClientHttpResponse response) throws IOException {
    log.error("Response error: {} {}", response.getStatusCode(), response.getStatusText());
}

[Buggy Hunk]
log.error("Response error: {} {}", response.getStatusCode(), response.getStatusText());

[Patch]
LOGGER.error("Response error: {} {}", response.getStatusCode(), response.getStatusText());

[Demonstration 3]

[Buggy Method]
public void onCustomerLogClick(View view) {
    final Button b = (Button) findViewById(R.id.login1);
    b.setEnabled(false);
    final EditText phoneInput = (EditText) findViewById(R.id.phoneInput);
    final EditText passwordInput = (EditText) findViewById(R.id.passwordInput);
    final EditText rePasswordInput = (EditText) findViewById(R.id.repasswordInput);
    final EditText emailInput = (EditText) findViewById(R.id.emailInput);
    String phone = phoneInput.getText().toString();
    String password = passwordInput.getText().toString();
    String rePassword = rePasswordInput.getText().toString();
    String email = emailInput.getText().toString();
    LayoutInflater inflater = getLayoutInflater();
    View layout = inflater.inflate(R.layout.my_custom_alert, (ViewGroup) findViewById(R.id.my_custom_layout_id));
    TextView text = (TextView) layout.findViewById(R.id.alertText);
    if (password.equals(rePassword)) {
        if (!phone.equals("") && !email.equals("")) {
            sign_up(phone, password, email);
        } else {
            b.setEnabled(true);
            alertToast("Please fill all fields");
        }
    } else {
        //final Button b = (Button) findViewById(R.id.login1);
        b.setEnabled(true);
        passwordInput.setTextColor(Color.parseColor("RED"));
        rePasswordInput.setTextColor(Color.parseColor("RED"));
        alertToast("Please retype your password");
    }
}

[Buggy Hunk]
if (!phone.equals("") && !email.equals("")) {

[Patch]
if (!phone.equals("") && !email.equals("") && !password.equals("") && !rePassword.equals("")) {