Accessing role class [message #508415] |
Mon, 18 January 2010 12:08  |
Eclipse User |
|
|
|
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 #508672 is a reply to message #508671] |
Tue, 19 January 2010 14:16  |
Eclipse User |
|
|
|
> 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 12:31  |
Eclipse User |
|
|
|
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 03:08  |
Eclipse User |
|
|
|
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 14:10  |
Eclipse User |
|
|
|
> 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 14:16  |
Eclipse User |
|
|
|
> 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
|
|
|
Powered by
FUDForum. Page generated in 0.04284 seconds