[Demonstration 1]

[Buggy Method]
@RequestMapping(value = "/edituserinfo", method = RequestMethod.POST)
@ResponseBody
public Object editUserInfo(UserInfo userinfo, HttpServletRequest request) {
    Map<String, Object> map = new HashMap<String, Object>();
    String birthday_str = request.getParameter("edit_birthday");
    if (!"".equals(birthday_str)) {
        Date birthday = DateConvert.String2Date(birthday_str);
        userinfo.setBirthday(birthday);
    }
    if (userinfoSrv.editUserInfo(userinfo)) {
        map.put("success", true);
    } else {
        map.put("success", true);
    }
    return map;
}

[Buggy Hunk]
map.put("success", true);

[Patch]
map.put("success", false);

[Demonstration 2]

[Buggy Method]
public void run() {
    if (!verb.getSimplePast().isEmpty() && !verb.getPastParticiple().isEmpty()) {
        verbDAO.addVerb(verb);
        verbs.add(verb);
        verbsAdapter.add(verb.getFrench() + " - " + verb.getInfinitive() + " - " + verb.getSimplePast() + " - " + verb.getPastParticiple());
        editTextVerbFrench.setText("");
        editTextVerbEnglish.setText("");
    } else {
        showAlert(R.string.title_error_message_api_call, R.string.error_message_api_call);
    }
}

[Buggy Hunk]
if(!verb.getSimplePast().isEmpty() && !verb.getPastParticiple().isEmpty()) {

[Patch]
if(verb.getSimplePast() != null && verb.getPastParticiple() != null) {

[Demonstration 3]

[Buggy Method]
private void getObjectModel(final CallbackContext callbackContext, String className, String methodName, JSONArray values) throws Exception {
    JSONArray jsonArrayInstance = new JSONArray();
    JSONObject jsonObjectInstance = new JSONObject();
    JSONObjectAsyncTaskCallback callBackJSONObject = new JSONObjectAsyncTaskCallback() {

        @Override
        public void onFailure(Exception arg0) {
            callbackContext.error(arg0.getMessage());
        }

        @Override
        public void onSuccess(JSONObject arg0) {
            // TODO Auto-generated method stub
            PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, arg0);
            pluginResult.setKeepCallback(true);
            callbackContext.sendPluginResult(pluginResult);
        }
    };
    JSONArrayAsyncTaskCallback callbackJSONArray = new JSONArrayAsyncTaskCallback() {

        @Override
        public void onFailure(Exception arg0) {
            callbackContext.error(arg0.getMessage());
        }

        @Override
        public void onSuccess(JSONArray arg0) {
            PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, arg0);
            pluginResult.setKeepCallback(true);
            callbackContext.sendPluginResult(pluginResult);
        }
    };
    Method methodToExecute = null;
    Object[] params = null;
    BaseService service = getService(className);
    if (service == null) {
        throw new LiferayPluginException("Service not implemented");
    }
    Method[] methods = service.getClass().getMethods();
    for (Method m : methods) {
        if (m.getName().equals(methodName) || methodName.indexOf(m.getName()) >= 0) {
            if (values.length() != m.getParameterTypes().length) {
                throw new LiferayPluginException("Number of params error for the method " + methodName);
            }
            params = getListOfParam(m, values);
            if (m.getReturnType().isInstance(jsonArrayInstance)) {
                session.setCallback(callbackJSONArray);
            } else if (m.getReturnType().isInstance(jsonObjectInstance)) {
                session.setCallback(callBackJSONObject);
            } else if (m.getReturnType().equals(Void.TYPE)) {
                callbackContext.success();
            }
            methodToExecute = m;
            break;
        }
    }
    if (methodToExecute == null) {
        throw new LiferayPluginException("Method " + methodName + "not found");
    }
    try {
        methodToExecute.invoke(service, params);
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        throw new LiferayPluginException("Error invoking -- " + e.getMessage());
    }
}

[Buggy Hunk]
if(m.getName().equals(methodName) || methodName.indexOf(m.getName()) >=0){

[Patch]
if(m.getName().toLowerCase().equals(methodName) || methodName.toLowerCase().indexOf(m.getName().toLowerCase()) >=0){