CDI-699 AnnotationLiteral should use privileged actions for reflective operations#390
CDI-699 AnnotationLiteral should use privileged actions for reflective operations#390antoinesd merged 2 commits intojakartaee:masterfrom
Conversation
mkouba
left a comment
There was a problem hiding this comment.
Privileged action must be also used for Class#getDeclaredMethods() - https://github.com/cdi-spec/cdi/blob/master/api/src/main/java/javax/enterprise/util/AnnotationLiteral.java#L78.
Furthermore, I would recommend to create a package-protected final util class SecurityActions and optimize if no SecurityManager is used; see for example https://github.com/weld/core/blob/master/impl/src/main/java/org/jboss/weld/annotated/slim/backed/SecurityActions.java#L37-L43
| /** | ||
| * | ||
| * This class test usage of privileged bloc in {@link javax.enterprise.util.AnnotationLiteral} | ||
| * They launched with Java security Manager. |
There was a problem hiding this comment.
Where do we run this test with a SecurityManager used?
There was a problem hiding this comment.
Ah, you pushed one commit before this PR... c9aedea
There was a problem hiding this comment.
Yes I hesitated but I have several PR to send with SM activated so as this addition doesn't change anything to release and test I found more convenient to have this on the common branch.
|
Aha, |
|
Hm, it seems that |
@manovotn I need 2 test suites because the standard test are doing a lot of reflection and I couldn't activate SM for them. Adding a second test suite was necessary to activate SM for it. I have problem while overriding the standard test so I have to cancel it ( |
Ok but how do you think I can test that? |
I achieved to simplify surefire config and make tests launch clearer by removing |
…e operations Put privileged code block in a specific utility class
|
Isn't this an impl detail? Ofc it's the official spec api, but this doesn't change the contract. So nothing needs to be released spec wise, right? |
@struberg no it is not. User can have his own implementation of |
|
@manovotn yes, the api.jar should get fixed. But that can be done as a simple maintenance release. It doesn't require a new spec revision. |
|
@struberg Yes, we target a "simple API maintenance release" named CDI 2.0.SP1; except that it's probably not so simple because of JCP rules etc. @antoinesd knows more. |
|
@struberg. It's a maintenance release. Doing it in the context of the JCP would have required to launch a MR (more than 60 days). |
|
oki @antoinesd and @mkouba I think we are on the same page. Wenn talking about a cdi-api 'Maintenance Release' I also didn't mean a CDI Spec MR. In any case nothing which requires to involve the EE EC for getting it to the people. |
Addition of privileged bloc in AnnotationLiteral