Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new RubyStringBuilder.str api to create inspected string for Exception #5927

Merged

Conversation

@jlahtinen
Copy link
Contributor

jlahtinen commented Oct 20, 2019

pull request fix for #5923

new StringBuilder(2 + rubyClass.length() + 2 + exception.size() + 1).
append("#<").append(rubyClass).append(": ").append(exception.getByteList()).append('>')
);
String exceptionStartStr = new StringBuilder(2 + rubyClass.length() + 2).append("#<").append(rubyClass).append(": ").toString();

This comment has been minimized.

Copy link
@kares

kares Oct 21, 2019

Member

you should nuke the explicit StringBuilder here - it's not needed (you could just + if the API is not enough)

This comment has been minimized.

Copy link
@jlahtinen

jlahtinen Oct 21, 2019

Author Contributor

I think nuking is done now.

This comment has been minimized.

Copy link
@kares

kares Oct 21, 2019

Member

the last round-trip (Ruby -> Java -> Ruby string) is redundant, but we can fix that later ...

Joni Lahtinen
Compiler makes it as good as it can be and code is easier to read.
@kares kares merged commit 131bcdf into jruby:master Oct 21, 2019
5 checks passed
5 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jruby.jruby Build #20191021.6 succeeded
Details
jruby.jruby (Job linux) Job linux succeeded
Details
jruby.jruby (Job mac) Job mac succeeded
Details
jruby.jruby (Job windows) Job windows succeeded
Details
@kares kares added this to the JRuby 9.2.9.0 milestone Oct 21, 2019
@enebo

This comment has been minimized.

Copy link
Member

enebo commented Oct 21, 2019

Super cool. I may change the signature to be ruby,string,irubyobject,string,irubyobject,string but thanks for this work. We really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.