Skip to content

Instantly share code, notes, and snippets.

@griff
Created June 8, 2010 14:25
Show Gist options
  • Save griff/430092 to your computer and use it in GitHub Desktop.
Save griff/430092 to your computer and use it in GitHub Desktop.
Some small code to illustrate a bug in JRuby
class BugTest1 < Hash
# Any interface will do
include Java::JavaLang::Runnable
def run
puts "Hello from BugTest1"
end
end
class OrderHash < Hash
end
class BugTest2 < OrderHash
# Any interface will do
include Java::JavaLang::Runnable
def run
puts "Hello from BugTest2"
end
end
# Works just fine
BugTest1.new
# ClassCastException
BugTest2.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment