jruby/jruby — pull request #2067 by pabloatplumbee (2014-10-23 13:08:48+00:00)
Title: Made Exception#set_backtrace compliant with Ruby documentation

This change fixes https://github.com/jruby/jruby/issues/1919, and makes jRuby complaint with ```Exception#set_backtrace``` documentation, which states that:
> The backtrace must be an array of String objects or a single String in the format described in #backtrace.

This behaviour is confirmed in different MRI versions:

**ruby-1.9.3-p545**
```ruby
1.9.3-p545 :001 > Exception.new.set_backtrace 'foo'
=> ["foo"]
1.9.3-p545 :002 >
```
**ruby-2.0.0-p0**
```ruby
irb(main):001:0> Exception.new.set_backtrace 'foo'
=> ["foo"]
```
**ruby-2.1.1**
``` ruby
2.1.1 :001 > Exception.new.set_backtrace 'foo'
=> ["foo"]
```
But not in jruby:

**jruby-1.7.11**
```ruby
jruby-1.7.11 :001 > Exception.new.set_backtrace 'foo'
TypeError: backtrace must be Array of String
from org/jruby/RubyException.java:95:in `set_backtrace'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1121:in `eval'
from org/jruby/RubyKernel.java:1521:in `loop'
from org/jruby/RubyKernel.java:1284:in `catch'
from org/jruby/RubyKernel.java:1284:in `catch'
from /home/pablo/.rvm/rubies/jruby-1.7.11/bin/irb:13:in `(root)'
```
**jruby-1.7.13**
```ruby
jruby-1.7.13 :001 > Exception.new.set_backtrace 'foo'
TypeError: backtrace must be Array of String
from org/jruby/RubyException.java:95:in `set_backtrace'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1101:in `eval'
from org/jruby/RubyKernel.java:1501:in `loop'
from org/jruby/RubyKernel.java:1264:in `catch'
from org/jruby/RubyKernel.java:1264:in `catch'
from /home/pablo/.rvm/rubies/jruby-1.7.13/bin/irb:13:in `(root)'
```