Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » generic arguments to eOperations
generic arguments to eOperations [message #415323] Wed, 12 December 2007 13:17 Go to next message
Eclipse UserFriend
Originally posted by: jaehemail-eclipse.yahoo.co.uk

Hi,

I ran into a problem while trying to reload one of my models - after some
investigation I found that trying to generate a model from the following
java code(in a project on its own) just didn't work. The problem is
generics in the signature for an eOperation. While trying to generate a
model, or reload, the following error is reported:

The type must be specified for 'IOp.op(values)'

code:

package test.emf.problem;
import java.util.List;
/**
* @model
*/
public interface IOp
{
/**
* @model
*/
void op(List<Integer> values);
}

by specifying the parameters for the operation with '@model
parameters="java.util.List"' the model does generate but the generated
implementation just has the vanilla List argument (no parameterised type).
Are there plans to recognise parameterised types any time soon and is
there a way to have it generate the correct implementation signature at
present?

Any help appreciated,

Jae.
Re: generic arguments to eOperations [message #415332 is a reply to message #415323] Wed, 12 December 2007 15:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Jae,

This doesn't seem to be handled very gracefully. Using this approach
should work

* @model valuesDataType="java.util.List<java.lang.Integer>"

Please open a bugzilla with this example and I'll try to figure out why
it's handled so poorly...


Jae Hossell wrote:
> Hi,
>
> I ran into a problem while trying to reload one of my models - after
> some investigation I found that trying to generate a model from the
> following java code(in a project on its own) just didn't work. The
> problem is generics in the signature for an eOperation. While trying
> to generate a model, or reload, the following error is reported:
>
> The type must be specified for 'IOp.op(values)'
>
> code:
>
> package test.emf.problem;
> import java.util.List;
> /**
> * @model
> */
> public interface IOp
> {
> /**
> * @model
> */
> void op(List<Integer> values);
> }
>
> by specifying the parameters for the operation with '@model
> parameters="java.util.List"' the model does generate but the generated
> implementation just has the vanilla List argument (no parameterised
> type). Are there plans to recognise parameterised types any time soon
> and is there a way to have it generate the correct implementation
> signature at present?
>
> Any help appreciated,
>
> Jae.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: generic arguments to eOperations [message #415335 is a reply to message #415332] Wed, 12 December 2007 16:57 Go to previous message
Eclipse UserFriend
Originally posted by: jaehemail-eclipse.yahoo.co.uk

Hi,

The bug has been added: Bug 212780

cheers,

Jae.
Previous Topic:Generating code without EMF dependencies
Next Topic:Notification for eSetResource
Goto Forum:
  


Current Time: Thu Sep 26 02:51:36 GMT 2024

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

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

Back to the top