[Demonstration 1]

[Buggy Method]
@Override
public void writeReference(String text, Object reference, boolean isLocal) {
    this.render((canvas) -> {
        if (reference instanceof PackageReference) {
            this.write(text);
        } else if (reference instanceof TypeReference) {
            TypeReference ref = (TypeReference) reference;
            if (text.equals("@")) {
                // Procyon has a bug where the '@' in front of attributes
                //  is written as an identifier. We manually handle this.
                this.write(text);
                return;
            }
            HtmlAttributes attribs = class_(CSS.JAVA_REF_TYPE);
            attribs.add("ref_type", "type");
            attribs.add("type", ref.getFullName());
            canvas.span(attribs).content(text);
        } else if (reference instanceof MethodReference) {
            MethodReference ref = (MethodReference) reference;
            HtmlAttributes attribs = class_(CSS.JAVA_REF_METHOD);
            attribs.add("ref_type", "method");
            attribs.add("type", ref.getDeclaringType().getFullName());
            attribs.add("method_name", ref.getName());
            attribs.add("method_type", ref.getReturnType().getFullName());
            attribs.add("method_sig", ref.getSignature());
            canvas.span(attribs).content(text);
        } else if (reference instanceof FieldReference) {
            FieldReference ref = (FieldReference) reference;
            HtmlAttributes attribs = class_(CSS.JAVA_REF_FIELD);
            attribs.add("ref_type", "field");
            attribs.add("type", ref.getDeclaringType().getFullName());
            attribs.add("field_name", ref.getName());
            attribs.add("field_type", ref.getFieldType().getFullName());
            canvas.span(attribs).content(text);
        } else if (reference instanceof ParameterReference) {
            //				ParameterReference ref = ( ParameterReference ) reference;
            canvas.span(class_(CSS.JAVA_REF_PARAMETER)).content(text);
        } else if (reference instanceof VariableReference) {
            VariableReference ref = (VariableReference) reference;
            if (this.seenVariables.add(ref)) {
                // Procyon has a bug where both references and definitions
                //  for variables are passed to this method. We manually
                //  redirect definitions to the correct place.
                this.writeDefinition(text, ref, isLocal);
                return;
            }
            canvas.span(class_(CSS.JAVA_REF_VARIABLE)).content(text);
        } else {
            throw new IllegalArgumentException("Can not write reference type: " + reference.getClass());
        }
    });
}

[Buggy Hunk]
attribs.add( "type", ref.getFullName( ) );

[Patch]
attribs.add( "type", ref.getInternalName( ).replace( '/', '.' ) );

[Demonstration 2]

[Buggy Method]
public void setCityId(int provinceId) {
    this.cityId = cityId;
}

[Buggy Hunk]
public void setCityId(int provinceId) {

[Patch]
public void setCityId(int cityId) {

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) throws SQLException {
    Connection conn = DriverManager.getConnection("jdbc:h2:./main");
    () -> {
    }.start();
    Statement stmt = conn.createStatement();
    stmt.execute("CREATE TABLE id IDENTITY, username VARCHAR, address VARCHAR, email VARCHAR");
}

[Buggy Hunk]
().start();

[Patch]
Server.createWebServer().start();