Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » Accessing role class
Accessing role class [message #508415] Mon, 18 January 2010 17:08 Go to next message
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
Hello,

Documentation says:
Quote:

1.2.4.c Using a class literal for a role outside its enclosing team instance requires the following syntax:
teamAnchor.RoleClass.class



Indeed, I had no luck trying various interpretations of the statement above.
myTeamInstance.MyRole.class
MyRole<@myTeamInstance>.class


May you, please, clarify the syntax with an example?
Re: Accessing role class [message #508418 is a reply to message #508415] Mon, 18 January 2010 17:31 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi,

> Documentation says:
> Quote:
>> 1.2.4.c Using a class literal for a role outside its enclosing team
>> instance requires the following syntax: teamAnchor.RoleClass.class
>
>
> Indeed, I had no luck trying various interpretations of the statement
> above.
>
> myTeamInstance.MyRole.class
> MyRole<@myTeamInstance>.class
>
>
> May you, please, clarify the syntax with an example?

Actually there was a change in 1.4.0M1, so syntax depends on the
version you are using:
- in 1.3.2 myTeamInstance.MyRole.class should work as witnessed
by this test:
http://www.objectteams.org/distrib/jacks/1.3.2/results/9.2.3 -otjld-get-
role-method-2g.html
- in 1.4.0M1 we adjusted the syntax to MyRole<@myTeamInstance>.class
see:
http://www.objectteams.org/distrib/jacks/1.4.0M1/results/9.2 .3-otjld-get-
role-method-2g.html

This is a late effect of migrating from path syntax to parameterized
syntax for role types.

So, given that neither version worked for you, this seems to be a
bug that is not detected by our tests. Which version did you use
in this case?

best,
Stephan
Re: Accessing role class [message #508486 is a reply to message #508418] Tue, 19 January 2010 08:08 Go to previous messageGo to next message
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
Stephan Herrmann wrote on Mon, 18 January 2010 12:31
Hi,

Actually there was a change in 1.4.0M1, so syntax depends on the version you are using:
- in 1.3.2 myTeamInstance.MyRole.class should work as witnessed by this test:
http://www.objectteams.org/distrib/jacks/1.3.2/results/9.2.3 -otjld-get-role-method-2g.html


With myTeamInstance.MyRole.class I am getting error:
Cannot use unqualified class literal for role MyRole<@myTeamInstance> outside its enclosing team (OTJLD 6.1(c)).

Stephan Herrmann wrote on Mon, 18 January 2010 12:31

So, given that neither version worked for you, this seems to be a bug that is not detected by our tests. Which version did you use in this case?



I am using 1.3.2 : OTDT Version: 1.3.2 - developed for Eclipse version 3.5.1
Re: Accessing role class [message #508671 is a reply to message #508486] Tue, 19 January 2010 14:14 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
> With myTeamInstance.MyRole.class I am getting error:
> Cannot use unqualified class literal for role MyRole<@myTeamInstance>
> outside its enclosing team (OTJLD 6.1(c)).

Seeing this error message I could reproduce the problem
and improve our tests accordingly.
Yes, its a bug, which I just fixed a minute ago.

Unfortunately, for 1.3.2 I don't see an easy workaround.
FYI, the problem occurs if a role class literal is used outside
the role's team. This is perfectly legal, but our type checker
was over-eager in this regard. Sorry.

thanks for reporting,
Stephan
Re: Accessing role class [message #508672 is a reply to message #508671] Tue, 19 January 2010 19:16 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
> Unfortunately, for 1.3.2 I don't see an easy workaround.

I did find a workaround, add this method to your team:

public Class<MyRole> getMyRoleClass() {
return MyRole.class;
}

Then use myTeamInstance.getMyRoleClass() instead of
myTeamInstance.MyRole.class

Not ideal, but it works with the same semantics as the direct
use of the role class literal.

best,
Stepahn
Re: Accessing role class [message #567698 is a reply to message #508415] Mon, 18 January 2010 17:31 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi,

> Documentation says:
> Quote:
>> 1.2.4.c Using a class literal for a role outside its enclosing team
>> instance requires the following syntax: teamAnchor.RoleClass.class
>
>
> Indeed, I had no luck trying various interpretations of the statement
> above.
>
> myTeamInstance.MyRole.class
> MyRole<@myTeamInstance>.class
>
>
> May you, please, clarify the syntax with an example?

Actually there was a change in 1.4.0M1, so syntax depends on the
version you are using:
- in 1.3.2 myTeamInstance.MyRole.class should work as witnessed
by this test:
http://www.objectteams.org/distrib/jacks/1.3.2/results/9.2.3 -otjld-get-
role-method-2g.html
- in 1.4.0M1 we adjusted the syntax to MyRole<@myTeamInstance>.class
see:
http://www.objectteams.org/distrib/jacks/1.4.0M1/results/9.2 .3-otjld-get-
role-method-2g.html

This is a late effect of migrating from path syntax to parameterized
syntax for role types.

So, given that neither version worked for you, this seems to be a
bug that is not detected by our tests. Which version did you use
in this case?

best,
Stephan
Re: Accessing role class [message #567718 is a reply to message #508418] Tue, 19 January 2010 08:08 Go to previous message
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
Stephan Herrmann wrote on Mon, 18 January 2010 12:31
> Hi,
>
> Actually there was a change in 1.4.0M1, so syntax depends on the version you are using:
> - in 1.3.2 myTeamInstance.MyRole.class should work as witnessed by this test:
> http://www.objectteams.org/distrib/jacks/1.3.2/results/9.2.3 -otjld-get-role-method-2g.html

With myTeamInstance.MyRole.class I am getting error:
Cannot use unqualified class literal for role MyRole<@myTeamInstance> outside its enclosing team (OTJLD 6.1(c)).

Stephan Herrmann wrote on Mon, 18 January 2010 12:31
> So, given that neither version worked for you, this seems to be a bug that is not detected by our tests. Which version did you use in this case?


I am using 1.3.2 : OTDT Version: 1.3.2 - developed for Eclipse version 3.5.1
Re: Accessing role class [message #567737 is a reply to message #567718] Tue, 19 January 2010 19:10 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
> With myTeamInstance.MyRole.class I am getting error:
> Cannot use unqualified class literal for role MyRole<@myTeamInstance>
> outside its enclosing team (OTJLD 6.1(c)).

Seeing this error message I could reproduce the problem
and improve our tests accordingly.
Yes, its a bug, which I just fixed a minute ago.

Unfortunately, for 1.3.2 I don't see an easy workaround.
FYI, the problem occurs if a role class literal is used outside
the role's team. This is perfectly legal, but our type checker
was over-eager in this regard. Sorry.

thanks for reporting,
Stephan
Re: Accessing role class [message #567765 is a reply to message #567737] Tue, 19 January 2010 19:16 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
> Unfortunately, for 1.3.2 I don't see an easy workaround.

I did find a workaround, add this method to your team:

public Class<MyRole> getMyRoleClass() {
return MyRole.class;
}

Then use myTeamInstance.getMyRoleClass() instead of
myTeamInstance.MyRole.class

Not ideal, but it works with the same semantics as the direct
use of the role class literal.

best,
Stepahn
Previous Topic:Accessing role class
Next Topic:EDITOR, the jumping caret
Goto Forum:
  


Current Time: Tue Apr 16 12:47:33 GMT 2024

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

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

Back to the top