Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339513 - InjectorImpl, isOverridden: checks method with itself instead of childClass Method
Summary: InjectorImpl, isOverridden: checks method with itself instead of childClass M...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: E4 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 08:06 EST by Mike Moor CLA
Modified: 2012-12-13 15:00 EST (History)
1 user (show)

See Also:


Attachments
Patch (4.54 KB, patch)
2011-04-05 13:26 EDT, Oleg Besedin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Moor CLA 2011-03-10 08:06:09 EST
Build Identifier: org.eclipse.e4.core.di_0.9.0.v20101202-1530.jar

In the isOverridden-Method of the org.eclipse.e4.internal.di.InjectorImpl class: An annotated method is checkt for a child-class-method which overrides the given method. This is done by checking for the same name and the same parameter types. when it comes to the parameter-type-check the following happens:
int methodParamsLength = method.getParameterTypes().length;// method is the annotated method
a few lines later:
Class<?>[] candidateParams = method.getParameterTypes(); // method is still the annotated method buth should be the candidate-method.
Then the two array-lenghts are compared:
if (candidateParams.length != methodParamsLength)
  continue;
This is allways true!

Reproducible: Always

Steps to Reproduce:
1. Create a abstract class X with a method buildUi annotated with @PostConstruct
2. Create a part class Y extends X with a method buildUi(Composite parent)
3. When the port Y is injected, the annotated method buildUi of X isn't called
Comment 1 Oleg Besedin CLA 2011-04-05 13:26:37 EDT
Created attachment 192580 [details]
Patch

Fix + JUnit
Comment 2 Oleg Besedin CLA 2011-04-05 13:28:52 EDT
Patch applied to CVS Head. Thanks for taking time to figure out cause of the problem!