Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [xcore] String + String operation fails
[xcore] String + String operation fails [message #1560229] Mon, 12 January 2015 13:21 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

I just updated to eclipse 4.4.1 from 4.3.1 and noticed the following new error in my xcore file.

within an operation I have the code:

"select startRecord_s, finishRecord_s, timeStep_s from `" + analysis.database.schema + "`.sim WHERE
id = " + analysis.selection.simulation + ";"

and I get the following error:

Ambiguous binary operation.
The operator declarations
operator_plus(Object, String) in ObjectExtensions and
operator_plus(String, Object) in StringExtensions
both match.

This code was no problem in 4.3.1. Does any one has a glue how to solve the error?

Thanks, Martin
Re: [xcore] String + String operation fails [message #1560257 is a reply to message #1560229] Mon, 12 January 2015 13:44 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
solved after update the target definition to 4.4.1 as well ;)

schrieb Martin Jacob, Am 12.01.2015 14:21:
> Hi,
>
> I just updated to eclipse 4.4.1 from 4.3.1 and noticed the following new error in my xcore file.
>
> within an operation I have the code:
>
> "select startRecord_s, finishRecord_s, timeStep_s from `" + analysis.database.schema + "`.sim WHERE
> id = " + analysis.selection.simulation + ";"
>
> and I get the following error:
>
> Ambiguous binary operation.
> The operator declarations
> operator_plus(Object, String) in ObjectExtensions and
> operator_plus(String, Object) in StringExtensions
> both match.
>
> This code was no problem in 4.3.1. Does any one has a glue how to solve the error?
>
> Thanks, Martin
Re: [xcore] String + String operation fails [message #1586655 is a reply to message #1560257] Tue, 27 January 2015 00:25 Go to previous message
Rainer Menke is currently offline Rainer MenkeFriend
Messages: 7
Registered: July 2009
Junior Member
Hi Martin,

It seems, that I have a similar issue. I created an xcore file, to replace my existing ecore file for the usage of Sirius and Acceleo. I found, that the Acceleo templates now require an explicit calling of toString() in the usage of xcore where in the ecore case a simple access was sufficient. I look on the ecore file, which was generated from the xcore

class ... {
        ...
	@ExtendedMetaData(kind="attribute", name="theme" )
	unique org.eclipse.emf.ecore.xml.^type.String theme
}

and found

    <eStructuralFeatures xsi:type="ecore:EAttribute" name="theme" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/XMLType.ecore#//String">
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="kind" value="attribute"/>
        <details key="name" value="theme"/>
      </eAnnotations>
    </eStructuralFeatures>


whereas in ( original ) ecore it was modelled as

<eStructuralFeatures xsi:type="ecore:EAttribute" name="theme" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="kind" value="attribute"/>
        <details key="name" value="theme"/>
      </eAnnotations>
    </eStructuralFeatures>


It seems like Acceleo is unable to resolve the type of the variable, because the type for it is resolved as null. I think, your issue can belong to this.
Previous Topic:copy deep references
Next Topic:do I have the correct download for the EMF plugin
Goto Forum:
  


Current Time: Fri Apr 26 01:26:55 GMT 2024

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

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

Back to the top