Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Primitive Types are not generated
Primitive Types are not generated [message #1804056] Sat, 16 March 2019 21:18 Go to next message
Mohamed Ismail is currently offline Mohamed IsmailFriend
Messages: 8
Registered: March 2019
Junior Member
Hi,

I have managed to create a model and I want to generate the corresponding java code however, the "Primitive" data types are not generated probably because I don't know how to map them them to java primitive types correctly. for example I want to define a DateTime primitive data type that should be mapped to java.util.Date . Should I use a specific stereotype or a redifined classifier to something else?


I am using papyrus 2018-12 (4.10) and the designer update site: http://download.eclipse.org/modeling/mdt/papyrus/components/designer/. I have created a UML model and I have managed to generate Java Project


Regards
Mohamed Ismail
Re: Primitive Types are not generated [message #1804075 is a reply to message #1804056] Sun, 17 March 2019 16:16 Go to previous messageGo to next message
Mohamed Ismail is currently offline Mohamed IsmailFriend
Messages: 8
Registered: March 2019
Junior Member
Looking at the error log, I found the below stack trace Does this rings a bell?

org.eclipse.core.commands.ExecutionException: Error executing 'org.eclipse.papyrus.designer.languages.common.codegen.command': java.lang.IndexOutOfBoundsException: Index: 83, Size: 83
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:170)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:497)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:490)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4363)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4150)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.IndexOutOfBoundsException: Index: 83, Size: 83
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:320)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:254)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
... 35 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 83, Size: 83
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at org.eclipse.jdt.internal.formatter.TokenManager.get(TokenManager.java:75)
at org.eclipse.jdt.internal.formatter.TokenManager.findIndex(TokenManager.java:168)
at org.eclipse.jdt.internal.formatter.TokenManager.firstIndexIn(TokenManager.java:180)
at org.eclipse.jdt.internal.formatter.OneLineEnforcer.tryKeepOnOneLine(OneLineEnforcer.java:155)
at org.eclipse.jdt.internal.formatter.OneLineEnforcer.endVisit(OneLineEnforcer.java:145)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:130)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2815)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2863)
at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:617)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2815)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2886)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:447)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2815)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2886)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:258)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2815)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareLineBreaks(DefaultCodeFormatter.java:416)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareFormattedCode(DefaultCodeFormatter.java:228)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:184)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:166)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.format(JavaModelElementsCreator.java:206)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.generateFile(JavaModelElementsCreator.java:190)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.generateClassifier(JavaModelElementsCreator.java:185)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.createPackageableElementFile(JavaModelElementsCreator.java:157)
at org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator.createPackageableElement(ModelElementsCreator.java:158)
at org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator.createPackageableElement(ModelElementsCreator.java:153)
at org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator.createPackageableElement(ModelElementsCreator.java:153)
at org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator.createPackageableElement(ModelElementsCreator.java:110)
at org.eclipse.papyrus.designer.languages.java.codegen.JavaLangCodegen.generateCode(JavaLangCodegen.java:80)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:95)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:121)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:112)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:101)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:101)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:101)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:101)
at org.eclipse.papyrus.designer.languages.common.codegen.ui.handlers.GenerateCodeHandler.execute(GenerateCodeHandler.java:143)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:96)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
... 39 more
Re: Primitive Types are not generated [message #1804187 is a reply to message #1804075] Wed, 20 March 2019 06:53 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 228
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

I haven't seen this error, which seems to happen during code formatting by JDT - it's unrelated to the issue and - as it seems - outside SW designer. The Java code generator does not support primitive types. The main motivation was that Java does not really have primitive types except for the builtin ones like int, char, boolean ... that are handled by the generator. Thus, I would recommend to use classes instead. It is arguable that primitive types could still be used at the UML level and be mapped to Java classes, in this case you could consider posting a bug with severity "enhancement"

Ansgar.
Previous Topic:SysML Item flow
Next Topic:Model Execution with Moka > "Hello World"
Goto Forum:
  


Current Time: Sun Dec 15 00:51:29 GMT 2019

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

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

Back to the top