Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 303036 - implements IJavaModelQuery may be done by a superclass
Summary: implements IJavaModelQuery may be done by a superclass
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Main (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.8.0 M6   Edit
Assignee: Gregoire Dupe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-17 04:23 EST by Bertrand Daru CLA
Modified: 2011-05-23 09:11 EDT (History)
4 users (show)

See Also:
nicolas.bros: helios+


Attachments
patch for org.eclipse.gmt.modisco.infra.query.core.java. JavaModelQueryFactory (905 bytes, patch)
2010-02-17 04:23 EST, Bertrand Daru CLA
gdupe: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Daru CLA 2010-02-17 04:23:19 EST
Created attachment 159280 [details]
patch for org.eclipse.gmt.modisco.infra.query.core.java. JavaModelQueryFactory

If I provide a class A for a JavaModelQuery witch inherits from a class B witch implements IJavaModelQuery, i obtain the following error : "A does not implement IJavaModelQuery."

I suggest to use the method isAssignableFrom instead of getInterfaces from the class Class. The method isAssignableFrom take care of all interfaces implemented by a class whereas getInterfaces scopes only on interfaces declared by the class.

A patch proposition is join.
Comment 1 Gregoire Dupe CLA 2010-02-18 04:33:12 EST
Hi,

This bug has been fixed by applying the proposed patch and a unit test has been created to avoid regressions.

Regards,
Grégoire
Comment 2 Hugo Bruneliere CLA 2010-03-10 05:51:42 EST
Patch applied and new test created.