Entity Provider for java.nio.file.Path - #1275
Conversation
d4c5f73 to
ad24cfd
Compare
jim-krueger
left a comment
There was a problem hiding this comment.
Looks good. I see no reason not to add this.
jim-krueger
left a comment
There was a problem hiding this comment.
Upon further review: I have some comments/questions.
|
Will answer open question ASAP, unfortunately CORONA hit me, so it might take a few days. Sorry! |
|
Get well Markus, no rush. Also, it seems like now would be a good time to create a release plan for 4.1 (or 5.0 if needed) and add this to it. @spericas / others, do you concur? |
Do we have any release drivers for 4.1? |
As long as we all commit to really getting 5.0 thru the door in time, then I have no driver for 4.1. Looking at how things worked out in the past months, I doubt that this time it will work out better than the years before, so maybe we should start with 4.1 instead of 5.0... |
|
Kindly asking everybody to vote on this PR. Thanks! :-) |
|
What is the real benefit in natively supporting |
Besides migrating JAX-RS's API to modern Java, it mostly is performance (not necessarily speed, but mostly power savings). In short, there is a huge difference how a file is handled by the JRE (all work done by JRE) internally to how a path is (if any possible, all work offloaded to OS). Falling back to files, when you actually have a path, is squandering valuable resources. In modern Java, nobody should ever go with file but always with path. If you are interested in more details, we should spin-off the thread. |
@jansupol How does Jersey handle |
From what I gather, the implementations for Path and File are basically identical:
Based on this, it's difficult to justify the advantages over the costs of needing to update all implementations, docs, etc. that this PR proposes. |
No need to convince me. It was me who wrote "PathProvider". In fact, I would even go as far to say that support for "File" should become deprecated eventually. It simply is dead legacy. As an OpenJDK NIO2 contributor I like to make everybody understand that "File" is a rather outdated concept, while "Path" is what every new software should go with. The difference is not what Jersey does, but what the JRE does. For those interested in the details, I would be more than happy to explain in a separate thread. Edit: The core idea of this MR is to modernize JAX-RS, and using "Path" should be a no-brainer, actually. Sticking with File but not supporting Path is simply ridiculous and draws a picture of an old man's ancient not actively maintained API. |
From an API perspective, I understand that |
Santiago, I think there is a misunderstanding, so let me clarify -- even if I still think that it would be better to start a new thread elsewhere, as this explanation is partly off-topic IMHO as it is about OpenJDK and Jersey, not about JAX-RS. Maybe my reasoning was misleading. I do not see why you link this PR with my current implementation inside Jersey in particular (which is something which might change further over time, and which I actually changed in the NIO2-area several times just recently, so for this PR it plays absolutely no role how good or not-so-well done my solution in Jersey is currently or will be in future); the idea of this PR is to allow optimized implementations, which might or might not happen eventually or might or might not exist currently. Current Jersey itelf might or might not experience a benefit from Looking at OpenJDK's source code of
Jersey: I already optimized Jersey (at least in part) for NIO2, i. e. for native use of Regarding your non-technical arguments, I like to say the following:
|
The discussion is very much about JAX-RS, the side note about implementations was prompted by your performance claims.
JAX-RS implementations drive the JRE, the JRE does not drive itself. I'm not opposed to this new feature, but as I stated above, I'm not convinced it is worth the effort. Hopefully others can comment and we can proceed with it. |
|
Given we support the File, I would not want to restrain the customers from using NIO API, On the other hand, I see the real usage of Path much lower than the usage of the Status Codes defined in RFC 9110, which still did not make it to Jakarta REST |
|
Now that we all have exchanged our personal opinions, in the name of modern Java, I do beg all committers to vote +1. Thanks. |
|
As the PR is finally authored, and as Jersey is already implementing this feature, can anybody please tell me a good reason why we not simply merge this into the spec? I am willing to invest all needed efforts into all compliant implementations to fulfil this change if this helps. |
|
Kindly asking to resume this discussion. This PR would help to let JAX-RS look more modern, it is already supported by Jersey, and it would be just straight forward. Please don't stand in the way on modernization. Thanks. |
|
As stated before, I'm +0 on this one |
|
I do not see why we should not adopt this MR as-is. Kindly asking for votes from @arjantijms @jamezp. Side note: Jersey supports this since years. |
|
I'm still of the opinion, even more so now, that we don't use the Introducing TCK tests that may not run for a new requirement doesn't seem right to me. |
|
I see your point (I did not know that what I did "is not running"). What do you want me to change in this PR to get it accepted? |
With the exception of |
Thank you! If have remove |
|
@arjantijms Jersey is already supporting this since several releases (I implemented it long time ago). Kindly asking for your vote hereby, as it therefore does not imply any negative impact or effort for Jersey. Thanks. 🙂 |
jamezp
left a comment
There was a problem hiding this comment.
Minor comment on the assertion id's, but that might be to my lack of understanding how they are used.
|
@jakartaee/ee4j-rest-committers Kindly asking more committers for votes. |
Closing #1274
This pull request provides the needed changes in the spec document and the TCK to support
java.nio.file.Pathentity providers.