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

Property lookupIfMissing in LookupUnlessProperty has wrong documentation #31863

Closed
jesantana opened this issue Mar 15, 2023 · 4 comments · Fixed by #31868
Closed

Property lookupIfMissing in LookupUnlessProperty has wrong documentation #31863

jesantana opened this issue Mar 15, 2023 · 4 comments · Fixed by #31868
Labels
area/arc Issue related to ARC (dependency injection) area/documentation kind/bug Something isn't working
Milestone

Comments

@jesantana
Copy link
Contributor

jesantana commented Mar 15, 2023

Describe the bug

LookupUnlessProperty instantiate a bean unless the given property has the given value. For example in the following case

@LookupUnlessProperty(name = "skip-processor", stringValue = "true")
public class ProcessorService ...

The bean ProcessorService is only created when we have declared kahoot.gameplay.event.skip-dlq-events in our properties to some other value than true. Now if we didn't declare this property and we still want the bean to be created we can set lookupIfMissing = true to extend the bean "creation range"

However, the documentation of this attribute says

Determines if the bean should be suppressed when the property name specified by name has not been specified at all

which is the opposite behavior to what is ocurring

Expected behavior

The documentation should say

Determines if the bean should be looked up when the property name specified by name has not been specified at all

Actual behavior

The documentation should say

Determines if the bean should be suppressed when the property name specified by name has not been specified at all

How to Reproduce?

Create a bean with the following config

@LookupUnlessProperty(name = "skip-processor", stringValue = "true", lookupIfMissing = true)
public class ProcessorService ...

and don't provide property skip-processor and verify that the bean is created.

Output of uname -a or ver

inux desktop-df8dhmh.home 6.1.12-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 15 04:35:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.5" 2022-10-18 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.1

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.4.2

Additional information

I can provide a pull request to change it if you agree

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 15, 2023

/cc @MichalMaler (documentation), @ebullient (documentation), @hmanwani-rh (documentation), @inoxx03 (documentation), @michelle-purcell (documentation), @sheilamjones (documentation), @sunayna15 (documentation)

@geoand geoand added the area/arc Issue related to ARC (dependency injection) label Mar 15, 2023
@geoand
Copy link
Contributor

geoand commented Mar 15, 2023

@jesantana would you like to contribute a doc fix?

@jesantana
Copy link
Contributor Author

Sure, working on it!

@jesantana
Copy link
Contributor Author

This should solve it --> #31868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/documentation kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants