Skip to content

Commit 5fbccd8

Browse files
committed
Show foreign readable non-invocable members for java.lang.Class instances
* Which becomes a useful hint to get the Java type from it.
1 parent 6501dc5 commit 5fbccd8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spec/truffle/interop/foreign_inspect_to_s_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@
5353
end
5454
end
5555

56-
describe "Java j.l.Class instance" do
56+
describe "Java java.lang.Class instance" do
5757
it "gives a similar representation to Ruby" do
5858
foreign = Truffle::Interop.java_type("java.math.BigInteger")[:class]
59-
foreign.inspect.should =~ /\A#<Polyglot::ForeignInstantiable\[Java\] java.lang.Class:0x\h+ java.math.BigInteger>\z/
59+
foreign.inspect.should =~ /\A#<Polyglot::ForeignInstantiable\[Java\] java.lang.Class:0x\h+ java.math.BigInteger static={...}>\z/
6060
foreign.to_s.should == "#<Polyglot::ForeignInstantiable[Java] java.math.BigInteger>"
6161
end
6262
end

src/main/ruby/truffleruby/core/truffle/interop_operations.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def self.foreign_inspect_nonrecursive(object)
7777

7878
show_members = true
7979
if Truffle::Interop.java_class?(object) # a java.lang.Class instance, treat it like a regular object
80-
show_members = false
8180
string << " #{Truffle::Interop.to_display_string(object)}"
8281
end
8382
if Truffle::Interop.has_array_elements?(object)

0 commit comments

Comments
 (0)