File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
core-processor/src/main/java/io/micronaut/inject/beans/visitor
inject-java-test/src/test/groovy/io/micronaut/inject/visitor/beans Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ private ExpressionDef newEnumConstantRef(EnumConstantElement enumConstantElement
517
517
// 2: push enum name
518
518
ExpressionDef .constant (enumConstantElement .getName ()),
519
519
// 3: annotation metadata
520
- enumConstantElement .getAnnotationMetadata () == null ? (
520
+ enumConstantElement .getAnnotationMetadata () == null || enumConstantElement . getAnnotationMetadata (). isEmpty () ? (
521
521
ClassTypeDef .of (AnnotationMetadata .class ).getStaticField ("EMPTY_METADATA" , TypeDef .of (AnnotationMetadata .class ))
522
522
) : getAnnotationMetadataExpression (enumConstantElement .getAnnotationMetadata (), loadClassValueExpressionFn )
523
523
);
Original file line number Diff line number Diff line change @@ -4146,7 +4146,8 @@ public enum Test {
4146
4146
@JsonProperty("Y")
4147
4147
B(1),
4148
4148
@JsonProperty("Z")
4149
- C(2);
4149
+ C(2),
4150
+ D(3);
4150
4151
private final int number;
4151
4152
Test(int number) {
4152
4153
this.number = number;
@@ -4181,6 +4182,7 @@ public enum Test {
4181
4182
enumIntrospection. constants[0 ]. stringValue(JsonProperty ). get() == " X"
4182
4183
enumIntrospection. constants[1 ]. stringValue(JsonProperty ). get() == " Y"
4183
4184
enumIntrospection. constants[2 ]. stringValue(JsonProperty ). get() == " Z"
4185
+ enumIntrospection. constants[3 ]. stringValue(JsonProperty ). isEmpty()
4184
4186
}
4185
4187
4186
4188
void " test enum bean properties with custom getter" () {
You can’t perform that action at this time.
0 commit comments