Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Cannot generate Java codes with an Interface(Interface with a abstract method defined with return type or a parameter)
Cannot generate Java codes with an Interface [message #1856414] Thu, 08 December 2022 19:08 Go to next message
Mustafa GOKMEN is currently offline Mustafa GOKMENFriend
Messages: 4
Registered: December 2022
Junior Member
When I create a class diagram with an interface which contains any operation (as an abstract method) with return type or parameter in any type, code generator never creates a java code since Papyrus 6.0 and Papyrus Designer 2.0.
At the same time, Interface inheritance is not possible the later versions at the sample diagram.

index.php/fa/42766/0/

But the same diagram generate codes perfectly using Papyrus 5.2.0 and Papyrus Designer 2.0.

BTW: If not specified any paramater (void) in method or attributes code creation has been successfull with code errors.

A code generation attempt is putting the following line in error log:
org.eclipse.core.commands.ExecutionException: Error executing 'org.eclipse.papyrus.designer.languages.common.codegen.command': java.lang.NullPointerException: Cannot invoke "org.eclipse.uml2.uml.Element.getOwner()" because "context" is null

And it seems an uml2 error.

I wonder if this is a bug. Or What is my mistake in this situation?
Re: Cannot generate Java codes with an Interface [message #1856422 is a reply to message #1856414] Fri, 09 December 2022 05:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You can easily tell whether it is a UML2 project error, bu opening the *.uml file with the UML editor and converting to Ecore then Java there.

If you shared the *.uml file we might be able to help youwith rather than guess at a variety of possible problems. It would also help if we knew which code generator you are trying to use; Java / C++ / ...

Regards

Ed Willink
Re: Cannot generate Java codes with an Interface [message #1856432 is a reply to message #1856422] Fri, 09 December 2022 12:17 Go to previous messageGo to next message
Mustafa GOKMEN is currently offline Mustafa GOKMENFriend
Messages: 4
Registered: December 2022
Junior Member
Thanks for your reply.

I am not saying but interpreted as "seen" as a uml2 error and I had asked about java code generation.

I attached a whole demo project instead of the ".uml" file.

- Eclipse Designer RCP Nightly (Papyrus Designer Feature v3.0.0 and Papyrus for UML v6.0.0)
and
- Eclipse 2022-03 with Papyrus for UML 6.1.0 with Designer 2.1.0

cannot create java codes from this diagram and error log shows a "NullPointerException" for codegen profile.

In eclipse 2021-09 (Papyrus for UML v5.2.0 and Papyrus Designer 2.0.0) creates the ".java" codes perfectly.

Maybe I'm missing something or doing something wrong.
Re: Cannot generate Java codes with an Interface [message #1856472 is a reply to message #1856432] Mon, 12 December 2022 12:40 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Dear Mustafa,

I could reproduce and locate the error in the Papyrus SW designer. It will be corrected in bug 581201.

Ansgar
Re: Cannot generate Java codes with an Interface [message #1856478 is a reply to message #1856472] Mon, 12 December 2022 23:32 Go to previous messageGo to next message
Mustafa GOKMEN is currently offline Mustafa GOKMENFriend
Messages: 4
Registered: December 2022
Junior Member
It is very interesting that it has not been noticed before.

Thank you very much for your interest.

Re: Cannot generate Java codes with an Interface [message #1856482 is a reply to message #1856478] Tue, 13 December 2022 07:07 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Yes, it should have been discovered earlier, as it is quite basic. I probably need to add a test case in the context of the bug. Can you please try with the nightly update site if the bug itself is already fixed?
Re: Cannot generate Java codes with an Interface [message #1856493 is a reply to message #1856482] Tue, 13 December 2022 12:32 Go to previous message
Mustafa GOKMEN is currently offline Mustafa GOKMENFriend
Messages: 4
Registered: December 2022
Junior Member
Ok. It seems great and to work as expected.

Thanks for your effort.
Previous Topic:Spring State Machine Modelling Tool Support in Intellij
Next Topic:FlowPort
Goto Forum:
  


Current Time: Fri Apr 26 06:54:36 GMT 2024

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

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

Back to the top