Skip to content

Add tests of unicode character support in Java class file names#8768

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-628-unicode
Open

Add tests of unicode character support in Java class file names#8768
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-628-unicode

Conversation

@tautschnig
Copy link
Collaborator

Add regression tests for unicode class and method names.

Fixes: #628

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Feb 24, 2026
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>
@tautschnig tautschnig marked this pull request as ready for review March 18, 2026 23:26
Copilot AI review requested due to automatic review settings March 18, 2026 23:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .class suffix from the single main-class command-line argument in both jbmc and janalyzer.
  • 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
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.41%. Comparing base (1690ff0) to head (bf7e107).

Files with missing lines Patch % Lines
jbmc/src/janalyzer/janalyzer_parse_options.cpp 50.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unicode support for java class files

2 participants