Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Lom Hillah is currently offline Lom HillahFriend
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 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
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 #555985 is a reply to message #555910] Mon, 30 August 2010 13:19 Go to previous messageGo to next message
Lom Hillah is currently offline Lom HillahFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Gabriel,

Thanks for the clarification you offered. I agree that it makes sense to have those attributes available for other languages as well.

I am interested in getting my hands on the specific metamodel you mentioned, and trying the composite model out as soon as you can provide it. Thanks.

I look forward to hearing from you.

Best regards,
Lom
Re: Tracing java model elements back to source code positions [message #556198 is a reply to message #555985] Tue, 31 August 2010 10:28 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
Messages: 106
Registered: July 2009
Senior Member
Hello Lom,

The source code of source and composite models are already in SVN. -> http://wiki.eclipse.org/MoDisco#Getting_involved
Have a look to plug-ins which name start with org.eclipse.modisco.java.composition.

I will integrate them asap in the nightly build, so you will be able to install them properly. Very Happy

Regards,
Gabriel
Re: Tracing java model elements back to source code positions [message #558495 is a reply to message #556198] Mon, 13 September 2010 08:51 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
Messages: 106
Registered: July 2009
Senior Member
Hello Lom,
Finally a correct nightly build is available with a composite discovery for java projects.
You could test it, however, there is still a strange bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=325083

Regards
Gabriel

Gabriel wrote:
> Hello Lom,
>
> The source code of source and composite models are already in SVN. ->
> http://wiki.eclipse.org/MoDisco#Getting_involved
> Have a look to plug-ins which name start with
> org.eclipse.modisco.java.composition.
>
> I will integrate them asap in the nightly build, so you will be able to
> install them properly. :d
> Regards,
> Gabriel
Re: Tracing java model elements back to source code positions [message #575854 is a reply to message #555910] Mon, 30 August 2010 13:19 Go to previous messageGo to next message
Lom Hillah is currently offline Lom HillahFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Gabriel,

Thanks for the clarification you offered. I agree that it makes sense to have those attributes available for other languages as well.

I am interested in getting my hands on the specific metamodel you mentioned, and trying the composite model out as soon as you can provide it. Thanks.

I look forward to hearing from you.

Best regards,
Lom
Re: Tracing java model elements back to source code positions [message #575870 is a reply to message #575854] Tue, 31 August 2010 10:28 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
Messages: 106
Registered: July 2009
Senior Member
Hello Lom,

The source code of source and composite models are already in SVN. -> http://wiki.eclipse.org/MoDisco#Getting_involved
Have a look to plug-ins which name start with org.eclipse.modisco.java.composition.

I will integrate them asap in the nightly build, so you will be able to install them properly. :d

Regards,
Gabriel
Re: Tracing java model elements back to source code positions [message #576127 is a reply to message #575870] Mon, 13 September 2010 08:51 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
Messages: 106
Registered: July 2009
Senior Member
Hello Lom,
Finally a correct nightly build is available with a composite discovery for java projects.
You could test it, however, there is still a strange bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=325083

Regards
Gabriel

Gabriel wrote:
> Hello Lom,
>
> The source code of source and composite models are already in SVN. ->
> http://wiki.eclipse.org/MoDisco#Getting_involved
> Have a look to plug-ins which name start with
> org.eclipse.modisco.java.composition.
>
> I will integrate them asap in the nightly build, so you will be able to
> install them properly. :d
> Regards,
> Gabriel
Re: Tracing java model elements back to source code positions [message #628749 is a reply to message #576127] Thu, 23 September 2010 22:41 Go to previous messageGo to next message
Lom Hillah is currently offline Lom HillahFriend
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 Go to previous messageGo to next message
Gabriel BARBIER is currently offline Gabriel BARBIERFriend
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
Re: Tracing java model elements back to source code positions [message #628806 is a reply to message #628798] Fri, 24 September 2010 08:35 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Lom,

here is some additional information about the problem you are encountering "String index out of range: -1" :
some fix has just been commited related to a portability issue (Linux, and so may be MacOS too) on java.composition.discoverer. (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=323220). This issue caused some "String index out of range: -1" error on Linux.
Would you please update your MoDisco features to the 20100923 nighlty build and try again ?

Fabien.


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Tracing java model elements back to source code positions [message #628809 is a reply to message #628798] Fri, 24 September 2010 09:06 Go to previous message
Lom Hillah is currently offline Lom HillahFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Gabriel and Fabien,

Thanks for both responses. I just filed the bug, with the involved project as attachment.

I am going to update MoDisco and try the new fix.
Will keep you posted.

Regards,
Lom
Previous Topic:Cobol with Modisco
Next Topic:XML -> EMF
Goto Forum:
  


Current Time: Fri Mar 29 13:41:21 GMT 2024

Powered by FUDForum. Page generated in 0.04172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top