Skip to content

Upgrade to Java 25, modernize build/CI, and refactor dynamic compiler internals#3

Draft
raulgomis wants to merge 1 commit intomasterfrom
feature/update-coding-style-and-quality
Draft

Upgrade to Java 25, modernize build/CI, and refactor dynamic compiler internals#3
raulgomis wants to merge 1 commit intomasterfrom
feature/update-coding-style-and-quality

Conversation

@raulgomis
Copy link
Copy Markdown
Owner

@raulgomis raulgomis commented Apr 11, 2026

Motivation

  • Move the project to a modern JDK/tooling baseline (Java 25) and modernize CI to run tests on feature branches and master.
  • Improve internal robustness by using immutable/final fields, thread-safe collections and clearer error handling.
  • Update tests and utilities to use current Java and JUnit APIs for clearer and safer test code.

Description

  • CI/workflows: added /.github/workflows/feature-branches.yml and updated /.github/workflows/master.yml to use actions/checkout@v4, actions/setup-java@v4 with JDK 25, and run mvn -B test; added contents: read permissions.
  • Build: updated pom.xml to set maven.compiler.release to 25, consolidate to junit-jupiter with property junit.jupiter.version, upgraded maven-compiler-plugin to 3.14.1 and maven-surefire-plugin to 3.5.4.
  • Runtime refactors: made many internal fields final, replaced HashMap with ConcurrentHashMap in DynamicClassLoader, removed debug println, simplified and clarified method signatures, and replaced deprecated/fragile calls (e.g. Class#newInstance) with getDeclaredConstructor().newInstance().
  • API and utils: improved URI handling to throw IllegalArgumentException for bad URIs, used List.of/List.copyOf for diagnostics, improved getDiagnosticsError formatting, used Files.readString in test utilities, and small naming/signature cleanups (e.g. parameter renames and null-safety checks).
  • Tests and test helpers: updated test implementations to JUnit Jupiter idioms (assertThrows, descriptive test names), simplified CompilerExecutor and CompilerTestUtils, and adjusted test inputs/fixtures accordingly.
  • Documentation: updated README.md to mention Java 25 and to modernize example usage.

Testing

  • Ran mvn -B test (JUnit Jupiter) against the updated project and the unit test suite completed successfully.
  • CI workflows added/updated to run mvn -B test on feature branch pushes and PRs to master (configured in the new/updated workflow files).

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant