Skip to content
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

Remove unneeded warnings in build #862

Closed
TimLethbridge opened this Issue Jun 27, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@TimLethbridge
Copy link
Member

commented Jun 27, 2016

Currently a full build generates many warnings that could be trivially avoided by simple code changes. Do each as a separate commit.

In umpleSelf

    [java] Warning 49 on line 1591 of file "Generator_CodeJava.ump":
     [java] A  implementation of Method 'addJavaLttngImport' in class 'JavaGenerator' is already defined at line 1575 of 'Generator_CodeJava.ump' file. New definition at line 1592 of 'Generator_CodeJava.ump' file is being disconsidered

Solution: Comment out the disconsidered version, verify all is OK, then delete it.

     [java] Warning 3 on line 449 of file "Umple.ump":
     [java] The lazy keyword is redundant when the attribute is being initialized - in class 'CodeInjection'

Solution remove the lazy keyword. Verify all is OK.

     [java] Warning 1012 on line 584 of file "Umple.ump":
     [java] Method 'setImmutable' cannot be found. Injection was ignored.
     [java] Warning 1012 on line 660 of file "Umple.ump":
     [java] Method 'setImmutable' cannot be found. Injection was ignored.
     [java] Warning 1012 on line 664 of file "Umple.ump":
     [java] Method 'setExtendsTrait' cannot be found. Injection was ignored.

Try to understand why these were here to start with. Verify that in fact these are doing nothing by commenting the lines out. If all is OK then delete.

There are other warnings in some tests that can be dealt with

@TimLethbridge

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2016

See what warnings are left by doing a full build. Many have been removed.

@TimLethbridge

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2016

Here are messages that could be cleared from the build as of Sept 2016

[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

compileJava:
[java] Processing -> testbed/src/TestHarness.ump
[java] Warning 301 on line 22 of file "TestHarnessTracerTraceCase.ump":
[java] Tracing of non-existent model entity
[java] Warning 301 on line 23 of file "TestHarnessTracerTraceCase.ump":
[java] Tracing of non-existent model entity
[java] Warning 67 on line 365 of file "TestHarnessStateMachineJava.ump":
[java] State 'Sss2' from StateMachine 'Ss1' is non-reachable.
[java] Warning 50 on line 371 of file "TestHarnessStateMachineJava.ump":
[java] State 'S1.Sss2' has not been declared, it is being treated as an new state

@ahochheiden ahochheiden self-assigned this Sep 23, 2016

@vahdat-ab

This comment has been minimized.

Copy link
Member

commented Sep 23, 2016

Regarding this error "[javac] Note: Recompile with -Xlint:unchecked for details." you may have a look at this http://stackoverflow.com/questions/4134803/ant-passing-compilerarg-into-javac

@ahochheiden

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2016

Yes, I found that out by reading through the manual for ant on https://ant.apache.org/manual/using.html#arg

Adding that to the javac in build.umple.xml (lines 191 to 207) makes the deprecation warnings appear.

@ahochheiden

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2016

While investing the -Xlint:unchecked warnings, Vahdat suggested that some can't easily be resolved, and that we should just suppress the warnings with @SuppressWarnings("unchecked").

After attempting to use that annotation, we discovered that the umple compiler is having a problem with annotations. Vahdat raised a separate issue regarding this (#884), as such, a lot of the unchecked warnings cannot be dealt with until that issue is resolved.

@TimLethbridge

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2016

So maybe then the only solution to this issue is to tell the compiler to suppress the warnings, or to just delete this issue ... that is, if we can't fix the code easily to deal with the deprecations.

@vahdat-ab

This comment has been minimized.

Copy link
Member

commented Sep 23, 2016

that's exactly what we want to do. UmpleCompiler cannot deal with suppress and then the final project cannot be compiled. I think we should forget to remove -Xlint:unchecked from the warning list.

@TimLethbridge

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2016

Agreed.

@ahochheiden

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2016

I was able to resolve all -Xlint:deprecation warnings.

The warnings in compileJava:

[java] Processing -> testbed/src/TestHarness.ump
[java] Warning 301 on line 22 of file "TestHarnessTracerTraceCase.ump":
[java] Tracing of non-existent model entity
[java] Warning 301 on line 23 of file "TestHarnessTracerTraceCase.ump":
[java] Tracing of non-existent model entity
[java] Warning 67 on line 365 of file "TestHarnessStateMachineJava.ump":
[java] State 'Sss2' from StateMachine 'Ss1' is non-reachable.
[java] Warning 50 on line 371 of file "TestHarnessStateMachineJava.ump":
[java] State 'S1.Sss2' has not been declared, it is being treated as an new state

Are not valid warnings, they result from two separate bugs with state machines. Two issues have been raised regarding this. (#885 and #886)

@ahochheiden ahochheiden referenced this issue Sep 24, 2016

Merged

Warnings #887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.