[Demonstration 1]

[Buggy Method]
private void buildFrameworkMethodTree() {
    for (FrameworkMethod method : getChildren()) {
        nameToMethod.put(method.getName(), method);
    }
}

[Buggy Hunk]
nameToMethod.put(method.getName(), method);

[Patch]
nameToMethod.put(getName(method), method);

[Demonstration 2]

[Buggy Method]
public void run() {
    setupObjectStreams();
    //    test();
    remoteObject = (T) parent.skeleton.remoteObject;
    clazz = parent.skeleton.clazz;
    for (Method method : clazz.getMethods()) {
        methods.add(method);
    }
    handleRemoteInvocation();
}

[Buggy Hunk]
methods.add(method);

[Patch]
validMethodNames.add(method.getName());

[Demonstration 3]

[Buggy Method]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == ResultsActivity.SCAN_QR && resultCode == RESULT_OK) {
        String result = data.getStringExtra("SCAN_RESULT");
        String[] parsedResults = result.split("/?a=");
        String newId = parsedResults[parsedResults.length - 1];
        try {
            Intent resultIntent = new Intent(this, AssetActivity.class);
            resultIntent.putExtra(ResultsActivity.ID, Long.parseLong(newId, 10));
            startActivity(resultIntent);
        } catch (NumberFormatException e) {
            AudioManager audio = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
            audio.playSoundEffect(Sounds.ERROR);
            Toast.makeText(getApplicationContext(), "Invalid ID from scan", Toast.LENGTH_LONG).show();
        }
    } else if (requestCode == ResultsActivity.PICK_STATUS && resultCode == RESULT_OK) {
        long id = data.getLongExtra(ResultsActivity.ID, ResultsActivity.EMPTY);
        newA = new Asset();
        newA.setIntSiteID(SITEID);
        newA.setIntCategoryID(id);
        displaySpeechRecognizer("Add a note to the asset:");
    } else if (requestCode == ResultsActivity.SPEECH_REQUEST && resultCode == RESULT_OK) {
        List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        AddRequest<Asset> aReqA = client.prepareAdd(Asset.class);
        aReqA.setFields("id");
        newA.setStrName("New Generated Asset");
        newA.setStrDescription("\"" + results.get(0) + "\" - Generated from Google Glass by: " + fRespU.getObjects().get(0).getStrFullName());
        aReqA.setObject(newA);
        aRespA = client.add(aReqA);
        if (aRespA.getError() != null) {
            Toast.makeText(this, "Asset successfully generated.", Toast.LENGTH_SHORT).show();
            Intent resultIntent = new Intent(this, AssetActivity.class);
            resultIntent.putExtra(ResultsActivity.ID, aRespA.getObject().getId());
            startActivity(resultIntent);
        } else {
            Toast.makeText(this, "Failed to generate asset", Toast.LENGTH_SHORT).show();
        }
    } else if (resultCode != RESULT_OK) {
        Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
    }
    super.onActivityResult(requestCode, resultCode, data);
}

[Buggy Hunk]
if (aRespA.getError() != null) {

[Patch]
if (aRespA.getError() == null) {