[Demonstration 1]

[Buggy Method]
@Override
public void onFailure(Method method, Throwable exception) {
    GWT.log("Erro: " + exception, exception);
}

[Buggy Hunk]
GWT.log("Erro: " + exception, exception);

[Patch]
callback.onFailure(method, exception);

[Demonstration 2]

[Buggy Method]
public Binding bind(final Widget widget, final String property, final Converter converter, final boolean bindOnKeyUp) {
    validatePropertyExpr(property);
    int dotPos = property.indexOf(".");
    if (dotPos > 0) {
        DataBinder nested = createNestedBinder(property);
        nested.bind(widget, property.substring(dotPos + 1), converter, bindOnKeyUp);
        Binding binding = new Binding(property, widget, converter, null);
        bindings.put(property, binding);
        return binding;
    }
    if (!propertyTypes.containsKey(property)) {
        throw new NonExistingPropertyException(property);
    }
    for (Binding binding : bindings.values()) {
        if (binding.getWidget().equals(widget) && !property.equals(binding.getProperty())) {
            throw new WidgetAlreadyBoundException("Widget already bound to property: " + binding.getProperty());
        }
    }
    Collection<HandlerRegistration> handlerRegistrations = addWidgetHandlers(widget, bindOnKeyUp, new ModelUpdater() {

        @Override
        public void update(final Object value) {
            final Object oldValue = proxy.get(property);
            final Object newValue = toModelValue(propertyTypes.get(property).getType(), widget, value, converter);
            proxy.set(property, newValue);
            updateWidgetsAndFireEvent(property, oldValue, newValue, widget);
        }
    });
    Binding binding = new Binding(property, widget, converter, handlerRegistrations);
    bindings.put(property, binding);
    if (propertyTypes.get(property).isList()) {
        proxy.set(property, ensureBoundListIsProxied(property));
    }
    syncState(widget, property, converter);
    return binding;
}

[Buggy Hunk]
Collection<HandlerRegistration> handlerRegistrations = addWidgetHandlers(widget, bindOnKeyUp, new ModelUpdater() {

[Patch]
Map handlerRegistrations = addWidgetHandlers(widget, bindOnKeyUp, new ModelUpdater() {

[Demonstration 3]

[Buggy Method]
@RequestMapping(method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public Object getAutoComplete(@RequestParam(value = "source") String source, @RequestParam(value = "value", defaultValue = "full") String value) {
    if (source == null)
        return new SimpleErrorData("Invalid Parameters", "The source parameter was not provided");
    if (value == null)
        return new SimpleErrorData("Invalid Parameters", "The value parameter was not provided");
    if ((!source.equalsIgnoreCase("game")))
        return new SimpleErrorData("Invalid Parameters", "The source parameter value of " + source + " is not a valid source value.");
    GamesDatabase database = null;
    Object results = null;
    if (value.trim().length() < 3)
        return new ArrayList<CompactSearchData>();
    try {
        database = MongoDBFactory.createMongoGamesDatabase(Application.databaseHost, Application.databasePort, Application.databaseName);
        database.initializeDBConnection();
        if (value.equalsIgnoreCase("full"))
            results = new WrapList(database.readGameNamesForAutoComplete());
        else {
            System.out.println("The value I'm going to deconstruct is: " + value);
            String gameName = null;
            String primaryPub = null;
            int yearPublished = -1;
            int openParen = value.indexOf("(");
            if (openParen == -1)
                gameName = value.trim();
            else {
                gameName = value.substring(0, openParen - 1).trim();
                String filterSubString = value.substring(openParen + 1, value.length() - 1);
                int splitPos = filterSubString.indexOf(" - ");
                if (splitPos != -1) {
                    //It has a publisher and a date
                    primaryPub = filterSubString.substring(0, splitPos).trim();
                    yearPublished = Integer.parseInt(filterSubString.substring(splitPos + 3).trim());
                } else {
                    //It is a publisher OR a date
                    try {
                        yearPublished = Integer.parseInt(filterSubString);
                    } catch (NumberFormatException nfe) {
                        primaryPub = filterSubString;
                    }
                }
            }
            System.out.println("Game Name:     " + gameName);
            System.out.println("Primary Pub:   " + primaryPub);
            System.out.println("yearPublished: " + yearPublished);
            CompactSearchData data = database.readGameFromAutoName(gameName, primaryPub, yearPublished);
            if (data == null)
                results = new SimpleErrorData("No Game Found", "I could not find the requested game.");
            else
                results = data;
        }
    } catch (DatabaseOperationException doe) {
        doe.printStackTrace();
        try {
            if (database != null)
                database.closeDBConnection();
        } catch (Throwable t2) {
            /**
             * Ignore Errors
             */
        }
        return new SimpleErrorData("Database Operation Error", "An error occurred running the request: " + doe.getMessage());
    } catch (ConfigurationException ce) {
        ce.printStackTrace();
        try {
            if (database != null)
                database.closeDBConnection();
        } catch (Throwable t2) {
            /**
             * Ignore Errors
             */
        }
        return new SimpleErrorData("Database Configuration Error", "An error occurred accessing the database: " + ce.getMessage());
    } finally {
        try {
            if (database != null)
                database.closeDBConnection();
        } catch (Throwable t2) {
            /**
             * Ignore Errors
             */
        }
    }
    return results;
}

[Buggy Hunk]
int openParen = value.indexOf("(");

[Patch]
int openParen = value.lastIndexOf("(");