deepakpanda93 commented on code in PR #19624:
URL: https://github.com/apache/hudi/pull/19624#discussion_r3776096932
##########
hudi-common/src/test/java/org/apache/hudi/common/util/TestReflectionUtils.java:
##########
@@ -57,4 +72,124 @@ void testGetMethod() {
"listDirectEntries", StoragePathFilter.class).isPresent());
assertFalse(getMethod(HoodieStorage.class,
"nonExistentMethod").isPresent());
}
+
+ /**
+ * An exploded directory on the classpath, reached over the "file" protocol.
Built explicitly
+ * rather than relying on the test classpath, because under Maven the
modules are jars and this
+ * branch would never be entered.
+ */
+ @Test
+ void testGetTopLevelClassesInClasspathFromDirectory(@TempDir Path tempDir)
throws Exception {
+ String scanned = ReflectionUtils.class.getPackage().getName();
+ Path root = tempDir.resolve("classes");
+ Path pkgDir = root.resolve(scanned.replace('.',
java.io.File.separatorChar));
Review Comment:
Done in `2fb140cf2f43`, thanks. `import java.io.File;` added and the line
now reads:
```java
Path pkgDir = root.resolve(scanned.replace('.', File.separatorChar));
```
Applied it in one more place while I was there: the class javadoc a few
lines below had
`{@link java.io.File}`, qualified for the same reason. That is now `{@link
File}`, so the file does
not qualify the type in one spot and import it in another.
Re-ran after the change: `TestReflectionUtils` 7/7, and `checkstyle:check`
clean on `hudi-common`
(worth running, since adding an import is exactly what `UnusedImports` would
flag if the type were
only referenced from javadoc).
--
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]