[Demonstration 1]

[Buggy Method]
public void updateNonVersionedWebApp(APITemplateBuilder builder, APIIdentifier apiId, String tenantDomain) throws AppManagementException {
    String appName = apiId.getApiName();
    String appVersion = apiId.getVersion();
    String appProvider = apiId.getProviderName();
    try {
        String apiConfig = builder.getConfigStringForNonVersionedWebAppTemplate();
        if (StringUtils.isEmpty(tenantDomain) && !tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
            appGatewayAdminStub.updateNonVersionedWebAppForTenant(appProvider, appName, appVersion, apiConfig, tenantDomain);
        } else {
            appGatewayAdminStub.updateNonVersionedWebApp(appProvider, appName, appVersion, apiConfig);
        }
    } catch (RemoteException e) {
        String errorMsg = "Error while updating non-versioned web app in the gateway. App Name : " + appName;
        throw new AppManagementException(errorMsg, e);
    } catch (AppGatewayAdminAppManagementExceptionException e) {
        String errorMsg = "Error while updating non-versioned web app in the gateway. App Name : " + appName;
        throw new AppManagementException(errorMsg, e);
    } catch (APITemplateException e) {
        String errorMsg = "Error while updating non-versioned web app in the gateway. App Name : " + appName;
        throw new AppManagementException(errorMsg, e);
    }
}

[Buggy Hunk]
if (StringUtils.isEmpty(tenantDomain) && !tenantDomain.equals(MultitenantConstants

[Patch]
if (!StringUtils.isEmpty(tenantDomain) && !tenantDomain.equals(MultitenantConstants

[Demonstration 2]

[Buggy Method]
@FXML
public void submitValue() {
    fullColorFiltered.setImage(ColorFilters.chooseBrightness(fullColorFiltered.getImage(), slider_brightness.getValue()));
    fullColorFiltered.addFilter(String.format("Brightness with value %f brightness", slider_brightness.getValue()));
    Stage stage = (Stage) submit_button.getScene().getWindow();
    stage.close();
}

[Buggy Hunk]
fullColorFiltered.setImage(ColorFilters.chooseBrightness(fullColorFiltered.getImage(),slider_brightness.getValue()));

[Patch]
fullColorFiltered.pushImage(ColorFilters.chooseBrightness(fullColorFiltered.getImage(),slider_brightness.getValue()));

[Demonstration 3]

[Buggy Method]
private void handleException(final String error, final StatusEventWithID event, final IndexingException exception) throws FatalIndexingException {
    if (exception instanceof FatalIndexingException) {
        throw (FatalIndexingException) exception;
    } else {
        final String msg = error + String.format(" for event %s %s: ", event.getEvent().getEventType(), event.getId());
        logError(msg, exception);
    }
}

[Buggy Hunk]
event.getEvent().getEventType(), event.getId());

[Patch]
event.getEvent().getEventType(), event.getId().getId());