Skip to content

Commit

Permalink
Update ASM mangled package to reflect JRuby 1.6.0.RC3 and higher.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 5, 2011
1 parent 3dbb04e commit 9e7aaf5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/bitescript/asm.rb
Expand Up @@ -3,16 +3,25 @@
module BiteScript
module ASM
begin
# try mangled names for the version included with JRuby
# try mangled names for the version included with JRuby <=1.6.0.RC2
java.lang.Class.for_name 'jruby.objectweb.asm.Opcodes'

# no error, proceed with mangled name
asm_package = Java::jruby.objectweb.asm
java_import asm_package.Opcodes
rescue Exception
# fall back on standard names
asm_package = org.objectweb.asm
java_import asm_package.Opcodes
begin
# try mangled names for the version included with JRuby >=1.6.0.RC3
java.lang.Class.for_name 'org.jruby.org.objectweb.asm.Opcodes'

# no error, proceed with mangled name
asm_package = Java::org.jruby.org.objectweb.asm
java_import asm_package.Opcodes
rescue
# fall back on standard names
asm_package = org.objectweb.asm
java_import asm_package.Opcodes
end
end
java_import asm_package.Label
java_import asm_package.Type
Expand Down

0 comments on commit 9e7aaf5

Please sign in to comment.