Add tests of unicode character support in Java class file names#8768
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Add tests of unicode character support in Java class file names#8768tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
Add regression tests for unicode class and method names. Strip .class suffix from the main class argument early in jbmc and janalyzer to avoid it being treated as part of the class name during entry point resolution. Fixes: diffblue#628 Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
c2b0a99 to
bf7e107
Compare
There was a problem hiding this comment.
Pull request overview
Adds regression tests to ensure JBMC/Janalyzer handle Unicode identifiers in Java class/method names, including invoking a main class given as a .class filename.
Changes:
- Strip a trailing
.classsuffix from the single main-class command-line argument in bothjbmcandjanalyzer. - Add regression tests for Unicode method names, Unicode class names, and Unicode class filenames (
ЮЛ.class). - Add new Java test programs using Unicode identifiers (note: two added Java files appear to have an invalid/missing path in the diff).
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| jbmc/src/jbmc/jbmc_parse_options.cpp | Strips .class suffix from the main-class CLI argument |
| jbmc/src/janalyzer/janalyzer_parse_options.cpp | Mirrors .class suffix stripping for janalyzer |
| jbmc/regression/jbmc/unicode-method-name/test.desc | New regression descriptor for Unicode method-name scenario |
| jbmc/regression/jbmc/unicode-method-name/f.java | New Java program using a Unicode method name |
| jbmc/regression/jbmc/unicode-class-name/test.desc | New regression descriptor for Unicode class-name scenario |
| jbmc/regression/jbmc/unicode-class-filename/test.desc | New regression descriptor for passing ЮЛ.class as the main class |
(invalid path in diff: a/ b/) |
Two Java source files added, but with missing/invalid repository paths in the diff |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+438
to
+440
| // Strip .class suffix if present | ||
| if(has_suffix(main_class, ".class")) | ||
| main_class.resize(main_class.size() - 6); |
|
|
||
| // Strip .class suffix if present | ||
| if(has_suffix(main_class, ".class")) | ||
| main_class.resize(main_class.size() - 6); |
Comment on lines
+7
to
+9
| -- | ||
| ^CONVERSION ERROR | ||
| -- |
Comment on lines
+1
to
+3
| public class f | ||
| { | ||
| void ЮЛ() |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8768 +/- ##
===========================================
- Coverage 80.41% 80.41% -0.01%
===========================================
Files 1703 1703
Lines 188398 188402 +4
Branches 73 73
===========================================
- Hits 151509 151499 -10
- Misses 36889 36903 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add regression tests for unicode class and method names.
Fixes: #628