attilapiros commented on a change in pull request #28940:
URL: https://github.com/apache/spark/pull/28940#discussion_r447682473
##########
File path:
common/network-shuffle/src/test/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolverSuite.java
##########
@@ -147,22 +147,20 @@ public void jsonSerializationOfExecutorRegistration()
throws IOException {
@Test
public void testNormalizeAndInternPathname() {
- assertPathsMatch("/foo", "bar", "baz",
- File.separator + "foo" + File.separator + "bar" + File.separator +
"baz");
- assertPathsMatch("//foo/", "bar/", "//baz",
- File.separator + "foo" + File.separator + "bar" + File.separator +
"baz");
- assertPathsMatch("foo", "bar", "baz///",
- "foo" + File.separator + "bar" + File.separator + "baz");
- assertPathsMatch("/foo/", "/bar//", "/baz",
- File.separator + "foo" + File.separator + "bar" + File.separator +
"baz");
- assertPathsMatch("/", "", "", File.separator);
- assertPathsMatch("/", "/", "/", File.separator);
+ String sep = File.separator;
+ String expectedPathname1 = sep + "foo" + sep + "bar" + sep + "baz";
Review comment:
Extracting a variable which only used once just increases the
indirection.
Especially here where the role of the value is trivial. If it would be
something complex then I might understand to use a describing name but here not.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]