Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » java code generation
java code generation [message #1790272] Thu, 07 June 2018 17:22 Go to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 138
Registered: March 2014
Senior Member
I have two classes say A and B where B is a generalization of A.

When I run the java code generator I expected the code to look like

public class B extends A {
...
};

but I just get public class B { ... };

So my questions are:

does Papyrus Designer currently support generating code for generalization edges?
where can I find the documentation that specifies what is and what is not supported?
is there any other documentation regarding generating java code. eg how can I represent a set?

Thanks,
Steve
Re: java code generation [message #1790274 is a reply to message #1790272] Thu, 07 June 2018 17:45 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
That's odd, I get well the following code for B (having a generalization on the model level):

public class B extends A {
};

are you sure that you used a generalization (and not for instance a realization relationship). Which version of SW designer do you use?
Re: java code generation [message #1790275 is a reply to message #1790274] Thu, 07 June 2018 18:01 Go to previous messageGo to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 138
Registered: March 2014
Senior Member
Looks like 1.0.5 for "Papyrus Java profile, library and code generation (Incubation)" although its parent "Papyrus Designer Transformation, develop and deploy component based applications (Incubation)" shows version 0.7.6.



Re: java code generation [message #1790311 is a reply to message #1790275] Fri, 08 June 2018 08:25 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
While the Java code generation has not been touched recently (as far as I know), could you please upgrade to a nightly version using the following update site
https://hudson.eclipse.org/papyrus/job/papyrus-designer-oxygen/lastSuccessfulBuild/artifact/releng/org.eclipse.papyrus.designer.p2/target/repository/
(the job is build against Papyrus oxygen, but can also be installed on photon).
If you still have the problem with the nightly version, could you eventually post your model (or via private mail), so that I can check whether I can reproduce the problem.
Re: java code generation [message #1790352 is a reply to message #1790311] Fri, 08 June 2018 13:51 Go to previous messageGo to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 138
Registered: March 2014
Senior Member
Ansgar,

Last night I ran the same thing on a different computer an it worked as expected so there must be a problem with the setup or configuration on this particular computer. The good news there is that the software is OK.

Do you have any suggestions for where to start investigating?

Thanks,
Steve
Re: java code generation [message #1790491 is a reply to message #1790352] Mon, 11 June 2018 17:14 Go to previous messageGo to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 138
Registered: March 2014
Senior Member
So I've found that this has something to do with visibility.
I was organizing my classes and moved a class into a different package then next time I generated the code I got the extends keyword.

I'll have to try to determine exactly the circumstances in which the extends keyword does not get generated.

If someone already knows, please let me know.

Thanks,
Steve
Re: java code generation [message #1791995 is a reply to message #1790311] Mon, 09 July 2018 12:26 Go to previous message
Hakki Caglar Yildiz is currently offline Hakki Caglar YildizFriend
Messages: 1
Registered: July 2018
Junior Member
I was having a similar problem while trying to generate Java code on Photon via Papyrus. Updating the nightly build version of Papyrus Designer solved the problem.
Previous Topic:disable textedit after connecting transition
Next Topic:Auto Arrange just connectors?
Goto Forum:
  


Current Time: Tue Apr 16 19:39:59 GMT 2024

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

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

Back to the top