Bug 130468 - Exceptions after clicking into "Instance Class Name"
Summary: Exceptions after clicking into "Instance Class Name"
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: 2.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Steinberg CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 132460 (view as bug list)
Depends on:
Blocks: 104727
  Show dependency tree
 
Reported: 2006-03-05 11:04 EST by Aaron Digulla CLA
Modified: 2008-05-13 17:09 EDT (History)
2 users (show)

See Also:


Attachments
Patch to fix this bug and some related ones (5.80 KB, patch)
2006-03-11 09:06 EST, Aaron Digulla CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Digulla CLA 2006-03-05 11:04:22 EST
1. Open any ecore model in the standard ecore model editor
2. Select an EClass
3. Click into "Instance Class Name"

Now, an empty attribute will have been created.

When you no run "Generate Model" on the whole model, there will be exceptions in the Error log:

java.lang.IllegalArgumentException: Attempt to insert null sibling
	at org.eclipse.jdt.internal.core.jdom.DOMNode.insertSibling(DOMNode.java:668)
	at org.eclipse.emf.codegen.jmerge.JMerger.insertClone(JMerger.java:1052)
	at org.eclipse.emf.codegen.jmerge.JMerger.pushSourceMethod(JMerger.java:871)
	at org.eclipse.emf.codegen.jmerge.JMerger.pushSourceType(JMerger.java:837)
	at org.eclipse.emf.codegen.jmerge.JMerger.pushSourceCompilationUnit(JMerger.java:790)
	at org.eclipse.emf.codegen.jmerge.JMerger.merge(JMerger.java:91)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.generate(GenBaseImpl.java:603)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.generate(GenBaseImpl.java:547)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.generate(GenPackageImpl.java:2515)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.generate(GenModelImpl.java:1932)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.generate(GenBaseImpl.java:350)
	at org.eclipse.emf.codegen.ecore.genmodel.presentation.GenModelActionBarContributor$3.generate(GenModelActionBarContributor.java:167)
	at org.eclipse.emf.codegen.ecore.genmodel.presentation.GenModelActionBarContributor$14.execute(GenModelActionBarContributor.java:295)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:100)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1733)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:112)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

plus the generated code will have ".class" in several places.

Proposed fix: Treat the empty string in this field like null.

"Default Value Literal" suffers from the same bug.

Currently, the only workaround is to open the model in a text editor and to delete the attribute.
Comment 1 Ed Merks CLA 2006-03-05 17:02:40 EST
One of the many constraints we need to enforce is that the name should be a valid Java qualified name.

There's a (well hidden) button on the properties view toolbar to restore the default value, i.e., to unset the feature back to null. 

*** This bug has been marked as a duplicate of 104727 ***
Comment 2 Aaron Digulla CLA 2006-03-11 09:06:19 EST
Created attachment 36091 [details]
Patch to fix this bug and some related ones

This patch fixes the errors we'll get when entering empty strings for named elements (attribute names, for example), instance class names and source property descriptors.

This patch also fixes bug 104727.
Comment 3 Aaron Digulla CLA 2006-03-11 09:07:06 EST
Reopening bug after mail exchange with Ed Merks.
Comment 4 Ed Merks CLA 2006-03-13 09:16:10 EST
[contrib email="digulla@hepe.com"/]

The changes (with very minor tweaks) have been committed to CVS.
Comment 5 Nick Boldt CLA 2006-03-16 16:35:54 EST
Fixed in  2.2.0 I200603160000
Comment 6 Ed Merks CLA 2006-03-19 08:21:18 EST
*** Bug 132460 has been marked as a duplicate of this bug. ***
Comment 7 Nick Boldt CLA 2008-01-28 16:46:27 EST
Move to verified as per bug 206558.