Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix top-level bubbled exception rendering.
Previous logic often caused OOM because of improve use of the buffer and append logic in ThreadContext. New logic reuses existing "raw" format logic avoiding one-off bugs. Output of a bubbled exception now renders properly and looks like other "nice" formatted exceptions (bug introduced for example): [] ~/projects/jruby $ jruby -S rake spec:ruby:fast Unhandled Java exception: java.lang.NullPointerException: null java.lang.NullPointerException: null aryToAry at org/jruby/runtime/Helpers.java:1634 toAry at org/jruby/runtime/IRBlockBody.java:109 doYield at org/jruby/runtime/IRBlockBody.java:144 yield at org/jruby/runtime/BlockBody.java:77 yield at org/jruby/runtime/Block.java:147 synchronize at org/jruby/ext/thread/Mutex.java:151 call at org/jruby/internal/runtime/methods/JavaMethod.java:494 cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:273 callBlock at org/jruby/runtime/callsite/CachingCallSite.java:79 call at org/jruby/runtime/callsite/CachingCallSite.java:83 interpret at org/jruby/ir/instructions/CallBase.java:419 processCall at org/jruby/ir/interpreter/InterpreterEngine.java:322 interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:77 interpret at org/jruby/ir/interpreter/InterpreterEngine.java:89 INTERPRET_METHOD at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:232 call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:218 call at org/jruby/internal/runtime/methods/DynamicMethod.java:205 cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:333 call at org/jruby/runtime/callsite/CachingCallSite.java:195 <top> at /Users/headius/projects/jruby/bin/rake:22 invokeWithArguments at java/lang/invoke/MethodHandle.java:627 load at org/jruby/ir/Compiler.java:111 runScript at org/jruby/Ruby.java:820 runScript at org/jruby/Ruby.java:812 runNormally at org/jruby/Ruby.java:750 runFromMain at org/jruby/Ruby.java:572 doRunFromMain at org/jruby/Main.java:408 internalRun at org/jruby/Main.java:303 run at org/jruby/Main.java:232 main at org/jruby/Main.java:201