[code-reflection] RFR: 8324789: Add line number information to code models [v2]

Paul Sandoz psandoz at openjdk.org
Thu Apr 25 20:03:59 UTC 2024


On Thu, 25 Apr 2024 10:34:49 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> I was pondering aliasing `null`, such as `static final Location NOLOCATION = null`.
>
>> I was pondering aliasing `null`, such as `static final Location NOLOCATION = null`.
> 
> Ok. As long as the javadoc captures the intended semantics, I don't have a strong preference. Maybe a mild one for `Optional` given that (a) using nulls will cause NPEs (given this info truly is optional), and (b) having a "no location" singleton is equally odd (what's it's source/column number?). So, denoting absence as just absence seems (slightly) better from a modelling perspective.

I'll follow up with another PR. At the moment it lacks clarity, we should lean more into `null` or `Optional` to signal absence.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/54#discussion_r1580057650


More information about the babylon-dev mailing list