-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add targetPackage property to the @Introspected annotation #9105
Conversation
* @since 3.9.0 | ||
*/ | ||
@Experimental | ||
String introspectionPackage() default ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to targetPackage
@@ -180,6 +180,8 @@ private void processIntrospected(ClassElement element, VisitorContext context, A | |||
Introspected.AccessKind[] accessKinds = introspected.enumValues("accessKind", Introspected.AccessKind.class); | |||
Introspected.Visibility[] visibilities = | |||
introspected.enumValues("visibility", Introspected.Visibility.class); | |||
final String introspectionPackage = introspected.stringValue("introspectionPackage").orElse(element.getPackageName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this package names differ we need to change the default visibility to only public members (see Visibility.PUBLIC
) since package private and protected members will no longer be visible from different packages. In the 4.0.x branch we support reflection as a fall back but not here.
@andriy-dmytruk should I move this PR to ready for review? |
Kudos, SonarCloud Quality Gate passed! |
The property can be used in the following manner:
This can be used when
SomeClass
was built externally but the class was processed by an annotation processor as sources to create introspection metadata (and avoid "signer information does not match signer information of other classes in the same package" error). It can be also used in combination with theclasses
property of the annotation.