Skip to content

Commit 883ea5a

Browse files
authored
Merge branch 'master' into sm/java-vector-simd
2 parents 3990e3a + 9e6067b commit 883ea5a

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
- { os: ubuntu-latest , ruby: truffleruby-head }
4141
exclude:
4242
- { os: windows-latest, ruby: jruby }
43-
- { os: windows-latest, ruby: jruby-head }
4443

4544
steps:
4645
- uses: actions/checkout@v5

.github/workflows/sync-ruby.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Sync ruby
2+
on:
3+
push:
4+
branches: [master]
5+
jobs:
6+
sync:
7+
name: Sync ruby
8+
runs-on: ubuntu-latest
9+
if: ${{ github.repository_owner == 'ruby' }}
10+
steps:
11+
- uses: actions/checkout@v5
12+
13+
- name: Create GitHub App token
14+
id: app-token
15+
uses: actions/create-github-app-token@v2
16+
with:
17+
app-id: 2060836
18+
private-key: ${{ secrets.RUBY_SYNC_DEFAULT_GEMS_PRIVATE_KEY }}
19+
owner: ruby
20+
repositories: ruby
21+
22+
- name: Sync to ruby/ruby
23+
uses: convictional/[email protected]
24+
with:
25+
owner: ruby
26+
repo: ruby
27+
workflow_file_name: sync_default_gems.yml
28+
github_token: ${{ steps.app-token.outputs.token }}
29+
ref: master
30+
client_payload: |
31+
{"gem":"${{ github.event.repository.name }}","before":"${{ github.event.before }}","after":"${{ github.event.after }}"}
32+
propagate_failure: true
33+
wait_interval: 10

CHANGES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
### Unreleased
44

5+
### 2025-10-07 (2.15.1)
6+
7+
* Fix incorrect escaping in the JRuby extension when encoding shared strings.
8+
9+
### 2025-09-22 (2.15.0)
10+
511
* `JSON::Coder` callback now receive a second argument to convey whether the object is a hash key.
6-
* Tuned the floating point number generator to not use scientific notation as agressively.
12+
* Tuned the floating point number generator to not use scientific notation as aggressively.
713

814
### 2025-09-18 (2.14.1)
915

java/src/json/ext/SWARBasicStringEncoder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ void encode(ByteList src) throws IOException {
2727
// slice a string, the underlying byte array is the same, but the
2828
// begin index and real size are different. When reading from the ptrBytes
2929
// array, we need to always add ptr to the index.
30-
ByteBuffer bb = ByteBuffer.wrap(ptrBytes, ptr, len);
30+
ByteBuffer bb = ByteBuffer.wrap(ptrBytes, 0, ptr + len);
31+
3132
while (pos + 8 <= len) {
32-
long x = bb.getLong(pos);
33+
long x = bb.getLong(ptr + pos);
3334
if (skipChunk(x)) {
3435
pos += 8;
3536
continue;
@@ -48,7 +49,7 @@ void encode(ByteList src) throws IOException {
4849
}
4950

5051
if (pos + 4 <= len) {
51-
int x = bb.getInt(pos);
52+
int x = bb.getInt(ptr + pos);
5253
if (skipChunk(x)) {
5354
pos += 4;
5455
}

lib/json/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module JSON
4-
VERSION = '2.14.1'
4+
VERSION = '2.15.1'
55
end

test/json/json_encoding_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def test_generate_shared_string
3535
# Ref: https://github.com/ruby/json/issues/859
3636
s = "01234567890"
3737
assert_equal '"234567890"', JSON.dump(s[2..-1])
38+
s = '01234567890123456789"a"b"c"d"e"f"g"h'
39+
assert_equal '"\"a\"b\"c\"d\"e\"f\"g\""', JSON.dump(s[20, 15])
3840
s = "0123456789001234567890012345678900123456789001234567890"
3941
assert_equal '"23456789001234567890012345678900123456789001234567890"', JSON.dump(s[2..-1])
40-
4142
s = "0123456789001234567890012345678900123456789001234567890"
4243
assert_equal '"567890012345678900123456789001234567890012345678"', JSON.dump(s[5..-3])
4344
end

0 commit comments

Comments
 (0)