Skip to content

Comments

refactor: avoid generating getters for "constants"#102

Open
Fiouz wants to merge 1 commit intonebula-plugins:mainfrom
Fiouz:remove_getters_for_public_constants
Open

refactor: avoid generating getters for "constants"#102
Fiouz wants to merge 1 commit intonebula-plugins:mainfrom
Fiouz:remove_getters_for_public_constants

Conversation

@Fiouz
Copy link

@Fiouz Fiouz commented Oct 7, 2022

It is unlikely that the original intent was to expose getters such as getBUILT_BY_PROPERTY(), so change those properties to public fields, for the benefit of a clearer API, and more idiomatic integration with statically compiled languages.

https://docs.groovy-lang.org/docs/groovy-3.0.13/html/documentation/#_fields_and_properties

That change is source-compatible with existing dynamically compiled Groovy, but breaks compatibility with any statically compiled language (including Groovy with @CompileStatic): as the getters are removed, they now need to refer to the newly exposed fields.

It is unlikely that the original intent was to expose getters such as
`getBUILT_BY_PROPERTY()`, so change those properties to public fields,
for the benefit of a clearer API, and more idiomatic integration with
statically compiled languages.

https://docs.groovy-lang.org/docs/groovy-3.0.13/html/documentation/#_fields_and_properties

That change is source-compatible with existing dynamically compiled
Groovy, but breaks compatibility with any statically compiled language
(including Groovy with @CompileStatic): as the getters are removed, they
now need to refer to the newly exposed fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant