[Demonstration 1]

[Buggy Method]
private void createBenchmarkProxy() {
    Class<?> beanType = bean.getClass();
    Object newBean = bean;
    bean = Proxy.newProxyInstance(beanType.getClassLoader(), beanType.getInterfaces(), new InvocationHandler() {

        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            Method m = beanType.getMethod(method.getName(), method.getParameterTypes());
            if (m.isAnnotationPresent(Benchmark.class)) {
                Long start = System.nanoTime();
                Object result = method.invoke(newBean, args);
                Long stop = System.nanoTime();
                System.out.println("Duration: " + (stop - start));
                return result;
            } else {
                return method.invoke(bean, args);
            }
        }
    });
}

[Buggy Hunk]
return method.invoke(bean, args);

[Patch]
return method.invoke(newBean, args);

[Demonstration 2]

[Buggy Method]
public int getApplicationImportance(ReactApplicationContext context) {
    ActivityManager activityManager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE);
    if (activityManager == null) {
        return 0;
    }
    List<ActivityManager.RunningAppProcessInfo> processInfos = activityManager.getRunningAppProcesses();
    if (processInfos == null) {
        return 0;
    }
    for (ActivityManager.RunningAppProcessInfo processInfo : processInfos) {
        if (processInfo.processName.equals(getApplication().getPackageName())) {
            return processInfo.importance;
        }
    }
    return 0;
}

[Buggy Hunk]
if (processInfo.processName.equals(getApplication().getPackageName())) {

[Patch]
if (processInfo.processName.equals(context.getApplicationInfo().packageName)) {

[Demonstration 3]

[Buggy Method]
public static void attachListeners(Data d, List<BoundVarInfo> vars, String rootConstructor) throws Exception {
    String root = ROOT_NAME;
    interp.create(root, rootConstructor);
    Value v = interp.valueExecute(root);
    if (v.deref() instanceof alue) {
        NameValuePairMap members = ((ObjectValue) v.deref()).members;
        for (Entry<ILexNameToken, Value> p : members.entrySet()) {
            for (BoundVarInfo bv : vars) {
                if (bv.name().equals(p.getKey().getName())) {
                    if (p.getValue() instanceof UpdatableValue) {
                        UpdatableValue u = (UpdatableValue) p.getValue();
                        u.addListener(new BoundVarListener(d, bv.name(), bv.type()));
                        break;
                    }
                }
            }
        }
    }
}

[Buggy Hunk]
if (v.deref() instanceof alue) {

[Patch]
if (v.deref() instanceof ObjectValue) {