Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Incomplete import in Java generated code by Papyrus Designer(Papyrus Designer generates an incomplete import for derived classes)
Incomplete import in Java generated code by Papyrus Designer [message #1843871] Sun, 22 August 2021 21:33 Go to next message
Ramiro Carvalho is currently offline Ramiro CarvalhoFriend
Messages: 19
Registered: January 2021
Junior Member
I have a UML model in Papyrus with a set of signals within a package. These signals are organized into a hierarchy.


When I generate code, what I get for the signal at the root of the tree is correct, as below:


package com.elastskin.ppmweb.service.state.productionsignals.Signals;
public abstract class Prod_Signal {
/**
*
*/
public Instant pevttimestamp;
}


but the code for all descendants contains a line with an ill-formed import (missing the '*' at the end):


package com.elastskin.ppmweb.service.state.productionsignals.Signals;
import com.elastskin.ppmweb.;
public abstract class Prod_PrintSystem_Signal extends Prod_Signal
{
}



Is it a bug? How can I work around it?

Versions:
Papyrus
Version: 2021-06 (4.20)
Build id: 2021-03-21T18:43:59Z

org.eclipse.papyrus.designer.languages.java.codegen (1.1.1.202103190948) "Papyrus Designer Java code generation" [Active]
org.eclipse.papyrus.designer.languages.java.library (1.1.1.202011271115) "Papyrus Designer Java library" [Starting]
org.eclipse.papyrus.designer.languages.java.profile (1.1.1.202011271115) "Papyrus Designer Java profile" [Active]


[Updated on: Sun, 22 August 2021 21:34]

Report message to a moderator

Re: Incomplete import in Java generated code by Papyrus Designer [message #1843875 is a reply to message #1843871] Mon, 23 August 2021 04:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I suspect that you are looking in the wrong direction. The Eclipse tooling that I use does not usually use "*" imports; rather all required imports are provided explicitly. If a "*" appears it comes from the Java prettifier. Perhaps the target of a missing import is not accessible.

Regards

Ed Willink
Re: Incomplete import in Java generated code by Papyrus Designer [message #1843887 is a reply to message #1843875] Mon, 23 August 2021 11:22 Go to previous messageGo to next message
Ramiro Carvalho is currently offline Ramiro CarvalhoFriend
Messages: 19
Registered: January 2021
Junior Member
Thanks for your response, Ed.

When you say "Eclipse tool" do you mean a Java IDE or Eclipse Papyrus? My problem is with the Papyrus code generator and not with the Java IDE.

I was expecting Papyrus to generate the explicit imports for each dependency, as you said, but that is not what is happening.

Re: Incomplete import in Java generated code by Papyrus Designer [message #1843904 is a reply to message #1843887] Mon, 23 August 2021 17:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I'm mostly referring to EMF and my own OCL CG based on EMF. When I don't like what I see I go in with a debugger and as often as not discover that the problem is my inadequate configuration, perhaps based on the need to use a poorly documented facility. Sometimes it is necessary to create a tool customization that may perhaps need contributing back a s a fix.

Regards

Ed Willink
Re: Incomplete import in Java generated code by Papyrus Designer [message #1843907 is a reply to message #1843904] Mon, 23 August 2021 23:49 Go to previous messageGo to next message
Ramiro Carvalho is currently offline Ramiro CarvalhoFriend
Messages: 19
Registered: January 2021
Junior Member

I've just found out that in a previous version of my Papyrus project, this problem does not happen and Papyrus generates all Java imports beautifully.

I am trying to figure out what have I changed in the project that causes the problem.

If I find it might be a bug, I will report it to the appropriate channel. Going further than that is beyond my possibilities because I don´t have the expertise and time to venture into changing Eclipse.

Thanks for your comments, Ed.
Re: Incomplete import in Java generated code by Papyrus Designer [message #1844073 is a reply to message #1843907] Tue, 31 August 2021 08:21 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
I can reproduce the issue. Thanks for reporting.
Previous Topic:Cannot install Papyrus-Update-5.2.0I2.zip on 2021-06 - missing XWT
Next Topic:What is the meaning of each element in the *.notation file
Goto Forum:
  


Current Time: Sat Apr 27 01:04:16 GMT 2024

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

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

Back to the top