-
Notifications
You must be signed in to change notification settings - Fork 55
New Jolie2Java #517
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
New Jolie2Java #517
Conversation
…ion, updated the launchers for jolie2java to include the dependencies of the new implementation, and updated the Dockerfile in .devcontainer to use the newest version of its image such that it includes Java 21.
…rall type hierarchy imposed by the tool. Also fixed bug related to having a choice type in a field and added unit tests to cover those cases.
…e, added examples of using the new jolie2java tool to a new javaServices/newJavaservices module, and fixed a minor bug regarding faults storing choice types.
Updated some inconsistencies with the wording in the README of jolie2java
… data is stored by typed structures.
…ations, improved the readability of unit test files, moved embedding files to the jolie module, updated jolie module to use java21, and updated jolie2java's README file.
…ection, and updated the generated equals() methods to respect structural equivalence.
…r JolieValue, improved unit tests to cover more cases, and made various minor improvements and fixes.
…ed checks to ensure inner class names do not hide outer class names, made linked types use their qualified names such that they can't conflict with inner classes, and made some improvements to the Builder generated for Structures.
… added unit tests to cover this case, improved the way refinements are handled, improved flexibility of placing generated files, and made other minor fixes and updates.
… Jolie2Java's README
…ses is used in the generated classes, and made adjusments to how refinements are validated.
…y JavaServices, added support for JolieValue in JavaService's Embedder class, removed newJavaServices in preparation for pull request, and made minor improvements and fixes.
… more valid identifiers
…ifically target services, interfaces, or types, and removed now unnecessary flags to simplify usage.
…w many exceptions they throw, made it so JavaService also searches for the @requestresponse annotation in inherited interfaces, and updated how services and interfaces are generated accordingly.
|
Please rebase and let's try the CI again. I put Java 21 in the CI on master, it might help. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
@fmontesi there seems to have been made a change to the |
|
@fmontesi I refactored the tests such that they do not call |
|
@Jonaythaz Yes please open an issue for that. @mwallnoefer Perhaps this is caused by the recent patches you made about hashCode for Value? (If I remember correctly, I haven't checked.) Regarding the javadoc tags, can you point me to an example? Is it in your own code or code that you generate from jolie2java? |
I use the tags in some of the classes in the These tags are used in the documentation for the Java standard library, although I can't think of an example off the top of my head, so I don't think it's a problem to just add them, but since they aren't standard I figured I shouldn't do it without asking. |
|
@Jonaythaz maybe keep a look for not introducing new CodeQL warnings. I have tried very hard to reduce them to an absolute minimum over the last few months
Regarding to the
|
|
Maybe something like this could fix it? |
At the very least this doesn't cause loops with any of the instances of
I have some new changes that addresses most of the CodeQL complaints, just waiting for the verdict on the tags before pushing them. Annoyingly CodeQL warns you about unused variable in a switch expression, even though you can't use anonymous variables, i.e. |
Before there was no @fmontesi What do you think, given the importance of a correct |
|
Yes, good idea. Please apply it to both |
|
Would also be good to add a test for this here: https://github.com/jolie/jolie/blob/master/jolie/src/test/java/interpreter/ValueTests.java |
|
Thanks @mwallnoefer! @Jonaythaz, please rebase once again and let's retry. :-) |
@fmontesi before rebasing, what is the verdict on the non-standard tags, add them to the JavaDoc plugin or replace them with a different tag? |
|
Oh, right, about the tags: as long as we don't force users of Jolie and our tools to have custom javadoc configurations, they're fine! Makes sense? |
|
|
||
| private void appendMethods( Definition d ) { | ||
| builder.newline() | ||
| .newlineAppend( "public " ).append( switch ( d ) { case Basic b -> b.type().wrapperType(); case Structure s -> s.contentType().wrapperType(); case Choice c -> ClassPath.JOLIENATIVE.parameterized( "?" ); } ).append( " content() { return option.content(); }" ) |
Check notice
Code scanning / CodeQL
Unread local variable
| final String getField = "t." + f.javaName() + "()"; | ||
| final UnaryOperator<String> setValue = x -> switch ( storedType( f.type() ) ) { | ||
| case Native n when n == Native.ANY || n == Native.VOID -> ".setValue( " + x + ".value() )"; | ||
| case Native n -> ".setValue( " + x + " )"; |
Check notice
Code scanning / CodeQL
Unread local variable
| return switch ( request() ) { | ||
| case Native.VOID -> Optional.empty(); | ||
| case Native n -> Optional.of( n.nativeType() ); | ||
| case Undefined d -> Optional.of( ClassPath.JOLIEVALUE.get() ); |
Check notice
Code scanning / CodeQL
Unread local variable
| return switch( response() ) { | ||
| case Native.VOID -> "void"; | ||
| case Native n -> n.nativeType(); | ||
| case Undefined d -> ClassPath.JOLIEVALUE.get(); |
Check notice
Code scanning / CodeQL
Unread local variable
| private JolieType parse( TypeDefinition typeDefinition, NameSupplier nameSupplier, boolean isInner ) { | ||
| return switch ( typeDefinition ) { | ||
|
|
||
| case TypeDefinitionUndefined ud -> Undefined.getInstance(); |
Check notice
Code scanning / CodeQL
Unread local variable
| @Override | ||
| public String toString() { return ""; } | ||
|
|
||
| public static JolieVoid from( JolieValue j ) { return new JolieVoid(); } |
Check notice
Code scanning / CodeQL
Useless parameter
| qualifiedName( s ) + ".builder()" ); | ||
| } | ||
|
|
||
| private void appendExtraSetters( String fieldName, Choice c ) { |
Check notice
Code scanning / CodeQL
Useless parameter
| qualifiedName( s ) + ".builder()" ); | ||
| } | ||
|
|
||
| private void appendExtraSetters( String fieldName, Choice c ) { |
Check notice
Code scanning / CodeQL
Useless parameter
The only tags used in the generated files is |
Pull request for the new Jolie2Java, the changes made, outside of the jolie2java module, are: