Skip to content

fix bug reported in #100#101

Merged
e-kotov merged 2 commits intomainfrom
mint
Feb 28, 2026
Merged

fix bug reported in #100#101
e-kotov merged 2 commits intomainfrom
mint

Conversation

@e-kotov
Copy link
Copy Markdown
Owner

@e-kotov e-kotov commented Feb 28, 2026

This pull request improves the reliability of the Java version check subprocess script in the rJavaEnv package, specifically addressing issues when .libPaths() contains multiple paths. The main change refactors how the wrapper script is constructed to avoid duplication and malformed syntax, and adds a targeted regression test to ensure correctness.

Refactor and reliability improvements:

  • Refactored ._java_version_check_rjava_impl_original in R/java_env.R to correctly handle multi-line .libPaths() values by introducing a helper (deparse_collapse) and ensuring function definitions and library paths are included only once and with proper syntax. This prevents duplication and malformed closing parentheses in the generated script.

Testing and regression coverage:

  • Added a new test in tests/testthat/test-java_env_subprocess_regression.R that mocks .libPaths() with multiple paths and validates that the generated script contains the correct function definitions and library path syntax, with no duplication or syntax errors.

Solves #100 .

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (8d7bead) to head (04a8ece).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   88.62%   89.12%   +0.49%     
==========================================
  Files          27       27              
  Lines        2760     2776      +16     
==========================================
+ Hits         2446     2474      +28     
+ Misses        314      302      -12     

☔ 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.

@e-kotov e-kotov merged commit a6bd250 into main Feb 28, 2026
11 checks passed
@e-kotov e-kotov deleted the mint branch February 28, 2026 12:14
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.

1 participant