Skip to main content



      Home
Home » Modeling » EMF » Extra getPackage in model generation
Extra getPackage in model generation [message #482458] Wed, 26 August 2009 11:51 Go to next message
Eclipse UserFriend
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 18:56 Go to previous messageGo to next message
Eclipse UserFriend
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] Wed, 26 August 2009 23:30 Go to previous messageGo to next message
Eclipse UserFriend
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 01:58 Go to previous messageGo to next message
Eclipse UserFriend
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 06:33 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, that's unconditionally generated.
Re: Extra getPackage in model generation [message #1807629 is a reply to message #1807625] Wed, 05 June 2019 07:06 Go to previous messageGo to next message
Eclipse UserFriend
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 10:15 Go to previous messageGo to next message
Eclipse UserFriend
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 06:36 Go to previous messageGo to next message
Eclipse UserFriend
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 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Yes, please open a Bugzilla.
Re: Extra getPackage in model generation [message #1808422 is a reply to message #1808211] Mon, 24 June 2019 06:43 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 08:26:56 EDT 2025

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

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

Back to the top