Pull to refresh
10
0
Dmitriy Budim@dbudim

Software Development Engineer in Test

Send message

We also change the grammar for instanceof expressions to:

InstanceofExpression:
  RelationalExpression instanceof ReferenceType
  RelationalExpression instanceof PrimaryPattern

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)

Все верно, можете посмотреть JEP: 406 секцию Guarded and parenthesized patterns

Да, 8ка наше все. Думаю что очень много проектов еще на ней.

Кстати, в свое время мигрировали с 8 на 11 без особых проблем)

Information

Rating
Does not participate
Location
Украина
Registered
Activity