Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] No common supertype error(No common supertype compiler error on generated Java Service wrappers)
[Acceleo] No common supertype error [message #540304] Tue, 15 June 2010 15:09 Go to next message
Frank  is currently offline Frank Friend
Messages: 3
Registered: April 2010
Junior Member
I've tried to create a Java Service Wrapper (using the wizard), but I'm receiving some compile errors.

My Java Service is called UMLServices.
Here's the method that is causing an issue:
public boolean isMarked(Element element, String mark)
{
for (Stereotype stereotype : element.getAppliedStereotypes())
{
if (mark.equalsIgnoreCase(stereotype.getName()))
{
return true;
}
}
for (String keyword : element.getKeywords())
{
if (keyword.equalsIgnoreCase(mark))
{
return true;
}
}

return false;
}

The generated Acceleo mtl file looks like this:

[module umlservices('http://www.eclipse.org/uml2/2.1.0/UML')/]

[query public isMarked(arg0 : Element, arg1 : String) : Boolean
= invoke('com.pwc.us.mda.services.UMLServices', 'isMarked(org.eclipse.uml2.uml.Element, java.lang.String)', Sequence{arg0, arg1}) /]


It seems fine, but the compiler is showing an error:
Type mismatch. No common supertype: (Element), (String)

I've done some debugging and it seems to happen when my service method takes more than one parameter that do not have a common superclass. Why? How can I change my service method or query to get this to work?

Thanks,

Frank
Re: [Acceleo] No common supertype error [message #540506 is a reply to message #540304] Wed, 16 June 2010 12:34 Go to previous messageGo to next message
Frank  is currently offline Frank Friend
Messages: 3
Registered: April 2010
Junior Member
I found that this same code works in a pure Helios Modeling environment.

I get the compile error while in an RSA environment, with the same Acceleo 3.0.X build installed. Does anyone know what plug-in dependency might be causing this?

Re: [Acceleo] No common supertype error [message #540809 is a reply to message #540506] Thu, 17 June 2010 12:28 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010705030905030504020809
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Frank,

Unfortunately, most type checking issues are pure OCL. The best answer I
can give you is : your RSA environment is based on Eclipse 3.4 or 3.5,
thus OCL 1.2 or 1.3. A good number of such issues were fixed with OCL
1.3, even more have been fixed with OCL 3.0 (available in Eclipse 3.6,
Helios).

I believe that what you get here was fixed with OCL 1.3, but I might be
mistaken. Either way, if you cannot upgrade your RSA environment, I
cannot propose any intelligent workaround for this.

Laurent Goubet
Obeo

Frank wrote:
> I found that this same code works in a pure Helios Modeling environment.
>
> I get the compile error while in an RSA environment, with the same
> Acceleo 3.0.X build installed. Does anyone know what plug-in dependency
> might be causing this?
>
>


--------------010705030905030504020809
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010705030905030504020809--
Previous Topic:XtendParser
Next Topic:Accessing a set that's actually a sequence
Goto Forum:
  


Current Time: Thu Apr 25 12:33:29 GMT 2024

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

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

Back to the top