Skip to main content



      Home
Home » Modeling » TMF (Xtext) » JvmTypeReference and eIsProxy
JvmTypeReference and eIsProxy [message #1696704] Thu, 28 May 2015 02:20 Go to next message
Eclipse UserFriend
Hi

while working on https://bugs.eclipse.org/bugs/show_bug.cgi?id=468174 I
noted that in the JvmTypesBuilder in two places eIsProxy() is checked on
a JvmTypeReference; from what I understand, a JvmTypeReference will
never be a proxy, since it represents a reference, but it is not an EMF
reference itself; it is the contained JvmType that can be a proxy.

In particular, in the implementation of toGetter you read

if (typeRef != null && !typeRef.eIsProxy() &&
!InferredTypeIndicator.isInferred(typeRef)
&& typeRef.getType()!=null
&& !typeRef.getType().eIsProxy() &&
"boolean".equals(typeRef.getType().getIdentifier())) {
prefix = "is";
}

I guess the intention here is not to trigger type resolution, but indeed
type resolution is triggered by typeRef.getType() (and again,
typeRef.eIsProxy() will always return false.

Shouldn't JvmTypeReference.eIsProxy() be implemented in terms of
"type.eIsProxy()"?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: JvmTypeReference and eIsProxy [message #1696773 is a reply to message #1696704] Thu, 28 May 2015 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Yes, that's a bug.
Re: JvmTypeReference and eIsProxy [message #1696777 is a reply to message #1696773] Thu, 28 May 2015 10:04 Go to previous messageGo to next message
Eclipse UserFriend
On 28/05/2015 15:46, Sven Efftinge wrote:
> Yes, that's a bug.

OK, I'll submit a bug shortly, with a patch proposal:
at least, I think the important thing is that scoping is not triggered
on the original type reference, but on the cloned one.

I'm not planning to touch eIsProxy implementation.

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: JvmTypeReference and eIsProxy [message #1696780 is a reply to message #1696777] Thu, 28 May 2015 10:13 Go to previous messageGo to next message
Eclipse UserFriend
using typeRef.eGet(TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE, false) and checking what is returned for eIsProxy should work.
Re: JvmTypeReference and eIsProxy [message #1696788 is a reply to message #1696780] Thu, 28 May 2015 10:45 Go to previous messageGo to next message
Eclipse UserFriend
On 28/05/2015 16:13, Sven Efftinge wrote:
> using
> typeRef.eGet(TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE,
> false) and checking what is returned for eIsProxy should work.

Hi

I created the bug

https://bugs.eclipse.org/bugs/show_bug.cgi?id=468641

should we continue the discussion there?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: JvmTypeReference and eIsProxy [message #1696797 is a reply to message #1696788] Thu, 28 May 2015 11:01 Go to previous message
Eclipse UserFriend
On 28/05/2015 16:45, Lorenzo Bettini wrote:
> On 28/05/2015 16:13, Sven Efftinge wrote:
>> using
>> typeRef.eGet(TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE,
>> false) and checking what is returned for eIsProxy should work.
>
> Hi
>
> I created the bug
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=468641
>
> should we continue the discussion there?

Because that won't work for XFunctionTypeRef: in that case the returned
value is the list (EObjectContainmentEList) of parameter types...


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Previous Topic:Qualified name for EObject without a name
Next Topic:Trying XText for IntelliJ
Goto Forum:
  


Current Time: Wed Jul 23 14:38:42 EDT 2025

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

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

Back to the top