Hi guys,

1. We use Mathematica notation for boolean/Boolean
   properties/fields/variables in our code, which is to append "Q"
   ("Question Mark") to the the name
    1. e.g. visibleQ, restartQ, ...
    2. Advantages are imho:
        1. One does not have to use is.../has.../shall... for different
           names
        2. Maximum brevity...
        3. ...while boolean properties/etc are still easy to spot and
           cannot be confused with non-boolean-properties
2. Maybe something to consider if one has to refactor anyway due to
   this breaking change, if one does not need Java Bean spec
   compatibility...

Cheers,
mg


On 23/04/2023 17:44, Milles, Eric (TR Technology) via dev wrote:

It is described in GROOVY-9382, GROOVY-10133, GROOVY-10707, GROOVY-10821 and possibly others.

"""

This was an intentional change for Groovy 4. There was much discussion and it was noted as a breaking change, but may not have been that prominent in the release notes. There are a few edge cases like isFirstChild() and getFirstChild() with different return types in W3C DOM. Your example above illustrates this same case.

Improving the consistency of boolean and Boolean properties in relation to the Java Bean spec and "developer intuition" (sorry to have to go there) were primary goals.

"""

https://issues.apache.org/jira/browse/GROOVY-10821

Reply via email to