[Demonstration 1]

[Buggy Method]
private void resetTitle() {
    switch(mScope) {
        case 1:
            getActivity().setTitle(R.string.nav_movies);
            break;
        case 2:
            getActivity().setTitle(R.string.nav_tv);
            break;
        case 3:
            getActivity().setTitle(R.string.nav_fav);
            break;
        default:
            getActivity().setTitle(R.string.nav_movies);
            Log.e(LOG_TAG, "Error resetting toolbar title");
            break;
    }
}

[Buggy Hunk]
private void resetTitle(){

[Patch]
private void resetTitle() throws  NullPointerException{

[Demonstration 2]

[Buggy Method]
public static AlertDialog showAlertPosition(final Context context) {
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
    alertDialog.setCancelable(false);
    alertDialog.setTitle(context.getResources().getString(R.string.location_disable));
    alertDialog.setMessage(getAppName(context) + context.getResources().getString(R.string.location_motivation));
    alertDialog.setPositiveButton(context.getResources().getString(R.string.settings), new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
            context.startActivity(intent);
        }
    });
    alertDialog.setNegativeButton(context.getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
            Tools.closeApp(context);
        }
    });
    AlertDialog dialog = alertDialog.create();
    dialog.show();
    return dialog;
}

[Buggy Hunk]
alertDialog.setMessage(getAppName(context)+context.getResources().getString(R.string.location_motivation));

[Patch]
alertDialog.setMessage(getAppName(context)+ " " +context.getResources().getString(R.string.location_motivation));

[Demonstration 3]

[Buggy Method]
private void checkFinished() {
    for (TypeRecord record : getState().getTypeRecordsByTypeName().values()) {
        if (record.isInterface() || typesWithAssignedProto.contains(record)) {
            continue;
        }
        JSTypeExpression extendedType = record.getExtendedType();
        if (extendedType != null) {
            Node rootNode = extendedType.getRootNode();
            if (rootNode.getType() == Token.BANG && rootNode.getFirstChild() != null) {
                rootNode = rootNode.getFirstChild();
            }
            getContext().reportErrorAtOffset(rootNode.getSourceOffset(), String.format("No __proto__ assigned for type %s having @extends", record.typeName));
        }
    }
}

[Buggy Hunk]
Node rootNode = extendedType.getRootNode();

[Patch]
Node rootNode = extendedType.getRoot();