New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to sync UmpleToJava template with generated code and sync with UmpleToTemplate #697

Closed
Diusrex opened this Issue Jan 17, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@Diusrex
Contributor

Diusrex commented Jan 17, 2016

In commit 328c2664d9a158092772422597a53cff5d24be98, from November 25, there were many changes to UmpleToJava/templates/association_Get_All.jet and UmpleToJava/templates/association_Set_All.jet. These changes essentially simplified the selection of association get templates, so that only the base variable name will be used.

However, there have not been any changes to the JET generated files UmpleToJava/src/cruise/umple/compiler/java/JavaClassGenerator.java or UmpleToJava/src/cruise/umple/compiler/java/JavaSpecGenerator.java since these changes were applied.

This means that when the JET files are regenerated (which will ONLY happen in Eclipse when the UmpleToJava project is included), there are a large number of changes to the JavaClassGenerator.java required to update it to the current template.

These changes cause the full build to fail when running testbed/src/TestHarness.ump, because when the newly updated JavaClassGenerator is used, there are a lot of errors in umple/testbed/src-gen-umple/cruise/associations/specializations/{Az, Alteration, Leg, Spatula, Wheel}.java, as well as other files, due to getters and setters being assigned the same name. They get the same name due to the previously mentioned simplification of names

@TimLethbridge

This comment has been minimized.

Member

TimLethbridge commented Jan 17, 2016

Hi Morgan,

It would seem to me that these changes to the two Jet files in question apparently were never applied in the compiler (because they couldn’t have been if there was no generated code saved)

I suggest obtaining the versions as they were just before this, and seeing if that solves the problem.

Then, and only then, see if the changes to the jet files made make any sense. A quick glance suggests to me that this was an accidental save of experimental work, since it makes no sense to so radically simplify. The generator templates were had various forms for good reason.

On Jan 17, 2016, at 14:26, Morgan Redshaw notifications@github.com wrote:

In commit 328c266 328c266, from November 25, there were many changes to UmpleToJava/templates/association_Get_All.jet and UmpleToJava/templates/association_Set_All.jet. These changes essentially simplified the selection of association get templates, so that only the base variable name will be used.

However, there have not been any changes to the JET generated files UmpleToJava/src/cruise/umple/compiler/java/JavaClassGenerator.java or UmpleToJava/src/cruise/umple/compiler/java/JavaSpecGenerator.java since these changes were applied.

This means that when the JET files are regenerated (which will ONLY happen in Eclipse when the UmpleToJava project is included), there are a large number of changes to the JavaClassGenerator.java required to update it to the current template.

These changes cause the full build to fail when running testbed/src/TestHarness.ump, because when the newly updated JavaClassGenerator is used, there are a lot of errors in umple/testbed/src-gen-umple/cruise/associations/specializations/{Az, Alteration, Leg, Spatula, Wheel}.java, as well as other files, due to getters and setters being assigned the same name. They get the same name due to the previously mentioned simplification of names


Reply to this email directly or view it on GitHub #697.

Timothy C. Lethbridge, PhD, P.Eng., I.S.P., CSDP
Professor of Software Engineering and Computer Science
Faculté de genie / Faculty of Engineering
Université d'Ottawa / University of Ottawa
Tel: 613-562-5800x6685 Fax: 613-562-5664 Mobile: 613-252-1850
http://www.site.uottawa.ca/~tcl

@Diusrex Diusrex self-assigned this Jan 17, 2016

@Diusrex

This comment has been minimized.

Contributor

Diusrex commented Jan 19, 2016

That was my plan, I do not believe that the changes should be kept. After some very rough testing of what happens after reverting that commit, there are still changes applied to the JavaClassGenerator, and the tests now crash. If this is indeed the case, I will be looking through the JET templates for what else was changed and not applied, which will take more time.

Since they were caused by running codegen.xml build, will likely require changing the existing templates.

@TimLethbridge

This comment has been minimized.

Member

TimLethbridge commented Jan 19, 2016

Hi,

I think we should get back to the person who made the changes. I suspect he committed the wrong version of the jet template for some reason.

On Jan 18, 2016, at 19:01, Morgan Redshaw notifications@github.com wrote:

That was my plan, I do not believe that the changes should be kept. After some very rough testing of what happens after reverting that commit, there are still changes applied to the JavaClassGenerator, and the tests now crash. If this is indeed the case, I will be looking through the JET templates for what else was changed and not applied, which will take more time.

Since they were caused by running codegen.xml build, will likely require changing the existing templates.


Reply to this email directly or view it on GitHub #697 (comment).

Timothy C. Lethbridge, PhD, P.Eng., I.S.P., CSDP
Professor of Software Engineering and Computer Science
Faculté de genie / Faculty of Engineering
Université d'Ottawa / University of Ottawa
Tel: 613-562-5800x6685 Fax: 613-562-5664 Mobile: 613-252-1850
http://www.site.uottawa.ca/~tcl

@Diusrex Diusrex added JET and removed JET labels Jan 19, 2016

@Diusrex Diusrex changed the title from Error due to UmpleToJava JET template changes to Need to sync UmpleToJava template with generated code and sync with UmpleToTemplate Jan 19, 2016

Diusrex added a commit to Diusrex/umple that referenced this issue Jan 25, 2016

Synced JET templates with generated code
Helps with issue umple#697, but still need to sync with UmpleToTemplate
@TimLethbridge

This comment has been minimized.

Member

TimLethbridge commented Mar 7, 2016

So this issue needs to continue to be dealt with, as mentioned in PR #702

The ant file build.codegen.xml is supposed to copy several jet files that are 'in common' among java, PhP and Ruby from UmpleToTemplate/templates to UmpleTo_/templates. However the jet files in Umpleto_ have diverged.

build.codegen.xml is not run by the build, but is designed to be run by people editing the common jet files

It might be that the UmpleToTemplate/templates are wrong or the language ones. We know that the Java generated is correct since the build passes.

This issue needs solving before we attempt to convert to UmpleTL - issue #708. Alternatively we could just temporarily give up on running build.codegen.xml and edit the language-specific jet files only, then refactor after conversion.

@TimLethbridge

This comment has been minimized.

Member

TimLethbridge commented Mar 22, 2016

Closing this issue. The UmpleToTemplate hierarchy is not currently in use. Future refactoring could find commonalities again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment