rdblue commented on code in PR #4826:
URL: https://github.com/apache/iceberg/pull/4826#discussion_r996150238


##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -567,40 +565,29 @@ public void testGCEnabled() {
   }
 
   private String getTableBasePath(String tableName) {
-    String databasePath = temp.toString() + "/" + DB_NAME;
-    return Paths.get(databasePath, tableName).toAbsolutePath().toString();
-  }
-
-  protected Path getTableLocationPath(String tableName) {
-    return new Path("file", null, 
Paths.get(getTableBasePath(tableName)).toString());
-  }
-
-  protected String getTableLocation(String tableName) {
-    return getTableLocationPath(tableName).toString();
-  }
-
-  private String metadataLocation(String tableName) {
-    return Paths.get(getTableBasePath(tableName), "metadata").toString();
+    return temp.toURI() + DB_NAME + "/" + tableName;
   }
 
   @SuppressWarnings(
       "RegexpSinglelineJava") // respecting this rule requires a lot more 
lines of code
-  private List<String> metadataFiles(String tableName) {
-    return Arrays.stream(Objects.requireNonNull(new 
File(metadataLocation(tableName)).listFiles()))
+  private List<String> metadataFiles(File tablePath) {
+    return Arrays.stream(
+            Objects.requireNonNull(
+                new File((tablePath + "/" + "metadata").replace("file:", 
"")).listFiles()))

Review Comment:
   This looks like a safe way to work with strings, but not with files. It 
looks like you're still fighting the representation used everywhere. Here, you 
convert file to string, do custom manipulation, and go back to file. That seems 
needlessly complicated and has implications for readability and correctness 
(what does `new File(...)` return that requires `"file:"` to need removed??).



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to