Bug 494274 - Import Works in 3.4 but not in 3.6
Summary: Import Works in 3.4 but not in 3.6
Status: UNCONFIRMED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-23 05:36 EDT by Simon Eismann CLA
Modified: 2016-05-23 07:38 EDT (History)
1 user (show)

See Also:


Attachments
MWE (10.67 KB, application/zip)
2016-05-23 05:36 EDT, Simon Eismann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Eismann CLA 2016-05-23 05:36:44 EDT
Created attachment 261936 [details]
MWE

in my eclipse plugin project the line

import transforms.Helper;

fails when using version 3.6, but works fine on 3.4. It breaks with the msg:

Cannot find imported compilation unit 'transforms.Helper'

The file is located in a different Project which defines the following extension points in the plugin.xml:

<plugin>
    <extension point="org.eclipse.m2m.qvt.oml.runtime.qvtTransformation">
      <transformation
            file="transforms/Helper.qvto"
            id="NameHelper">
      </transformation>
      <transformation
            file="transforms/AssertHelper.qvto"
            id="AssertHelper">
      </transformation>
   </extension>
   <extension
         point="org.eclipse.m2m.qvt.oml.runtime.qvtTransformationContainer">
      <sourceContainer
            path="transforms">
      </sourceContainer>
   </extension>
</plugin>

I have attatched a MWE that showcases the problem. If you use the luna.target running the Main.java as a Junit Plugin Test works just fine, but using the neon.target it fails. 
This is the first bug i report, please let me know if i messed up anything
Comment 1 Sergey Boyko CLA 2016-05-23 07:14:45 EDT
Hi Simon,

Your question has been answered in QVTO group https://www.eclipse.org/forums/index.php?t=msg&th=1077646&goto=1732895&#msg_1732895


Below are some notes about the case you've provided.

About "org.eclipse.m2m.qvt.oml.runtime.qvtTransformationContainer" extension point. 
It comes in play only for imports inside the deployed plug-in.

Using MWE attachment this means:

Suppose you placed another library 'Helper2.qvto' in 'library/transforms' folder. And then imports this new library from Helper.qvto with the statement:
  import Helper2;

So to correctly locate source for 'Helper2' import QVTO engine will use "org.eclipse.m2m.qvt.oml.runtime.qvtTransformationContainer" extension point from the 'library' plug-in.
Actually it fully repeats the setting "QVT source container" of workspace QVTo plug-ins.
Comment 2 Sergey Boyko CLA 2016-05-23 07:38:36 EDT
About "org.eclipse.m2m.qvt.oml.runtime.qvtTransformation" extension point.

Declaration you've used

   <extension point="org.eclipse.m2m.qvt.oml.runtime.qvtTransformation">
      <transformation
            file="transforms/Helper.qvto"
            id="Helper">
      </transformation>
   </extension>

is only semi-correct even for Luna target platform. 
In case one will try to browse for transformation module (from "Operational QVT Interpreter" launch configuration) it will obtain the error "Cannot find import module 'platfrom:/plugin/Helper'".

The fully correct declaration for Luna target is:

   <extension point="org.eclipse.m2m.qvt.oml.runtime.qvtTransformation">
      <transformation
            file="transforms/Helper.qvto"
            id="transforms.Helper">
      </transformation>
   </extension>

And this declaration is also working for Mars and Neon targets.

As Christopher has described in the news group for Mars release we fixed ambiguities in the interpretation of "org.eclipse.m2m.qvt.oml.runtime.qvtTransformation" extension point. 

Now the 'id' field of the extension point is interpreted exactly as the ID of deployed library/transformation.

So both cases 
 a) id="transforms.Helper" with accompanied 'import transforms.Helper;'
 b) id="Helper" with accompanied 'import Helper;'

are correctly handled in Mars/Neon releases.