Skip to content
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

Fix optional injection bugs #516

Merged
merged 5 commits into from
Oct 24, 2020
Merged

Fix optional injection bugs #516

merged 5 commits into from
Oct 24, 2020

Commits on Oct 13, 2020

  1. Add tests for @nAmed Optional bug

    OptionalActiveDescriptor does seem to use @nAmed injection for it's
    wrapped value.
    As a consequence both unnamed and other named bindings for the same type
    are/may be injected when the actual binding is missing/present.
    
    Signed-off-by: Balthasar Schüss <mail@bschuess.dev>
    BCSol committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    ae9405b View commit details
    Browse the repository at this point in the history
  2. Fix optional injection bug dropping @nAmed qualifiers

    Signed-off-by: Balthasar Schüss <mail@bschuess.dev>
    BCSol committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    f8923de View commit details
    Browse the repository at this point in the history
  3. Adding tests for broken nested Optional injection.

    Trying to inject Optional<Optional<String>> one might expect the
    following:
    bound literal String
    	-> expected Optional<Optional<String>
    	-> actual Optional<Optional.empty>
    bound Optional<Optional<String>
    	-> expected Optional<Optional<String>>
    	-> actual Optional<Optional<Optional>>>
    Furthermore, one might expect that more specific bindings take
    precedence over less specific bindings, that is also not the case
    
    It is true that nested Optionals is not a common use case, but the
    precedence should be implemented either way.
    
    Signed-off-by: Balthasar Schüss <mail@bschuess.dev>
    BCSol committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    32d8e2f View commit details
    Browse the repository at this point in the history
  4. Add test: OptionalInjection fails to retrieve bound guice services

    If a guice service is injected as optional into a hk2 service.
    Guice services are never injected and Optional is always empty.
    
    Signed-off-by: Balthasar Schüss <mail@bschuess.dev>
    BCSol committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    8ab9183 View commit details
    Browse the repository at this point in the history
  5. Fix Optional Injection for nested and guice dependent optionals.

    Signed-off-by: Balthasar Schüss <mail@bschuess.dev>
    BCSol committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    60d6585 View commit details
    Browse the repository at this point in the history