Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322630

Summary: Nested package is not supported
Product: [Modeling] EMF.EGF Reporter: Yves YANG <yves.yang>
Component: CoreAssignee: Benoit Langlois <benoit.langlois>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: x.maysonnave
Version: 0.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Bug fix Patch
yves.yang: iplog+
Bug fix yves.yang: iplog+

Description Yves YANG CLA 2010-08-13 05:01:21 EDT
During the integration with PMF? we have noticed a problem with nested packages. The "Update generated elements" fails with the following exception:

java.lang.IllegalArgumentException
at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:191)
at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1302)
at org.eclipse.jdt.core.dom.AST.newName(AST.java:1422)
at org.eclipse.egf.pattern.java.engine.JavaTranslationEnhancer.addField(JavaTranslationEnhancer.java:228)
at org.eclipse.egf.pattern.java.engine.JavaTranslationEnhancer.addParameterFieldsAndSetter(JavaTranslationEnhancer.java:184)
at org.eclipse.egf.pattern.java.engine.JavaTranslationEnhancer.performEnhancement(JavaTranslationEnhancer.java:94)
at org.eclipse.egf.pattern.java.engine.JavaTranslationEnhancer.enhance(JavaTranslationEnhancer.java:73)
at org.eclipse.egf.pattern.java.engine.JavaEngine.translate(JavaEngine.java:47)
at org.eclipse.egf.pattern.engine.TranslationHelper.translate(TranslationHelper.java:53)
at org.eclipse.egf.pattern.engine.TranslationHelper.translate(TranslationHelper.java:42)
at org.eclipse.egf.pattern.ui.contributions.PatternMenuContributor$GeneratePatternAction.run(PatternMenuContributor.java:201)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)

The problem is the method ParameterTypeHelper.getTypeLiteral() gives a wrong type name if it is a type in a nested package. In my case, the argument type has a value "http://www.eclipse.org/pmf#//ui/ViewPart". The result of this method is org.eclipse.pmf.ui.ui.ViewPart instead of org.eclipse.pmf.ui.ViewPart
Comment 1 Yves YANG CLA 2010-08-13 05:42:28 EDT
Created attachment 176530 [details]
Bug fix Patch
Comment 2 Yves YANG CLA 2010-08-13 05:55:09 EDT
Created attachment 176533 [details]
Bug fix

Change to MClassifier
Comment 3 Benoit Langlois CLA 2011-05-16 09:43:53 EDT
Fixed