Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 301035 - Proposed patch : Interface for Java Model Query should be parameterized
Summary: Proposed patch : Interface for Java Model Query should be parameterized
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.8.0 M6   Edit
Assignee: Gregoire Dupe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-27 13:02 EST by Bertrand Daru CLA
Modified: 2011-05-23 09:14 EDT (History)
4 users (show)

See Also:
nicolas.bros: helios+


Attachments
patch proposed (4.17 KB, application/octet-stream)
2010-01-27 13:02 EST, Bertrand Daru CLA
no flags Details
patch proposing a new version of IJavaModelQuery using parameterized types (4.17 KB, patch)
2010-01-27 13:05 EST, Bertrand Daru CLA
gdupe: iplog+
Details | Diff
example of two implementation classes modified (1.38 KB, application/x-zip-compressed)
2010-01-27 13:06 EST, Bertrand Daru CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Daru CLA 2010-01-27 13:02:19 EST
Created attachment 157428 [details]
patch proposed

Hi,
I suggest to use two generics types in the interface IJavaModelQuery :
- one for the query evaluation context (a model object like a Classifier)
- one for the return type (anything, String, Integer, model Object ...)

The advantage is for the implementors : the method profil is automatically adjusted by eclipse to the good arguments.

The first attachment contains a new version for the interface, the modification of the adapter, and a new Class for adding helper methods arround the list of parameters, giving a direct access to a parameter from his name.

The second attachment is a zip of two example queries classes modified.

Regards,
Bertrand
Comment 1 Bertrand Daru CLA 2010-01-27 13:05:42 EST
Created attachment 157431 [details]
patch proposing a new version of IJavaModelQuery using parameterized types
Comment 2 Bertrand Daru CLA 2010-01-27 13:06:37 EST
Created attachment 157433 [details]
example of two implementation classes modified
Comment 3 Gregoire Dupe CLA 2010-02-17 08:09:26 EST
Hi,

Thank you for this patch.

This patch has been applied. Tests and examples have been updated.

Regards,
Grégoire Dupé
Comment 4 Hugo Bruneliere CLA 2010-03-10 05:33:23 EST
Patch committed.