Skip to content

Fix @Requires Retention #769

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

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inject/src/main/java/io/avaje/inject/RequiresBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.SOURCE;

import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
Expand All @@ -30,7 +30,7 @@
* <p>In the sample above the MyService bean will get wired only if a bean of type {@code
* OtherService} is already registered in the {@link BeanScope}.
*/
@Retention(SOURCE)
@Retention(CLASS)
@Repeatable(RequiresBean.Container.class)
@Target({TYPE, METHOD, ANNOTATION_TYPE})
public @interface RequiresBean {
Expand Down
4 changes: 2 additions & 2 deletions inject/src/main/java/io/avaje/inject/RequiresProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static java.lang.annotation.RetentionPolicy.SOURCE;

import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
Expand Down Expand Up @@ -40,7 +40,7 @@
* If no ConfigPropertyPlugin is found then the default implementation is used which uses
* {@link System#getProperty(String)} and {@link System#getenv(String)}.
*/
@Retention(SOURCE)
@Retention(CLASS)
@Repeatable(RequiresProperty.Container.class)
@Target({TYPE, METHOD, ANNOTATION_TYPE})
public @interface RequiresProperty {
Expand Down
Loading