Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extra getPackage in model generation
Extra getPackage in model generation [message #482458] Wed, 26 August 2009 15:51 Go to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
When I generate my model code, my FactoryImpl has the following extra
getPackage() method generated (the second one). Each time I generate, I
simply delete the second one and move on.

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public xyz.ast.Package getPackage() {
return (xyz.ast.Package)getEPackage();
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static xyz.ast.Package getPackage() {
return xyz.ast.Package.eINSTANCE;
}

Is there a way I can prevent the erroneous "deprecated" method from
being generated?
Re: Extra getPackage in model generation [message #482532 is a reply to message #482458] Wed, 26 August 2009 22:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Paul,

Hmmm. Did you set your package prefix to be the empty string? That's
certainly not expected nor something that's supported...


Paul Glezen wrote:
> When I generate my model code, my FactoryImpl has the following extra
> getPackage() method generated (the second one). Each time I generate,
> I simply delete the second one and move on.
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public xyz.ast.Package getPackage() {
> return (xyz.ast.Package)getEPackage();
> }
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @deprecated
> * @generated
> */
> @Deprecated
> public static xyz.ast.Package getPackage() {
> return xyz.ast.Package.eINSTANCE;
> }
>
> Is there a way I can prevent the erroneous "deprecated" method from
> being generated?
Re: Extra getPackage in model generation [message #482555 is a reply to message #482532] Thu, 27 August 2009 03:30 Go to previous messageGo to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
Guilty. :(

Ed Merks wrote:
> Paul,
>
> Hmmm. Did you set your package prefix to be the empty string? That's
> certainly not expected nor something that's supported...
>
>
Re: Extra getPackage in model generation [message #1807615 is a reply to message #482555] Wed, 05 June 2019 05:58 Go to previous messageGo to next message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 72
Registered: February 2016
Member
I also encountered this problem recently, see https://github.com/eclipse/xtext-eclipse/blob/master/org.eclipse.xtext.xtext.ui.examples/projects/arithmetics/org.eclipse.xtext.example.arithmetics/src-gen/org/eclipse/xtext/example/arithmetics/arithmetics/impl/ArithmeticsFactoryImpl.java#L271-L281

Could you please help what are the right setting to supress the generation of the deprecated method?
Re: Extra getPackage in model generation [message #1807625 is a reply to message #1807615] Wed, 05 June 2019 10:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Sorry, that's unconditionally generated.
Re: Extra getPackage in model generation [message #1807629 is a reply to message #1807625] Wed, 05 June 2019 11:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6536
Registered: July 2009
Senior Member
HI

The method was deprecated 13 years ago. Perhaps it could be suppressed when the runtime version is greater than 2.18.

Regards

Ed Wllink
Re: Extra getPackage in model generation [message #1807645 is a reply to message #1807629] Wed, 05 June 2019 14:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Yes, I had the same thought. :-P
Re: Extra getPackage in model generation [message #1808209 is a reply to message #1807645] Wed, 19 June 2019 10:36 Go to previous messageGo to next message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 72
Registered: February 2016
Member
I am happy to hear that. How should we proceed? Should I open a bugzilla for that?
Re: Extra getPackage in model generation [message #1808211 is a reply to message #1808209] Wed, 19 June 2019 11:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Yes, please open a Bugzilla.
Re: Extra getPackage in model generation [message #1808422 is a reply to message #1808211] Mon, 24 June 2019 10:43 Go to previous message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 72
Registered: February 2016
Member
I opened the Bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=548575 to keep track of this issue.
Previous Topic:[GWT] Compilation Problems
Next Topic:Read out Genmodel file
Goto Forum:
  


Current Time: Mon Dec 09 23:37:19 GMT 2019

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

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

Back to the top