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

Threading code being generated for any function named main #986

Closed
AdamBJ opened this Issue Feb 1, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@AdamBJ
Contributor

AdamBJ commented Feb 1, 2017

Brief Description

Most likely, threading code should only be generated if Umple encounters the Java function public static void main(String[]). However, even without the void identifier, the threading code is being generated. We need to confirm that the threading code should only be generated for public static void main(String[]), and introduce a fix to ensure this happens if that is the case.

We also need to determine the best way to do template tests for generated files that involve threading code as it appears that the generated code changes from run to run (eg from a normal run to a JUnit run).

See discussion of #969 details

@AdamBJ

This comment has been minimized.

Contributor

AdamBJ commented Feb 5, 2017

@TimLethbridge

Are there no main methods anywhere in the template tests? Do all of them have the 'void', hence avoiding the threading code? ... You say "some parts of the generated threading code have parameters that change from run to run." That is also strange. Surely there must be tests that detect the threading code.

There was actually only a single test case involving public static void main(String[] args) and associated threading code in the Java template tests (the lone test being the one I mentioned in issue 969). I've added some additional tests and fixed the inconsistency issue affecting the one original test in the PR mentioned above.

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