private static boolean compareModifiers()

in tools/javac/ApiComparator.java [273:298]


    private static boolean compareModifiers(Node node, Set<Modifier> a, Set<Modifier> b) {
        if (node.diff != Diff.NONE) return true;

        // Breaking changes
        node.check(a.contains(PUBLIC) && !b.contains(PUBLIC), "decreased visibility");
        node.check((!a.contains(ABSTRACT) && b.contains(ABSTRACT)) ||
                (a.contains(DEFAULT) && !b.contains(DEFAULT)), "made abstract");
        node.check(!a.contains(FINAL) && b.contains(FINAL), "made final");
        node.check(a.contains(STATIC) != b.contains(STATIC), "changed static");
        if (node.diff != Diff.NONE) {
            node.compatibility = Compatibility.MAJOR;
            node.messages.add(Message.BREAKING_CHANGES);
            return true;
        }

        // Compatible changes
        node.check(!a.contains(PUBLIC) && b.contains(PUBLIC), "increased visibility");
        node.check((a.contains(ABSTRACT) && !b.contains(ABSTRACT)) ||
                (!a.contains(DEFAULT) && b.contains(DEFAULT)), "made non-abstract");
        node.check(a.contains(FINAL) && !b.contains(FINAL), "made non-final");
        if (node.diff != Diff.NONE) {
            node.compatibility = Compatibility.MINOR;
            return true;
        }
        return false;
    }