Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331193 - The generated implementation file for an abstract class "foo" says "fooImpl implements foo"
Summary: The generated implementation file for an abstract class "foo" says "fooImpl i...
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-26 06:27 EST by stefano casadei CLA
Modified: 2010-11-26 12:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stefano casadei CLA 2010-11-26 06:27:29 EST
Build Identifier: Build id: M20100909-0800

My file Graph.java in the package x.graph has the following definition:

/**
 * @model kind="class" abstract="true"
 */
public abstract class Graph implements EObject {
   ...
}

The corresponding code generated in the file GraphImpl.java of package x.graph.impl has the following erroneous code:

public abstract class GraphImpl extends EObjectImpl implements Graph {

...
}


Moreover, without the explicit properties: 
kind="class" abstract="true"
The EMF generator model interprets Graph as an enum!!




Reproducible: Always
Comment 1 Ed Merks CLA 2010-11-26 10:28:14 EST
EMF won't generate classes like this.  Graph needs to be an interface.
Comment 2 stefano casadei CLA 2010-11-26 11:03:09 EST
...odd that EMF behaves unpredictably instead of saying that abstract class are prohibited; and why is there an abstract property for the kind="class"? (EMF book, pag. 146)
Comment 3 Ed Merks CLA 2010-11-26 12:22:34 EST
For an EClass X, EMF generates an interface X and implementation class XImpl.    If you make the EClass abstract, XImpl will be abstract.  If you set EClass.interface to true, then it must be abstract as well and no XImpl is generated.  It is possible to suppress the separation of interfaces and implementation classes so they're merged into one.  Maybe that's what you want?  That's the case where kind='class' is useful.