Created
June 8, 2010 14:25
-
-
Save griff/430092 to your computer and use it in GitHub Desktop.
Some small code to illustrate a bug in JRuby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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