Skip to content

Commit 69a9295

Browse files
authored
fix requires retention (#769)
1 parent 72bcb2e commit 69a9295

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

inject/src/main/java/io/avaje/inject/RequiresBean.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
44
import static java.lang.annotation.ElementType.METHOD;
55
import static java.lang.annotation.ElementType.TYPE;
6+
import static java.lang.annotation.RetentionPolicy.CLASS;
67
import static java.lang.annotation.RetentionPolicy.RUNTIME;
7-
import static java.lang.annotation.RetentionPolicy.SOURCE;
88

99
import java.lang.annotation.Repeatable;
1010
import java.lang.annotation.Retention;
@@ -30,7 +30,7 @@
3030
* <p>In the sample above the MyService bean will get wired only if a bean of type {@code
3131
* OtherService} is already registered in the {@link BeanScope}.
3232
*/
33-
@Retention(SOURCE)
33+
@Retention(CLASS)
3434
@Repeatable(RequiresBean.Container.class)
3535
@Target({TYPE, METHOD, ANNOTATION_TYPE})
3636
public @interface RequiresBean {

inject/src/main/java/io/avaje/inject/RequiresProperty.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
44
import static java.lang.annotation.ElementType.METHOD;
55
import static java.lang.annotation.ElementType.TYPE;
6+
import static java.lang.annotation.RetentionPolicy.CLASS;
67
import static java.lang.annotation.RetentionPolicy.RUNTIME;
7-
import static java.lang.annotation.RetentionPolicy.SOURCE;
88

99
import java.lang.annotation.Repeatable;
1010
import java.lang.annotation.Retention;
@@ -40,7 +40,7 @@
4040
* If no ConfigPropertyPlugin is found then the default implementation is used which uses
4141
* {@link System#getProperty(String)} and {@link System#getenv(String)}.
4242
*/
43-
@Retention(SOURCE)
43+
@Retention(CLASS)
4444
@Repeatable(RequiresProperty.Container.class)
4545
@Target({TYPE, METHOD, ANNOTATION_TYPE})
4646
public @interface RequiresProperty {

0 commit comments

Comments
 (0)