[Demonstration 1]

[Buggy Method]
public static void sendGet(String url, WeixinHttpCallback c) {
    HttpGet get = null;
    CloseableHttpClient client = null;
    CloseableHttpResponse resp = null;
    try {
        client = HttpClients.createDefault();
        url = url.replaceAll("ACCESS_TOKEN", AccessTokenKit.getToken());
        LOGGER.debug("sending http get request[{}]...", url);
        get = new HttpGet(url);
        resp = client.execute(get);
        int statusCode = resp.getStatusLine().getStatusCode();
        if (statusCode >= 200 && statusCode < 300) {
            HttpEntity entity = resp.getEntity();
            String content = EntityUtils.toString(entity);
            LOGGER.debug("success to get response:[{}]", content);
            ErrorEntity err = JSONObject.parseObject(content, ErrorEntity.class);
            if (err != null) {
                LOGGER.error("http[{}] response is error, errcode:[{}], errmsg:[{}].", url, err.getErrcode(), err.getErrmsg());
                return;
            }
            c.process(content);
            LOGGER.debug("success to finish http get request.");
        } else {
            LOGGER.error("failed to get http response, http status:[{}]", statusCode);
        }
    } catch (Exception e) {
        LOGGER.error("failed to send http get request", e);
    } finally {
        HttpClientUtils.closeQuietly(resp);
        HttpClientUtils.closeQuietly(client);
    }
}

[Buggy Hunk]
if(err != null) {

[Patch]
if(err.getErrcode()== null && err.getErrmsg()==null) {

[Demonstration 2]

[Buggy Method]
public static DeviceNotificationMessage createNotificationForDevice(Device device, String notificationName) {
    DeviceNotificationMessage notification = new DeviceNotificationMessage();
    notification.setNotification(notificationName);
    notification.setDeviceGuid(device.getGuid());
    Gson gson = GsonFactory.createGson(JsonPolicyDef.Policy.DEVICE_PUBLISHED);
    JsonElement deviceAsJson = gson.toJsonTree(device);
    //JsonStringWrapper wrapperOverDevice = new JsonStringWrapper(deviceAsJson.toString());
    notification.setParameters(deviceAsJson.getAsJsonObject().getAsString());
    return notification;
}

[Buggy Hunk]
notification.setParameters(deviceAsJson.getAsJsonObject().getAsString());

[Patch]
notification.setParameters(deviceAsJson.toString());

[Demonstration 3]

[Buggy Method]
@Override
public String toString() {
    String str = getClass().getSimpleName() + "[" + getPositionMaster() + "," + getPositionMaster();
    if (getVersionCorrection() != null) {
        str += ",versionCorrection=" + getVersionCorrection();
    }
    return str + "]";
}

[Buggy Hunk]
String str = getClass().getSimpleName() + "[" + getPositionMaster() + "," + getPositionMaster();

[Patch]
String str = getClass().getSimpleName() + "[" + getPortfolioMaster() + "," + getPositionMaster();