[Demonstration 1]

[Buggy Method]
@Override
protected void creatLeadEvent() {
    super.creatLeadEvent();
    if (getCurrentFragment() instanceof HomeStackFragment || getCurrentFragment() instanceof BIFragment || getCurrentFragment() instanceof ProposalFormFragment || getCurrentFragment() instanceof UpdateLeadFragment || getCurrentFragment() instanceof FinalcialneedAnalysisFragment)
        Fragment(Constant.LEAD_CREATE, true, null);
}

[Buggy Hunk]
if (getCurrentFragment() instanceof HomeStackFragment || getCurrentFragment() instanceof BIFragment || getCurrentFragment() instanceof ProposalFormFragment || getCurrentFragment() instanceof UpdateLeadFragment || getCurrentFragment() instanceof FinalcialneedAnalysisFragment)

[Patch]
if (getCurrentFragment() instanceof HomeStackFragment || getCurrentFragment() instanceof BIFragment || getCurrentFragment() instanceof ProposalFormFragment || getCurrentFragment() instanceof CreateLeadFragment || getCurrentFragment() instanceof FinalcialneedAnalysisFragment)

[Demonstration 2]

[Buggy Method]
private static ITerm sourceTerm(String resource) {
    return GenericTerms.newString(resource, ImmutableClassToInstanceMap.builder().put(ITermIndex.class, ImmutableTermIndex.of(resource, 0)).build());
}

[Buggy Hunk]
return GenericTerms.newString(resource, ImmutableClassToInstanceMap.builder().put(ITermIndex.class,

[Patch]
return GenericTerms.newString(resource, ImmutableClassToInstanceMap.builder().put(TermIndex.class,

[Demonstration 3]

[Buggy Method]
private static JSONArray getExternalLinks(String token, String csid, List<String> externalSources) throws IOException {
    String xml = apiCall(urlCSID2ExtRefs, apiCSID2ExtRefsdata(csid, token, externalSources));
    JSONObject toJSON = XML.toJSONObject(xml);
    if (toJSON.getJSONObject("ArrayOfExtRef") != null) {
        Object externalIdslist = toJSON.getJSONObject("ArrayOfExtRef").get("ExtRef");
        JSONArray wrapped = new JSONArray();
        if (externalIdslist instanceof JSONArray) {
            wrapped = (JSONArray) externalIdslist;
        } else if (externalIdslist instanceof JSONObject) {
            wrapped.put(externalIdslist);
        } else {
            throw new IOException(externalIdslist.getClass().getName());
        }
        return wrapped;
    }
    return new JSONArray();
}

[Buggy Hunk]
if(toJSON.getJSONObject("ArrayOfExtRef")!=null)

[Patch]
if(toJSON.getJSONObject("ArrayOfExtRef")!=null && toJSON.getJSONObject("ArrayOfExtRef").has("ExtRef"))