Skip to content

Improve compatibility with newer Java, Spring, and Windows file handling#1506

Open
jlouvel wants to merge 5 commits into
2.7from
issue-1505-modern-java-compatibility
Open

Improve compatibility with newer Java, Spring, and Windows file handling#1506
jlouvel wants to merge 5 commits into
2.7from
issue-1505-modern-java-compatibility

Conversation

@jlouvel
Copy link
Copy Markdown
Collaborator

@jlouvel jlouvel commented May 14, 2026

Closes #1505

Summary

  • tighten Spring bean resolution and null-safety handling in the Spring extension and its tests
  • update integrations and tests for current Gson, Jackson, FreeMarker, Jetty, JAAS, and OpenAPI APIs and warnings
  • make local temporary file creation work on non-POSIX file systems such as Windows and improve ZIP/request stream cleanup in core classes
  • clean up a few smaller compatibility issues in core code and tests, including duplicate media-type handling and deprecated API suppressions

Validation

  • ./mvnw.cmd -pl org.restlet "-Dtest=org.restlet.data.ZipClientTestCase" test
  • ./mvnw.cmd -pl org.restlet,org.restlet.ext.freemarker,org.restlet.ext.gson,org.restlet.ext.jaas,org.restlet.ext.jackson,org.restlet.ext.json,org.restlet.ext.openapi,org.restlet.ext.spring,org.restlet.ext.thymeleaf,org.restlet.ext.xml -am test
    This broader run still fails in org.restlet.data.ZipClientTestCase when executed as part of the full core suite on Windows/Java 25. The isolated ZIP test passes on this branch, and a clean origin/2.7 worktree reproduces the pre-existing Windows failure caused by unsupported initial POSIX temp-file permissions.

- adapt Spring integration and related tests to stricter null-safety and bean lookup handling
- update library integrations and tests for current APIs, deprecations, and warnings
- fix temp-file permission handling on non-POSIX filesystems and tighten ZIP stream cleanup

Refs #1505
@jlouvel jlouvel self-assigned this May 14, 2026
@jlouvel jlouvel requested a review from thboileau May 14, 2026 17:33
@jlouvel
Copy link
Copy Markdown
Collaborator Author

jlouvel commented May 14, 2026

Included follow-up fixes for newer Java and Windows temp-file behavior.

Changes:

  • Adjusted SpringBeanRouterTestCase null guarding so JDT/Spring null analysis accepts the helper path cleanly
  • Updated FileClientHelper to create upload temp files inside a dedicated temp directory, apply POSIX permissions only when supported, and clean up the temp directory after move/delete paths
  • Updated ZipClientHelper with the same Windows-safe temp directory pattern and cleanup on both success and failure paths

Validation:

  • ./mvnw -pl org.restlet -am -DskipTests compile
  • ./mvnw -pl org.restlet.ext.spring -am -Dtest=SpringBeanRouterTestCase -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl org.restlet -Dtest=ZipClientTestCase,RangeTestCase,DirectoryTestCase test

All targeted checks passed. There is still JaCoCo noise on this JDK about unsupported class file major version 69 during test startup, but the selected tests completed successfully.

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants