[ruby/stringio] Various cleanup for JRuby ext

(https://github.com/ruby/stringio/pull/85)

* Fix compile warnings on latest Java.
* Adjust one test for JRuby erroring on bad pos= value.
* Replace hard JVM synchronization with a spin lock.
* Avoid duplicate reads of state fields where possible.
* Remove long-deprecated codepoints, chars, bytes, lines methods.
* Mark fcntl as not implemented
* Split most of the remaining variable-arity methods.

https://github.com/ruby/stringio/commit/31a9d42e6c
This commit is contained in:
Charles Oliver Nutter 2024-03-12 23:46:49 -05:00 committed by git
parent 8c81a6bd61
commit 0b7487b44e

View File

@ -237,8 +237,9 @@ class TestStringIO < Test::Unit::TestCase
def test_write_integer_overflow
f = StringIO.new
f.pos = RbConfig::LIMITS["LONG_MAX"]
assert_raise(ArgumentError) {
# JRuby errors when setting pos to an out-of-range value
f.pos = RbConfig::LIMITS["LONG_MAX"]
f.write("pos + len overflows")
}
end