Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320486 - Java discoverer : retrieve source regions visited
Summary: Java discoverer : retrieve source regions visited
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Technologies (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 0.9.0 M1   Edit
Assignee: Fabien Giquel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 06:57 EDT by Fabien Giquel CLA
Modified: 2010-10-18 08:33 EDT (History)
3 users (show)

See Also:
fabien.giquel: indigo+


Attachments
Listener mechanism to prepare Java model weaving with kdm one (16.81 KB, patch)
2010-07-22 09:25 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details | Diff
Listener mechanism to prepare Java model weaving with kdm one (14.57 KB, patch)
2010-07-23 06:05 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabien Giquel CLA 2010-07-21 06:57:33 EDT
In order to prepare the weaving with kdm.source models (files representation), the Java discoverer must be instrumented in order to retrieve the source regions informations (startPosition, startLine, ...) outside of the discoverer.

Such a need will appear for other discoverers, so a generic mechanism may be provided for such informations retrieving.
Comment 1 Nicolas Guyomar CLA 2010-07-22 09:24:40 EDT
Hi Fabien,

Please find attached a generic mechanism of listeners in order to prepare the weaving between kdl.source models and MoDisco Java ones

The Java Reader now raises a flag each time a Compilation Unit is computed. Those events can be captured simply by adding a SourceVisitListener to the used JavaDiscoverer instance

Projects concerned by this patch are : 

org.eclipse.gmt.modisco.infra.discoverymanager
org.eclipse.gmt.modisco.java.discoverer

1. I, Nicolas Guyomar, and others contributors listed in this bug, authored
100% of the content
2. I have the rights to donate the content to Eclipse under the EPL
3. I have already provided the filled Employer Consent Forms to the Foundation

Regards

Nicolas
Comment 2 Nicolas Guyomar CLA 2010-07-22 09:25:32 EDT
Created attachment 174972 [details]
Listener mechanism to prepare Java model weaving with kdm one
Comment 3 Fabien Giquel CLA 2010-07-22 13:42:18 EDT
Hi Nicolas,
thanks for the contribution.

There is something wrong in your implementation of observable/observer pattern :
- the SourceVisitListener should only be an interface in infrastructure.
- the infrastructure must not reference any project from the Java layer.

PS : the Java discoverer has been slightly modified (fix on bug 309606) since you have created the patch. Could you synchronize and create again the patch ?

Fabien.
Comment 4 Nicolas Guyomar CLA 2010-07-23 06:05:45 EDT
Created attachment 175047 [details]
Listener mechanism to prepare Java model weaving with kdm one

This version of the patch does not referenced java layer component
SourceVisitListener is now an interface
Comment 5 Fabien Giquel CLA 2010-07-23 06:44:06 EDT
Now everything looks good. Thanks !

The fix has been commited into SVN.
Comment 6 Hugo Bruneliere CLA 2010-10-05 04:22:14 EDT
The patch has been successfully applied.