Fix REST path encoding, Java Unicode escaping, and monitor initialization#1653
Fix REST path encoding, Java Unicode escaping, and monitor initialization#1653hoco-scy wants to merge 5 commits into
Conversation
|
hi @hoco-scy ! |
|
Hi @arcuri82, Yes, I am a student of @man-zhang. Thank you for the guidance. I apologize that I had not read I have now read the document and understand the expected internal contribution process. I will close the issues, keep the technical context in the PR description, make sure the CI process is completed on my fork, and then follow the review flow through @man-zhang. Thank you again for your time and help. |
12a0f4d to
6a526ce
Compare
| @@ -0,0 +1,36 @@ | |||
| @file:Suppress("DEPRECATION") | |||
There was a problem hiding this comment.
remove unnecessary annotation
There was a problem hiding this comment.
Removed the unnecessary @file:Suppress("DEPRECATION") annotation in fe79f8e. I also confirmed that the affected tests compile and pass without it.
Thank you.
| .replace("\b", "\\b") | ||
| .replace("\t", "\\t") | ||
|
|
||
| if (format.isJava()) { |
There was a problem hiding this comment.
This handle needs to move with the format.isKotlin().
This fix seems to relate to ret.replace("\\\\u", "\\u").
Does it also happen in Kotlin? can you add a test for Kotlin as well.
In addition, can you add an example in the comment to explain this fix?
There was a problem hiding this comment.
Thank you for pointing this out. I investigated the Kotlin behavior and addressed it in fe79f8e.
Kotlin was affected by the same issue. The previous Kotlin branch called ret.replace("\\\\u", "\\u"), which reduced the doubled source backslash to a single backslash-u sequence. As a result:
- a malformed sequence such as
\uquWOnjcould make the generated Kotlin source fail to compile; - a valid sequence such as
\u0041could compile but change the runtime value toA, instead of preserving the literal\u0041text.
I verified the fix in the following ways:
- Extended
bodyEscapesKeepLiteralBackslashUForJvmFormatsto cover Java JUnit 4/5 and Kotlin JUnit 4/5. - Added
kotlinBodyWriterPreservesLiteralBackslashUAtRuntime, which generates an actual Kotlin class, compiles it withCompilerForTestGenerated, loads the compiled class, invokes its methods, and checks the runtime string values. - Covered malformed backslash-u text, valid
\u0041text, repeated backslashes, and Kotlin dollar-sign escaping. - Kept the existing non-JVM behavior for JavaScript and Python unchanged.
The verification confirms that the generated Kotlin source now compiles successfully and preserves the original runtime strings, including literal \u0041, rather than converting it to A.
I also added concrete malformed and valid examples to the source comment as requested.
|
Hi @man-zhang, I have addressed both review comments in fe79f8e:
The latest full CI run for the same PR head commit has completed successfully: 22 jobs passed, with only the conditional CI run: Could you please take another look when convenient? Thank you. |
Summary
This PR fixes four independent failures observed while generating and running EvoMaster tests across the WebFuzzing SUT suite:
Changes
Scope
Tests