graal icon indicating copy to clipboard operation
graal copied to clipboard

[GR-52129] Augment RuntimeClassInitialization#initializeAtBuildTime javadoc

Open zakkak opened this issue 1 year ago • 4 comments

Document that using "" as the package name results in all packages and classes being registered for build time initialization.

zakkak avatar Jan 23 '24 08:01 zakkak

Thanks for the PR, @zakkak. Aren't you documenting more of a bug or do you actually make use of this? Registering everything for build-time initialization seems rather dangerous.

fniephaus avatar Jan 23 '24 09:01 fniephaus

Thanks for the PR, @zakkak. Aren't you documenting more of a bug or do you actually make use of this? Registering everything for build-time initialization seems rather dangerous.

This is actually a feature for Quarkus, one that we specifically requested to keep being able to use when the option to use --initialize-at-build-time without arguments was deprecated (https://github.com/oracle/graal/commit/5013ca7c9d88bd12de2ebd24e3196a40d9044c9c).

Although build-time initialization can be a double-edged sword Quarkus is still using it by default for all classes due to its benefits despite requiring more work to be done on the framework side.

Corresponding Quarkus Issue https://github.com/quarkusio/quarkus/issues/17887

zakkak avatar Jan 23 '24 10:01 zakkak

Understood. From a pure user's perspective, this is still concerning: what if users calculate the value dynamically and it happens to be "". Similar to null values, maybe we want to guard from accidental misuse somehow? What do you think, @vjovanov?

fniephaus avatar Jan 23 '24 10:01 fniephaus

I don't see another way without making a breaking change. I would not be worried as this is used only by the power users.

vjovanov avatar Jan 25 '24 09:01 vjovanov