| Summary: | Overridden @PC @PD methods do not get called if the overridden version is not annotated | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Remy Suen <remy.suen> | ||||
| Component: | Runtime | Assignee: | platform-runtime-inbox <platform-runtime-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | ob1.eclipse, pwebster | ||||
| Version: | 4.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Remy Suen
Created attachment 201309 [details]
Context tests patch v1
After looking into it in more details, the current behavior is in line with the JSR 330. The JSR does not define PreConstruct / PostDestory annotations, however, it goes into some details for the @Inject annotation. For @Inject annotations it specifies that overridden methods (overridden in the Java language sense) that do not have "@Inject" annotation should be treated as if they remove the "@Inject" annotation from the method definition. See, for instance, test Convertible.Tests.testProtectedMethodNotInjectedWhenOverrideNotAnnotated() in the TCK. Remy, do we have examples in our own code that show this problem? Or do we have API (more or less :-) where we expect the client to subclass (and would need to explicitly tell them in javadoc they *must* extend that method)? PW (In reply to comment #3) > Remy, do we have examples in our own code that show this problem? Or do we > have API (more or less :-) where we expect the client to subclass (and would > need to explicitly tell them in javadoc they *must* extend that method)? None of our DI'd objects are API (they're usually just interfaces instead of abstract classes). For protected and public methods we usually explicitly say whether the client should _extend_ or _override_ it with their own implementations. |