From 23d1b02dfc482e570951b582b4f0e9e4b0db5459 Mon Sep 17 00:00:00 2001 From: jinhyukify Date: Fri, 10 Apr 2026 00:07:58 +0900 Subject: [PATCH] HBASE-30070 Replace deprecated JRuby LoadService#findFileForLoad with $LOAD_PATH.resolve_feature_path --- hbase-shell/src/main/ruby/irb/hirb.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb b/hbase-shell/src/main/ruby/irb/hirb.rb index 34638f228a9e..a8af81fe9ec7 100644 --- a/hbase-shell/src/main/ruby/irb/hirb.rb +++ b/hbase-shell/src/main/ruby/irb/hirb.rb @@ -209,22 +209,19 @@ module HBaseLoader ## # Determine the loadable path for a given filename by searching through $LOAD_PATH # - # This serves a similar purpose to IRB::IrbLoader#search_file_from_ruby_path, but uses JRuby's - # loader, which allows us to find special paths like "uri:classloader" inside of a Jar. + # Uses $LOAD_PATH.resolve_feature_path, which resolves files on disk as well as + # entries inside jars on the classpath. Returns nil on miss. # # @param [String] filename # @return [String] path def self.path_for_load(filename) return File.absolute_path(filename) if File.exist? filename - # Get JRuby's LoadService from the global (singleton) instance of the runtime - # (org.jruby.Ruby), which allows us to use JRuby's tools for searching the load path. - runtime = org.jruby.Ruby.getGlobalRuntime - loader = runtime.getLoadService - search_state = loader.findFileForLoad filename - raise LoadError, "no such file to load -- #{filename}" if search_state.library.nil? + resolved = $LOAD_PATH.resolve_feature_path(filename) + raise LoadError, "no such file to load -- #{filename}" if resolved.nil? - search_state.loadName + _type, path = resolved + path end ##