[Demonstration 1]

[Buggy Method]
private void viewSetting() {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), null);
    pttWebView = (WebView) findViewById(R.id.ptt_webview);
    pttWebView.getSettings().setJavaScriptEnabled(true);
    pttWebView.getSettings().setLoadWithOverviewMode(true);
    pttWebView.getSettings().setAllowFileAccess(true);
    // Disable zooming and fit web content to screen size.
    pttWebView.getSettings().setUseWideViewPort(true);
    pttWebView.setWebViewClient(new WebViewClient() {

        ProgressDialog progressDialog;

        //If you will not use this method url links are open in new browser not in webview
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }

        //Show loader on url load
        public void onLoadResource(WebView view, String url) {
            if (progressDialog == null) {
                // in standard case YourActivity.this
                progressDialog = new ProgressDialog(TopicContentActivity.this);
                progressDialog.setMessage("Loading...");
                progressDialog.show();
            }
        }

        public void onPageFinished(WebView view, String url) {
            try {
                if (progressDialog.isShowing()) {
                    progressDialog.dismiss();
                    progressDialog = null;
                }
            } catch (Exception exception) {
                exception.printStackTrace();
            }
        }
    });
    if (!targetLanguage.equals("zh-TW")) {
        contentUrl = "http://translate.google.com.tw/translate?hl=" + targetLanguage + "&sl=zh-TW&u=" + contentUrl;
        Log.e(LOG_TAG, contentUrl);
    }
    pttWebView.loadUrl(contentUrl);
}

[Buggy Hunk]
targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), null);

[Patch]
targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), getResources().getString(R.string.pref_language_zhTW));

[Demonstration 2]

[Buggy Method]
@Override
public List<HttpCookie> getCookies() {
    ArrayList<HttpCookie> ret = new ArrayList<HttpCookie>();
    for (String key : cookies.keySet()) ret.addAll(cookies.get(key).values());
    return ret;
}

[Buggy Hunk]
ArrayList<HttpCookie> ret = new ArrayList<HttpCookie>();

[Patch]
ArrayList<HttpCookie> ret = new ArrayList<>();

[Demonstration 3]

[Buggy Method]
public ByteBuffer javaExtendedBufElem(int idx) {
    ByteBuffer ret = nJavaExtendedBufElem(mPointer, idx);
    return ret == null ? null : ret.duplicate();
}

[Buggy Hunk]
return ret == null ? null : ret.duplicate();

[Patch]
return ret == null ? null : ret.duplicate().order( ret.order() );