java.lang.ArrayIndexOutOfBoundsException - JRuby or Ruby bug?

Hello all,

Recently I’ve updated the Prawn gem in one of my projects. It’s an alpha
gem
that’s not officially supporting JRuby, but since it’s 100% pure Ruby I
was
wondering if you could point me in the right direction.

The problem arises when loading a TTF font with Prawn 0.4.1, as such:

require ‘rubygems’
gem ‘prawn’, ‘0.4.1’
require ‘prawn’

Prawn::Document.generate “prawn.pdf” do
font “HelveticaNeue.ttf” # Trying to load a TTF font generates error
text “Hello from JRuby”
end

With earlier versions this didn’t cause problems, but now I get this
strange
(to me at least) error:

org.jruby.RubyArray:758:in eltInternal': java.lang.ArrayIndexOutOfBoundsException: 259 from org.jruby.util.Pack:1141:in encode’
from org.jruby.util.Pack:1435:in pack' from org.jruby.RubyArray:3277:in pack’

Full trace at http://pastie.org/371377

I haven’t looked at the Prawn code yet since the error makes me thing
it’s a
JRuby-related problem. Am I right or could this just as well be an issue
Prawn? I’d like to know where to look.

Thanks,

Martijn

View this message in context:
http://www.nabble.com/java.lang.ArrayIndexOutOfBoundsException---JRuby-or-Ruby-bug--tp21672495p21672495.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Martijn S wrote:

I haven’t looked at the Prawn code yet since the error makes me thing it’s a
JRuby-related problem. Am I right or could this just as well be an issue
Prawn? I’d like to know where to look.

It’s definitely a JRuby problem, and you should file a bug for it. But
first, try a nightly build from http://jruby.headius.com:8080/hudson
under the jruby-dist job. It may already be fixed.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Will do! Thanks for your reply.

Martijn

Charles Oliver N.-2 wrote:

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


View this message in context:
http://www.nabble.com/java.lang.ArrayIndexOutOfBoundsException---JRuby-or-Ruby-bug--tp21672495p21688637.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email