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

Regression(?) in String#% from 9.1.7.0 to 9.1.8.0 #4542

Closed
mwpastore opened this Issue Mar 23, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@mwpastore

mwpastore commented Mar 23, 2017

Environment

Darwin poseidon.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

Expected Behavior

jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [darwin-x86_64]
irb(main):001:0> '%<adapter>s://%<host>s/%<database>s?user=%<user>s&password=%<password>s' % {:adapter=>"jdbc:postgresql", :host=>"TFB-database", :database=>"hello_world", :user=>"benchmarkdbuser", :password=>"benchmarkdbpass"}
=> "jdbc:postgresql://TFB-database/hello_world?user=benchmarkdbuser&password=benchmarkdbpass"

Actual Behavior

jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [darwin-x86_64]
irb(main):001:0> '%<adapter>s://%<host>s/%<database>s?user=%<user>s&password=%<password>s' % {:adapter=>"jdbc:postgresql", :host=>"TFB-database", :database=>"hello_world", :user=>"benchmarkdbuser", :password=>"benchmarkdbpass"}
ArgumentError: name<host> after <adapter>
	from org/jruby/RubyString.java:1191:in `%'
	from (irb):1:in `<eval>'
	from org/jruby/RubyKernel.java:1000:in `eval'
	from org/jruby/RubyKernel.java:1298:in `loop'
	from org/jruby/RubyKernel.java:1120:in `catch'
	from org/jruby/RubyKernel.java:1120:in `catch'
	from /Users/mwp/.rbenv/versions/jruby-9.1.8.0/bin/irb:13:in `<main>'
@mwpastore

This comment has been minimized.

Show comment
Hide comment
@mwpastore

mwpastore Mar 23, 2017

Kernel.sprintf suffers from the same regression.

Using the format-less %{ .. } syntax (instead of %< .. >s) seems to work around the issue in both cases.

mwpastore commented Mar 23, 2017

Kernel.sprintf suffers from the same regression.

Using the format-less %{ .. } syntax (instead of %< .. >s) seems to work around the issue in both cases.

mwpastore added a commit to mwpastore/FrameworkBenchmarks that referenced this issue Mar 23, 2017

[Ruby] Update MRI 2.4 and JRuby 9.1 versions
...and work-around a regression in JRuby's String#% and Kernel.sprintf
(jruby/jruby#4542).

nbrady-techempower added a commit to TechEmpower/FrameworkBenchmarks that referenced this issue Mar 23, 2017

[Ruby] Fix TorqueBox label and update MRI/JRuby versions (#2604)
* [Ruby] Fix TorqueBox benchmark descriptions

* [Ruby] Update MRI 2.4 and JRuby 9.1 versions

...and work-around a regression in JRuby's String#% and Kernel.sprintf
(jruby/jruby#4542).

@enebo enebo added this to the JRuby 9.1.9.0 milestone Mar 23, 2017

@enebo enebo added the regression label Mar 23, 2017

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Mar 23, 2017

Member

Several commits since 9.1.8.0 have fixed all known %/sprintf bugs (except one negative value with %u issue). This particular case is working as expected. 9.1.9.0 in a week or so...

Member

enebo commented Mar 23, 2017

Several commits since 9.1.8.0 have fixed all known %/sprintf bugs (except one negative value with %u issue). This particular case is working as expected. 9.1.9.0 in a week or so...

@enebo enebo closed this Mar 23, 2017

@mwpastore

This comment has been minimized.

Show comment
Hide comment
@mwpastore

mwpastore Mar 23, 2017

Great! Thank you.

mwpastore commented Mar 23, 2017

Great! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment