[Demonstration 1]

[Buggy Method]
public static Lexical determineTokenType(String tok) {
    for (Lexical l : Lexical.values()) {
        if (tok.equals(l.str)) {
            return l;
        }
    }
    return null;
}

[Buggy Hunk]
if(tok.equals(l.str)) {

[Patch]
if(checkStrAgainstLexicalType(tok, l)) {

[Demonstration 2]

[Buggy Method]
@Override
public void done(final ParseUser user, ParseException e) {
    if (e == null) {
        if (user == null) {
            Log.d("MyApp", "User cancelled Facebook login");
            return;
        } else if (user.isNew()) {
            Log.d("MyApp", "User signed up and logged in through Facebook");
        } else {
            Log.d("MyApp", "User logged in through Facebook!!!");
        }
    } else {
        e.printStackTrace();
    }
    fbGraphClient = new FBGraphClient();
    parseClient = new ParseClient();
    currentUserFbId = fbGraphClient.getCurrentUserFbId();
    accessToken = fbGraphClient.getAccessToken();
    //Deserializes the ParseUser in order to have JSONObjects that are retrievable.
    GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {

        @Override
        public void onCompleted(JSONObject object, GraphResponse response) {
            if (object != null) {
                another_user = User.fromJSON(object, user);
            } else {
                Log.d("DEBUG", "Login - object null, response: " + response.toString());
            }
        }
    });
    Bundle params = new Bundle();
    params.putString("fields", "id,name,location,timezone,picture.type(large)");
    request.setParameters(params);
    request.executeAsync();
    //DEBUG info: if one of the fields turns out to be empty,
    // it might be because you have3 no PERMISSION to access it
    // look it up in API and add more permissions to the array
    Intent i = new Intent(LoginActivity.this, NewsFeedActivity.class);
    startActivity(i);
}

[Buggy Hunk]
Intent i = new Intent (LoginActivity.this, NewsFeedActivity.class);

[Patch]
Intent i = new Intent (LoginActivity.this, FriendImportActivity.class);

[Demonstration 3]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_up);
    mSignUp = (Button) findViewById(R.id.signupButton);
    mSignUp.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            String email = ((EditText) findViewById(R.id.emailView)).getText().toString().trim();
            String password = ((EditText) findViewById(R.id.passwordView)).getText().toString().trim();
            String name = ((EditText) findViewById(R.id.nameView)).getText().toString().trim();
            String phone = ((EditText) findViewById(R.id.phoneView)).getText().toString().trim();
            ParseUser user = new ParseUser();
            user.setUsername(email);
            user.setPassword(password);
            user.setEmail(email);
            user.put("phone", phone);
            user.put("name", name);
            //create new User
            setProgressBarIndeterminateVisibility(true);
            user.signUpInBackground(new SignUpCallback() {

                @Override
                public void done(ParseException e) {
                    setProgressBarIndeterminateVisibility(false);
                    if (e == null) {
                        System.out.println("YAY");
                        Intent intent = new Intent(SignUp.this, MainActivity.class);
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                        startActivity(intent);
                    } else {
                        // Sign up didn't succeed. Look at the ParseException
                        // to figure out what went wrong
                        System.out.println(e.getMessage());
                    }
                }
            });
        }
    });
}

[Buggy Hunk]
ParseUser user = new ParseUser();

[Patch]
NUser user = new NUser();