Skip to content

Compiler manager should use providers #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Feb 2, 2024

To figure out presence of component,
and if construction fails, report some
sane(r) message tham obvious false
information: "compiler not present".

To figure out presence of component,
and if construction fails, report some
sane(r) message tham obvious false
information: "compiler not present".
@cstamas
Copy link
Member Author

cstamas commented Feb 2, 2024

Sisu in general is fully lazy: see https://eclipse.github.io/sisu.inject/apidocs/reference/org/eclipse/sisu/BeanEntry.html

The Provider<C> is JSR330 wrapper of that above, calling into BeanEntry#getProvider(). Presence of BeanEntry means "bean is registered" (i.e. via index). But, beans in Sisu are always lazily created (unless is eager singleton).

Doing Map<String, MyComponent>.get("akey") builds upon these, and in case of construction failure it "pretends" that bean is not present, returns null as per Map contract. Note that all the map values are lazy, created ONLY when you do Map.get


// it exists: as provider is found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that not mean that it is NOT there if it is null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, yes, bad worded comments but i hope the intent is clear 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove or move down into the if case (code speaks for itself?)

@kriegaex
Copy link
Contributor

kriegaex commented Feb 3, 2024

Superseded by #361. Thank you so much, @cstamas.

@cstamas cstamas closed this Feb 17, 2024
@cstamas cstamas deleted the compiler-manager-use-provider branch February 17, 2024 15:39
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.

3 participants