Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jruby 9.3 fixes #919

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/new_relic/language_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def gc_profiler_enabled?
end

def object_space_usable?
if defined?(::JRuby) && JRuby.respond_to?(:runtime)
if jruby?
require 'jruby'
JRuby.runtime.is_object_space_enabled
else
defined?(::ObjectSpace)
Expand Down
2 changes: 2 additions & 0 deletions test/new_relic/language_support_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
class NewRelic::LanguageSupportTest < Minitest::Test
def test_object_space_usable_on_jruby_with_object_space_enabled
return unless NewRelic::LanguageSupport.jruby?
require 'jruby'
JRuby.objectspace = true
assert_truthy NewRelic::LanguageSupport.object_space_usable?
end

def test_object_space_not_usable_on_jruby_with_object_space_disabled
return unless NewRelic::LanguageSupport.jruby?
require 'jruby'
JRuby.objectspace = false
assert_falsy NewRelic::LanguageSupport.object_space_usable?
end
Expand Down