[Demonstration 1]

[Buggy Method]
public static void check_token_valid(final String token, final ResponseListener res) {
    final JsonObjectRequest check_token = new JsonObjectRequest(Request.Method.POST, aURL + "/api/auth", new JSONObject(), new Response.Listener<JSONObject>() {

        @Override
        public void onResponse(JSONObject response) {
            res.onResponse(response);
        }
    }, new Response.ErrorListener() {

        public void onErrorResponse(VolleyError error) {
            res.onErrorResponse(error);
        }
    }) {

        @Override
        public Map<String, String> getHeaders() {
            HashMap<String, String> headers = new HashMap<String, String>();
            headers.put("Accept", "application/json");
            headers.put("Content-Type", "application/json; charset=UTF-8");
            headers.put("Authorization", "Bearer " + token);
            return headers;
        }
    };
    VolleyController.getInstance().addToRequestQueue(check_token);
}

[Buggy Hunk]
final JsonObjectRequest check_token = new JsonObjectRequest(Request.Method.POST, aURL + "/api/auth",new JSONObject() , new Response.Listener<JSONObject>() {

[Patch]
final JsonObjectRequest check_token = new JsonObjectRequest(Request.Method.GET, aURL + "/api/auth",new JSONObject() , new Response.Listener<JSONObject>() {

[Demonstration 2]

[Buggy Method]
public ByteBuffer putInBuffer4Byte(ByteBuffer buffer) {
    this.toInt();
    buffer.put((byte) r).put((byte) g).put((byte) b).put((byte) a);
    return buffer;
}

[Buggy Hunk]
buffer.put((byte) r).put((byte) g).put((byte) b).put((byte) a);

[Patch]
buffer.put((byte) r).put((byte) g).put((byte) b).put((byte) (a * 255));

[Demonstration 3]

[Buggy Method]
private void netSpeedOnListening() {
    long nowTimeStamp = SystemClock.elapsedRealtime();
    for (int i = 0; i < mListenerMap.size(); i++) {
        int uid = mListenerMap.keyAt(i);
        long nowTotalRxBytes = getTotalRxBytes(uid);
        final long speed = (nowTotalRxBytes - mLastTotalRxBytes.valueAt(i)) * 1000 / (nowTimeStamp - lastTimeStamp);
        mLastTotalRxBytes.setValueAt(i, nowTotalRxBytes);
        lastTimeStamp = nowTimeStamp;
        List<OnSpeedUpdatedListener> listeners = mListenerMap.get(i);
        if (listeners == null)
            return;
        Iterator<OnSpeedUpdatedListener> iterator = listeners.iterator();
        while (iterator.hasNext()) {
            //非UI线程；
            final OnSpeedUpdatedListener listener = iterator.next();
            try {
                new Handler(Looper.getMainLooper()).post(new Runnable() {

                    @Override
                    public void run() {
                        //切换到UI线程
                        //耗时操作导致回调时间间隔不准
                        listener.onSpeedUpdated(speed);
                    }
                });
            } catch (Exception e) {
                // 移除当前监听器
                iterator.remove();
            }
        }
    }
    lastTimeStamp = nowTimeStamp;
}

[Buggy Hunk]
List<OnSpeedUpdatedListener> listeners = mListenerMap.get(i);

[Patch]
List<OnSpeedUpdatedListener> listeners = mListenerMap.get(uid);