Skip to content

Commit

Permalink
Change default behavior of RegisterForReflection ignoreNested attribu…
Browse files Browse the repository at this point in the history
…te to false.
  • Loading branch information
humcqc committed Feb 7, 2024
1 parent 10e803a commit a69985f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

/**
* Annotation that can be used to force a class to be registered for reflection in native image mode.
* Note that by default nested classes and interfaces are registered too.
* If you have performance concerns, you can use {@link #ignoreNested()} = true.
* Similarly, by default only the class itself is registered, not the full class hierarchy. This can be changed by setting
* {@link #registerFullHierarchy()} to true.
* Note that by default the class itself is registered including nested classes and interfaces,
* but not the full class hierarchy. This can be changed by setting:
* {@link #ignoreNested()} to true, to ignore nested classes.
* {@link #registerFullHierarchy()} to true, to register the full hierarchy.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
@RegisterForReflection(ignoreNested = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ModelWithSerializerAndDeserializerOnField {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
@RegisterForReflection(ignoreNested = true)
public class ModelWithSerializerAndDeserializerOnField {

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Only Parent Class will be registered and none of the inner classes will be registered for reflection.
*/
@RegisterForReflection
@RegisterForReflection(ignoreNested = true)
class ResourceA {

private class InnerClassOfA {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* This class is registering targets = ResourceD.StaticClassOfD
* The class itself won't be registered by this, only target will be registered without registering nested classes
*/
@RegisterForReflection(targets = ResourceD.StaticClassOfD.class)
@RegisterForReflection(targets = ResourceD.StaticClassOfD.class, ignoreNested = true)
public class ResourceC {

private class InaccessibleClassOfC {
Expand Down

0 comments on commit a69985f

Please sign in to comment.