prefer to_s versus toString #23

Closed
azell opened this Issue Apr 27, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

azell commented Apr 27, 2012

With JRuby 1.7dev (which by default runs in Ruby 1.9 mode) and JRE 1.7.0_03, request.getRequestURL can come in as either a Java StringBuffer or a Ruby string. Calling toString on a Ruby string raises an exception. Changing the assignment to:

    env['REQUEST_URI'] = request.getRequestURL.to_s

appears to be safe, regardless of whether getRequestURL is a Java object or Ruby object. I am not sure if it is considered a bug in JRuby 1.7dev for the getRequestURL type to mutate between requests.

JRuby bug report is at: http://jira.codehaus.org/browse/JRUBY-6619

Owner

matadon commented Apr 29, 2012

Done in 0.6.3; thanks for the heads up!

matadon closed this Apr 29, 2012

@dekellum dekellum added a commit to dekellum/fishwife that referenced this issue Oct 22, 2012

@dekellum dekellum Fix toString not-found issue with jruby 1.7.0 (release)
Applies fix for mizuno #23: toString -> to_s (Adam Zell)
278e1bb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment