Class ComparisonOutOfRange

    • Constructor Detail

      • ComparisonOutOfRange

        public ComparisonOutOfRange()
    • Method Detail

      • describe

        public Description describe​(com.sun.source.tree.BinaryTree tree,
                                    VisitorState state)
        Suggested fixes are as follows. For the byte case, convert the literal to its byte representation. For example, "255" becomes "-1. For the character case, replace the comparison with "true"/"false" since it's not clear what was intended and that is semantically equivalent.

        TODO(eaftan): Suggested fixes don't handle side-effecting expressions, such as (d = reader.read()) == -1. Maybe add special case handling for assignments.