[Demonstration 1]

[Buggy Method]
@Override
public OClass call(final OrientBaseGraph g) {
    String indexType = OClass.INDEX_TYPE.NOTUNIQUE.name();
    OType keyType = OType.STRING;
    String className = null;
    final String ancestorClassName = getClassName(elementClass);
    // READ PARAMETERS
    for (Parameter<?, ?> p : indexParameters) {
        if (p.getKey().equals("type"))
            indexType = p.getValue().toString().toUpperCase();
        else if (p.getKey().equals("keytype"))
            keyType = OType.valueOf(p.getValue().toString().toUpperCase());
        else if (p.getKey().equals("class"))
            className = p.getValue().toString();
    }
    if (className == null)
        className = ancestorClassName;
    final ODatabaseDocumentTx db = getRawGraph();
    final OSchema schema = db.getMetadata().getSchema();
    final OClass cls = schema.getOrCreateClass(className, schema.getClass(ancestorClassName));
    final OProperty property = cls.getProperty(key);
    if (property != null)
        keyType = property.getType();
    db.getMetadata().getIndexManager().createIndex(className + "." + key, indexType, new OPropertyIndexDefinition(className, key, keyType), cls.getPolymorphicClusterIds(), null);
    return null;
}

[Buggy Hunk]
cls.getPolymorphicClusterIds(), null);

[Patch]
cls.getPolymorphicClusterIds(), null, null);

[Demonstration 2]

[Buggy Method]
public String fullName() {
    return this.firstName + " " + this.lastName;
}

[Buggy Hunk]
return this.firstName+" "+this.lastName;

[Patch]
return (this.firstName==null?"":this.firstName+" ")+(this.lastName==null?"":this.lastName);

[Demonstration 3]

[Buggy Method]
public final String[][] getInhalt() {
    return this.inhalt;
}

[Buggy Hunk]
return this.inhalt;

[Patch]
return Arrays.copyOf(inhalt, inhalt.length);