This change, and the non-terminal ConditionalAndExpression in the grammar rule for a guarded pattern, ensure that, for example, the expression e instanceof String s && s.length() > 1 continues to unambiguously parse as the expression (e instanceof String s) && (s.length() > 1). If the trailing && is intended to be part of a guarded pattern then the entire pattern should be parenthesized, e.g., e instanceof (String s && s.length() > 1).
i.intValue() > 3 в данном примере является частью guarded паттерна (Integer i && i.intValue() > 3)
We also change the grammar for
instanceofexpressions to:This change, and the non-terminal
ConditionalAndExpressionin the grammar rule for a guarded pattern, ensure that, for example, the expressione instanceof String s && s.length() > 1continues to unambiguously parse as the expression(e instanceof String s) && (s.length() > 1). If the trailing&&is intended to be part of a guarded pattern then the entire pattern should be parenthesized, e.g.,e instanceof (String s && s.length() > 1).i.intValue() > 3в данном примере является частью guarded паттерна(Integer i && i.intValue() > 3)Все верно, можете посмотреть JEP: 406 секцию Guarded and parenthesized patterns
Да, 8ка наше все. Думаю что очень много проектов еще на ней.
Кстати, в свое время мигрировали с 8 на 11 без особых проблем)