Home » Modeling » MoDisco » Tracing Java model elements back to source code positions(How to retrieve source code positions for extracted Java model from version 0.8? )
Tracing Java model elements back to source code positions [message #555692] |
Fri, 27 August 2010 16:38 |
Lom Hillah Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi,
I found out that in the new extracted Java model (from Modisco 0.8), some attributes related to original source code positions of the model elements are no longer provided (which were in j2se5 model). They are:
- originalColumnNumber
- originalLastLineNumber
- originalLength
- originalLineNumber
- originalStartPosition
We now get originalCompilationUnit and originalClassFile instead.
What motivated the removal of the aforementioned attributes?
Since we need them in our transformation project,
is there a way to retrieve them again using Modisco?
Thanks.
Cheers,
Lom
[Updated on: Fri, 27 August 2010 20:20] Report message to a moderator
|
|
|
Re: Tracing java model elements back to source code positions [message #555910 is a reply to message #555692] |
Mon, 30 August 2010 08:04 |
Gabriel BARBIER Messages: 106 Registered: July 2009 |
Senior Member |
|
|
Hello Lom,
I'm glad that you used to use the java model. So here is some explanation of these attributes removal: these attributes
have been considered as technical (and not java, because it is common to all languages), so it would be common sense to
have them for all kind of source files. It means that we have specific metamodel for such things (to represents source
files), and to link a java model with source model, a composite model has been defined. However, as the work was not
complete for the 0.8 it had not been released. It is still under development, but some experimentation will be soon
available in the SVN repository (it you are interested, we may deliver it to you sooner).
Regards,
Gabriel
Lom Hillah wrote:
> Hi,
>
> I found out that in the new extracted java model (from Modisco 0.8),
> some attributes related to original source code positions of the model
> elements are no longer provided (which were in j2se5 model). They are:
> - originalColumnNumber
> - originalLastLineNumber
> - originalLength
> - originalLineNumber
> - originalStartPosition
>
> We now get originalCompilationUnit and originalClassFile instead.
> What motivated the removal of the aforementioned attributes?
> Since we need them in our transformation project, is there a way to
> retrieve them again using Modisco?
>
> Thanks.
>
> Cheers,
> Lom
|
|
| | | | | | |
Re: Tracing java model elements back to source code positions [message #628749 is a reply to message #576127] |
Thu, 23 September 2010 22:41 |
Lom Hillah Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hello Gabriel,
Many thanks for the updates. I tried the discovery on a project and here is a report of what I encountered. I am using MoDisco Java Feature (Incubation) 0.9.0.v201009221209 in Eclipse Helios 20100617-1415, on Mac OS X 10.6.4.
1- When I tried "Discover Java and inventory model..." I got the following error: An internal error occurred during: "Java Composition Discoverer is working ...".
String index out of range: -1
2- When I tried "Discover KDM code model .." or "Discover KDM source model..." I got the models. But the position info are not set in the SourceRegion of model elements, in the action package for instance. When I navigate in a BlockUnit for example, its startLine, starPosition, etc. are not set.
Do you want me to send the example project through a bug report?
Thanks.
Regards,
Lom
[Updated on: Thu, 23 September 2010 22:49] Report message to a moderator
|
|
|
Re: Tracing java model elements back to source code positions [message #628798 is a reply to message #628749] |
Fri, 24 September 2010 08:02 |
Gabriel BARBIER Messages: 106 Registered: July 2009 |
Senior Member |
|
|
Hello Lom,
It would be great if you could post a bug with your project, especially for the java discovery bug.
The discovery of KDM code model corresponds to a transformation of java model into KDM (focus on java code, statements,
expressions, etc). The discovery of KDM source model corresponds to a view of your folders and files (not the content of
the files). That's why you don't have the information of position in these models.
Regards
Gabriel
Lom Hillah wrote:
> Hello Gabriel,
>
> Many thanks for the updates. I tried the discovery on a project and here
> is a report of what I encountered. I am using MoDisco Java Feature
> (Incubation) 0.9.0.v201009221209 in Eclipse Helios 20100617-1415, on Mac
> OS X 10.6.4.
>
> 1- When I tried "Discover Java and inventory model..." I got the
> following error: An internal error occurred during: "Java Composition
> Discoverer is working ...".
> String index out of range: -1
>
> 2- When I tried "Discover KDM code model .." or "Discover KDM source
> model..." I got the models. But the position info are not set in the
> SourceRegion of model elements, in the action package for instance. When
> I navigate in a BlockUnit for example, its startLine, starPosition, etc.
> are not set.
>
> Do you want me to send you the example project?
>
> Thanks.
>
> Regards,
> Lom
|
|
| | |
Goto Forum:
Current Time: Wed Sep 25 20:56:21 GMT 2024
Powered by FUDForum. Page generated in 0.06175 seconds
|