File tree Expand file tree Collapse file tree
main/java/com/uber/h3core
test/java/com/uber/h3core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public static NativeMethods loadNatives() throws IOException {
9393 return loadNatives (os , arch );
9494 }
9595
96- private static File createTempLibraryFile (OperatingSystem os ) throws IOException {
96+ static File createTempLibraryFile (OperatingSystem os ) throws IOException {
9797 // Check if the user specified a custom directory for native libraries
9898 String customDir = System .getProperty ("h3.native.dir" );
9999 File dir = customDir != null ? new File (customDir ) : null ;
Original file line number Diff line number Diff line change @@ -78,12 +78,8 @@ void testCustomNativeDir() throws Exception {
7878 H3CoreLoader .OperatingSystem currentOs =
7979 H3CoreLoader .detectOs (System .getProperty ("java.vendor" ), System .getProperty ("os.name" ));
8080
81- java .lang .reflect .Method method =
82- H3CoreLoader .class .getDeclaredMethod (
83- "createTempLibraryFile" , H3CoreLoader .OperatingSystem .class );
84- method .setAccessible (true );
85-
86- File tempFile = (File ) method .invoke (null , currentOs );
81+ // Call the package-private method directly! No reflection needed.
82+ File tempFile = H3CoreLoader .createTempLibraryFile (currentOs );
8783
8884 org .junit .jupiter .api .Assertions .assertTrue (
8985 tempFile .getAbsolutePath ().startsWith (new File (customDir ).getAbsolutePath ()),
You can’t perform that action at this time.
0 commit comments