[Demonstration 1]

[Buggy Method]
@Invoker(UserType.STUDENT)
public static void call(String message) {
    //$NON-NLS-1$
    if (isCalling())
        throw new IllegalStateException("Already been calling.");
    final HelpCall call = new HelpCall();
    call.setDate(new Date());
    call.setMessage(message);
    final User loginUser = ServiceUtil.getLoginUser();
    //$NON-NLS-1$
    if (loginUser == null)
        throw new IllegalStateException("Not logged in.");
    call.setCaller(loginUser.getAccount());
    final EntityManager em = EMF.get().createEntityManager();
    final EntityTransaction t = em.getTransaction();
    try {
        t.begin();
        em.persist(call);
        t.commit();
        fireHelpCallStateChanged(loginUser, HelpCallEvent.Type.ADDED, call.getDate(), message);
    } catch (Throwable e) {
        //$NON-NLS-1$
        logger.error("Failed to call.", e);
        t.rollback();
    } finally {
        em.close();
    }
}

[Buggy Hunk]
public static void call(String message) {

[Patch]
public synchronized static void call(String message) {

[Demonstration 2]

[Buggy Method]
@TypeConverter
public Set<FskConstraint> toFskConstraints(String value) {
    return RoomConverters.Companion.toFskConstraints(value);
}

[Buggy Hunk]
public Set<FskConstraint> toFskConstraints(String value) {

[Patch]
public Set<FskConstraint> toFskConstraints(@Nullable String value) {

[Demonstration 3]

[Buggy Method]
@Nullable
public static ReductionData getReductionAccumulator(PsiAssignmentExpression assignment) {
    if (!(assignment.getLExpression() instanceof PsiReferenceExpression))
        return null;
    final PsiVariable accumulator = resolveVariable(assignment.getLExpression());
    if (accumulator == null)
        return null;
    final PsiType type = accumulator.getType();
    PsiExpression expr1, expr2;
    Pair<String, Boolean> opData;
    String format;
    IElementType op = mapAssignOperator(assignment.getOperationTokenType());
    if (op != null) {
        if (!associativeOperators.containsKey(type.getCanonicalText()))
            return null;
        opData = associativeOperators.get(type.getCanonicalText()).get(op);
        if (opData == null)
            return null;
        expr1 = assignment.getLExpression();
        expr2 = assignment.getRExpression();
        if (expr2 == null || !isTypeAllowedForReduce(accumulator, expr2.getType()))
            return null;
        format = "%s " + operatorToString(op) + " %s";
    } else if (JavaTokenType.EQ.equals(assignment.getOperationTokenType())) {
        if (assignment.getRExpression() instanceof PsiBinaryExpression) {
            PsiBinaryExpression binOp = (PsiBinaryExpression) assignment.getRExpression();
            op = binOp.getOperationTokenType();
            if (!associativeOperators.containsKey(type.getCanonicalText()))
                return null;
            opData = associativeOperators.get(type.getCanonicalText()).get(op);
            if (opData == null)
                return null;
            expr1 = binOp.getLOperand();
            expr2 = binOp.getROperand();
            if (!isTypeAllowedForReduce(accumulator, expr1.getType()))
                return null;
            if (expr2 == null || !isTypeAllowedForReduce(accumulator, expr2.getType()))
                return null;
            format = "%s " + operatorToString(op) + " %s";
        } else if (assignment.getRExpression() instanceof PsiMethodCallExpression) {
            // Check that accumulator is valid as a method call
            PsiMethodCallExpression mce = (PsiMethodCallExpression) assignment.getRExpression();
            if (mce == null)
                return null;
            // Resolve to the method declaration to verify the annotation for associativity
            PsiElement element = mce.getMethodExpression().resolve();
            if (element == null || !(element instanceof PsiMethod))
                return null;
            PsiMethod method = (PsiMethod) element;
            // Operation must be method defined in a class
            PsiElement parent = method.getParent();
            if (!(parent instanceof PsiClass))
                return null;
            // Method must have a return value with type same as accumulator
            if (method.getReturnType() == null || !isTypeAllowedForReduce(accumulator, method.getReturnType()))
                return null;
            // Method must have more than 1 parameter
            if (method.getParameterList().getParametersCount() == 0 && mce.getArgumentList().getExpressions().length == 0)
                return null;
            // First method parameter must be same type as accumulator
            if (!isTypeAllowedForReduce(accumulator, method.getParameterList().getParameters()[0].getType()))
                return null;
            if (isStatic(method)) {
                // Static methods have 2 params
                if (method.getParameterList().getParametersCount() != 2 && mce.getArgumentList().getExpressions().length != 2)
                    return null;
                // Second method parameter must be same type as accumulator
                if (!isTypeAllowedForReduce(accumulator, method.getParameterList().getParameters()[1].getType()))
                    return null;
                expr1 = ParenthesesUtils.stripParentheses(mce.getArgumentList().getExpressions()[0]);
                expr2 = ParenthesesUtils.stripParentheses(mce.getArgumentList().getExpressions()[1]);
            } else {
                // Non-static methods have 1 param
                if (method.getParameterList().getParametersCount() != 1 && mce.getArgumentList().getExpressions().length != 1)
                    return null;
                expr1 = ParenthesesUtils.stripParentheses(mce.getMethodExpression().getQualifierExpression());
                expr2 = ParenthesesUtils.stripParentheses(mce.getArgumentList().getExpressions()[0]);
            }
            if (expr1 == null || !isTypeAllowedForReduce(accumulator, expr1.getType()))
                return null;
            if (expr2 == null || !isTypeAllowedForReduce(accumulator, expr2.getType()))
                return null;
            opData = getAssociativeOperation(method);
            if (opData == null)
                return null;
            if (isStatic(method)) {
                format = ((PsiClass) parent).getQualifiedName() + '.' + method.getName() + "(%s, %s)";
            } else {
                format = "%s." + method.getName() + "(%s)";
            }
        } else
            return null;
    } else
        return null;
    boolean reversed;
    PsiExpression returnExpr;
    boolean ref1 = ExpressionUtils.isReferenceTo(expr1, accumulator);
    boolean ref2 = ExpressionUtils.isReferenceTo(expr2, accumulator);
    if (ref1 & !ref2) {
        reversed = false;
        returnExpr = expr2;
    } else if (ref2 & !ref1) {
        reversed = true;
        returnExpr = expr1;
    } else
        return null;
    return new ReductionData(accumulator, returnExpr, opData, format, reversed);
}

[Buggy Hunk]
if (accumulator == null) return null;

[Patch]
if (!(accumulator instanceof PsiLocalVariable)) return null;