Skip to content

Conversation

@joakime
Copy link
Contributor

@joakime joakime commented Dec 2, 2025

Using Path to cleanup user input strings for File / Path resolution.

The Java File object cannot operate successfully with the variety of JVMs, Architectures, File Systems, and OSs out there.
Only the Path object has proper support for all combinations.

  • Deprecate IO.asFile(Object)
  • Introduce replacement of IO.asPath(Object) with proper usage.
  • Introduce test cases for Windows path resolution options when using IO.asPath(Object)

Closes #14068

@joakime joakime requested a review from janbartel December 2, 2025 19:00
@joakime joakime self-assigned this Dec 2, 2025
@joakime joakime added the Bug For general bugs on Jetty side label Dec 2, 2025
@joakime joakime moved this to 👀 In review in Jetty 12.1.6 Dec 2, 2025

if (LOG.isDebugEnabled())
LOG.debug("Not able to be converted to a File object: ({}) {}", fileObject.getClass().getName(), fileObject);
LOG.debug("Not able to be converted to a Path object: ({}) {}", pathObject.getClass().getName(), pathObject);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use LOG.atDebug().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no ambiguity here with arguments and Throwable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we standardized on that idiom for every case, not just ambiguities with Throwables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only applies to Throwables, as it eliminates the ambiguity on the last arg not having an associated referenced parameter ({}). If that Throwable happens to be null, then things to sideways with the currently buggy log4j2 implementation. (no other implementations of slf4j).
This is a recognized and accepted bug on log4j2.

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

Labels

Bug For general bugs on Jetty side

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Jetty tmpdir processing doesn't match Java on Windows

2 participants