[
https://issues.apache.org/jira/browse/SOLR-18057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062521#comment-18062521
]
ASF subversion and git services commented on SOLR-18057:
--------------------------------------------------------
Commit b891851af53c8a1f754f05498995ef3cc504100f in solr's branch
refs/heads/main from openworld-maker
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=b891851af53 ]
SOLR-18057: Prefer Path.resolve over Path.of for derived paths (#4174)
Co-authored-by: Kamlendra <[email protected]>
> Review Path.of for places where Path.resolve should be used
> -----------------------------------------------------------
>
> Key: SOLR-18057
> URL: https://issues.apache.org/jira/browse/SOLR-18057
> Project: Solr
> Issue Type: Improvement
> Reporter: Eric Pugh
> Priority: Minor
> Labels: newdev, pull-request-available
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Plucked from discussion
> [https://github.com/apache/solr/pull/3988#discussion_r2659300249]
>
> Specifically in BinaryFieldTest we have:
>
> | // Copy the custom schema for binary field tests|
> | String sourceConfDir = TEST_HOME() + "/collection1/conf";|
>
> "If you look carefully at what's happening here (was before), this is sad.
> TEST_HOME() returns a Path, which we toString via string concatenation to a
> String representing a path, and then a line below we create a Path via
> {{{}Path.of{}}}. Obviously we should instead be using the {{resolve}} method
> on Path. The tell-tale sign of the problem is the usage of {{Path.of}} which
> we should ideally use sparingly (when we truly have a String input that can't
> be a Path)."
>
> This ticket would be to look at places we are using Path.of on a string and
> see if we are doing some extra conversion steps instead of using a
> Path.resolve.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]