[Demonstration 1]

[Buggy Method]
@Override
public void setType(String newType) {
    // Fail silently if the new value is already set
    if (newType == null || newType.equals(type)) {
        String oldType = type;
        type = newType;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, GeometryPackage.SHAPE__TYPE, oldType, type));
    }
}

[Buggy Hunk]
if (newType == null || newType.equals(type)) {

[Patch]
if (newType == null || !newType.equals(type)) {

[Demonstration 2]

[Buggy Method]
private float evaluateKernelNotNormalize(TreeRepresentation a, TreeRepresentation b) {
    // Initialize the delta function cache
    deltaMatrix.clear();
    /*
		 * Check the size of caching matrices
		 */
    int maxBranchingFactor = Math.max(a.getBranchingFactor(), b.getBranchingFactor());
    int maxHeight = Math.max(a.getHeight(), b.getHeight());
    if (kernel_mat_buffer[0].length < maxBranchingFactor + 1 || DP_buffer.length < maxHeight) {
        if (maxBranchingFactor >= MAX_CHILDREN) {
            MAX_CHILDREN = maxBranchingFactor + 1;
        }
        if (maxHeight > MAX_RECURSION)
            MAX_RECURSION = maxHeight;
        logger.warn("Increasing the size of cache matrices to host trees with height=" + MAX_RECURSION + " and maxBranchingFactor=" + MAX_CHILDREN + "");
        kernel_mat_buffer = new float[MAX_CHILDREN][MAX_CHILDREN];
        DPS_buffer = new float[MAX_RECURSION][MAX_CHILDREN][MAX_CHILDREN];
        DP_buffer = new float[MAX_RECURSION][MAX_CHILDREN][MAX_CHILDREN];
    }
    /*
		 * End of the check
		 */
    ArrayList<TreeNodePairs> pairs = determineSubList(a, b);
    float sum = 0;
    for (int i = 0; i < pairs.size(); i++) {
        sum += sptkDeltaFunction(pairs.get(i).getNx(), pairs.get(i).getNz());
    }
    return sum;
}

[Buggy Hunk]
kernel_mat_buffer = new float[MAX_CHILDREN][MAX_CHILDREN];

[Patch]
kernel_mat_buffer = new float[MAX_RECURSION][MAX_CHILDREN];

[Demonstration 3]

[Buggy Method]
public boolean isWrapAround() {
    // On range can ever wrap
    return keyRange instanceof Range && ((Range) keyRange).isWrapAround();
}

[Buggy Hunk]
return keyRange instanceof Range && ((Range)keyRange).isWrapAround();

[Patch]
return keyRange instanceof Range && ((Range<?>)keyRange).isWrapAround();