Skip to content

Commit 3684a1b

Browse files
committed
Merge branch '2.18' into issue388
2 parents 58c5f1e + a390dde commit 3684a1b

File tree

140 files changed

+3451
-1090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+3451
-1090
lines changed

.github/workflows/dep_build_v2.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Re-build on jackson-databind v2 push
2+
on:
3+
repository_dispatch:
4+
types: [jackson-databind-pushed]
5+
# just for testing
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
# Do we want wide matrix build? For now, limited
14+
runs-on: 'ubuntu-22.04'
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
java_version: ['8', '17', '21']
19+
env:
20+
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
21+
steps:
22+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
23+
- name: Set up JDK
24+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
25+
with:
26+
distribution: 'temurin'
27+
java-version: ${{ matrix.java_version }}
28+
cache: 'maven'
29+
- name: Build and test
30+
run: ./mvnw -B -ff -ntp clean verify
31+
32+
# No recursive rebuild (yet?)

.github/workflows/dep_build_v3.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Re-build on jackson-databind v3 push
2+
on:
3+
repository_dispatch:
4+
types: [jackson-databind-pushed-v3]
5+
# just for testing
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
# Do we want wide matrix build? For now, limited
14+
runs-on: 'ubuntu-22.04'
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
java_version: ['8', '17', '21']
19+
env:
20+
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
21+
steps:
22+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
23+
with:
24+
ref: master
25+
- name: Set up JDK
26+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
27+
with:
28+
distribution: 'temurin'
29+
java-version: ${{ matrix.java_version }}
30+
cache: 'maven'
31+
- name: Build and test
32+
run: ./mvnw -B -ff -ntp clean verify
33+
34+
# No recursive rebuild (yet?)

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ on:
44
branches:
55
- master
66
- "3.0"
7-
- "2.16"
7+
- "2.18"
88
paths-ignore:
99
- "README.md"
1010
- "release-notes/*"
1111
pull_request:
1212
branches:
1313
- master
1414
- "3.0"
15-
- "2.16"
15+
- "2.18"
1616
paths-ignore:
1717
- "README.md"
1818
- "release-notes/*"
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v4
3434
- name: Set up JDK
35-
uses: actions/setup-java@v3
35+
uses: actions/setup-java@v4
3636
with:
3737
distribution: 'temurin'
3838
java-version: ${{ matrix.java_version }}
@@ -60,7 +60,7 @@ jobs:
6060
run: ./mvnw -B -q -ff -ntp test
6161
- name: Publish code coverage
6262
if: github.event_name != 'pull_request' && matrix.java_version == '8'
63-
uses: codecov/codecov-action@v3
63+
uses: codecov/codecov-action@v4
6464
with:
6565
token: ${{ secrets.CODECOV_TOKEN }}
6666
file: ./target/site/jacoco/jacoco.xml

avro/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To use this extension on Maven-based projects, use following dependency:
2323
<dependency>
2424
<groupId>com.fasterxml.jackson.dataformat</groupId>
2525
<artifactId>jackson-dataformat-avro</artifactId>
26-
<version>2.8.5</version>
26+
<version>2.16.0</version>
2727
</dependency>
2828
```
2929

@@ -114,7 +114,7 @@ and that's about it, for now.
114114

115115
## Avro Logical Types
116116

117-
Following is an extract from [Logical Types](http://avro.apache.org/docs/current/spec.html#Logical+Types) paragraph in
117+
Following is an extract from [Logical Types](http://avro.apache.org/docs/current/specification/_print/#logical-types) paragraph in
118118
Avro schema specification:
119119
> A logical type is an Avro primitive or complex type with extra attributes to represent a derived type. The attribute
120120
> `logicalType` is always be present for a logical type, and is a string with the name of one of the logical types

avro/pom.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.fasterxml.jackson.dataformat</groupId>
1111
<artifactId>jackson-dataformats-binary</artifactId>
12-
<version>2.16.3-SNAPSHOT</version>
12+
<version>2.18.3-SNAPSHOT</version>
1313
</parent>
1414
<artifactId>jackson-dataformat-avro</artifactId>
1515
<name>Jackson dataformat: Avro</name>
@@ -47,23 +47,20 @@ abstractions.
4747
<dependency>
4848
<groupId>org.apache.avro</groupId>
4949
<artifactId>avro</artifactId>
50-
<version>1.8.2</version>
50+
<version>1.11.3</version>
5151
</dependency>
5252

5353
<!-- and for testing we need logback -->
5454
<dependency>
5555
<groupId>ch.qos.logback</groupId>
5656
<artifactId>logback-classic</artifactId>
57-
<version>1.2.13</version>
57+
<version>1.3.14</version>
5858
<scope>test</scope>
5959
</dependency>
6060
<!-- For validating more complex comparisons -->
61-
<!-- 27-Feb-2017, tatu: NOTE! Can NOT use 3.x as it requires Java 8
62-
-->
6361
<dependency>
6462
<groupId>org.assertj</groupId>
6563
<artifactId>assertj-core</artifactId>
66-
<version>2.5.0</version>
6764
<scope>test</scope>
6865
</dependency>
6966
</dependencies>

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/AvroParser.java

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -250,19 +250,25 @@ public Object getTypeId() throws IOException {
250250
*/
251251

252252
@Override
253-
public JsonLocation getTokenLocation()
254-
{
253+
public JsonLocation currentLocation() {
255254
// !!! TODO
256255
return null;
257256
}
258257

259258
@Override
260-
public JsonLocation getCurrentLocation()
261-
{
259+
public JsonLocation currentTokenLocation() {
262260
// !!! TODO
263261
return null;
264262
}
265263

264+
@Deprecated // since 2.17
265+
@Override
266+
public JsonLocation getCurrentLocation() { return currentLocation(); }
267+
268+
@Deprecated // since 2.17
269+
@Override
270+
public JsonLocation getTokenLocation() { return currentTokenLocation(); }
271+
266272
/*
267273
/**********************************************************
268274
/* Parsing
@@ -278,17 +284,8 @@ public JsonLocation getCurrentLocation()
278284
/**********************************************************
279285
*/
280286

281-
@Override
282-
public abstract boolean hasTextCharacters();
283-
284-
@Override
285-
public abstract String getText() throws IOException;
286-
287-
@Override
288-
public abstract int getText(Writer writer) throws IOException;
289-
290-
@Override
291-
public String getCurrentName() throws IOException {
287+
@Override // since 2.17
288+
public String currentName() throws IOException {
292289
return _avroContext.getCurrentName();
293290
}
294291

@@ -300,16 +297,28 @@ public void overrideCurrentName(String name)
300297
if (_currToken == JsonToken.START_OBJECT || _currToken == JsonToken.START_ARRAY) {
301298
ctxt = ctxt.getParent();
302299
}
303-
/* 24-Sep-2013, tatu: Unfortunate, but since we did not expose exceptions,
304-
* need to wrap this here
305-
*/
300+
// 24-Sep-2013, tatu: Unfortunate, but since we did not expose exceptions,
301+
// need to wrap this here
306302
try {
307303
ctxt.setCurrentName(name);
308304
} catch (IOException e) {
309305
throw new IllegalStateException(e);
310306
}
311307
}
312308

309+
@Deprecated // since 2.17
310+
@Override
311+
public String getCurrentName() throws IOException { return currentName(); }
312+
313+
@Override
314+
public abstract boolean hasTextCharacters();
315+
316+
@Override
317+
public abstract String getText() throws IOException;
318+
319+
@Override
320+
public abstract int getText(Writer writer) throws IOException;
321+
313322
@Override
314323
public char[] getTextCharacters() throws IOException {
315324
String text = getText();

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/AvroSerializerModifier.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
public class AvroSerializerModifier
2020
extends BeanSerializerModifier
2121
{
22+
private static final long serialVersionUID = 1L;
23+
2224
@Override
2325
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
2426
BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties)
@@ -32,9 +34,8 @@ public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
3234
Iterator<BeanPropertyWriter> it = beanProperties.iterator();
3335
while (it.hasNext()) {
3436
BeanPropertyWriter prop = it.next();
35-
if ("schema".equals(prop.getName())) {
37+
if ("schema".equals(prop.getName()) || "specificData".equals(prop.getName())) {
3638
it.remove();
37-
break;
3839
}
3940
}
4041
}

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/AvroTypeIdResolver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
public class AvroTypeIdResolver extends ClassNameIdResolver
2323
{
24+
private static final long serialVersionUID = 1L;
25+
2426
private final Map<String, Class<?>> _idTypes = new HashMap<>();
2527

2628
// 04-Jan-2021, tatu: Not sure why this is being kept around, not used as of

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/apacheimpl/ApacheAvroParserImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.io.Writer;
66

77
import org.apache.avro.io.BinaryDecoder;
8-
import org.apache.avro.io.BinaryEncoder;
98
import org.apache.avro.io.DecoderFactory;
109

1110
import com.fasterxml.jackson.core.*;

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/apacheimpl/AvroRecyclerPools.java

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.fasterxml.jackson.core.util.RecyclerPool;
88
import com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase;
99
import com.fasterxml.jackson.core.util.RecyclerPool.ConcurrentDequePoolBase;
10-
import com.fasterxml.jackson.core.util.RecyclerPool.LockFreePoolBase;
1110

1211
public final class AvroRecyclerPools
1312
{
@@ -58,24 +57,6 @@ public static RecyclerPool<ApacheCodecRecycler> newConcurrentDequePool() {
5857
return ConcurrentDequePool.construct();
5958
}
6059

61-
/**
62-
* Accessor for getting the shared/global {@link LockFreePool} instance.
63-
*
64-
* @return Globally shared instance of {@link LockFreePool}.
65-
*/
66-
public static RecyclerPool<ApacheCodecRecycler> sharedLockFreePool() {
67-
return LockFreePool.GLOBAL;
68-
}
69-
70-
/**
71-
* Accessor for constructing a new, non-shared {@link LockFreePool} instance.
72-
*
73-
* @return Globally shared instance of {@link LockFreePool}.
74-
*/
75-
public static RecyclerPool<ApacheCodecRecycler> newLockFreePool() {
76-
return LockFreePool.construct();
77-
}
78-
7960
/**
8061
* Accessor for getting the shared/global {@link BoundedPool} instance.
8162
*
@@ -105,7 +86,7 @@ public static RecyclerPool<ApacheCodecRecycler> newBoundedPool(int size) {
10586
/**
10687
* {@link ThreadLocal}-based {@link RecyclerPool} implementation used for
10788
* recycling {@link ApacheCodecRecycler} instances:
108-
* see {@link RecyclerPool.ThreadLocalPoolBase} for full explanation
89+
* see {@code RecyclerPool.ThreadLocalPoolBase} for full explanation
10990
* of functioning.
11091
*/
11192
public static class ThreadLocalPool
@@ -195,42 +176,6 @@ protected Object readResolve() {
195176
}
196177
}
197178

198-
/**
199-
* {@link RecyclerPool} implementation that uses
200-
* a lock free linked list for recycling instances.
201-
*<p>
202-
* Pool is unbounded: see {@link RecyclerPool} for
203-
* details on what this means.
204-
*/
205-
public static class LockFreePool extends LockFreePoolBase<ApacheCodecRecycler>
206-
{
207-
private static final long serialVersionUID = 1L;
208-
209-
protected static final LockFreePool GLOBAL = new LockFreePool(SERIALIZATION_SHARED);
210-
211-
// // // Life-cycle (constructors, factory methods)
212-
213-
protected LockFreePool(int serialization) {
214-
super(serialization);
215-
}
216-
217-
public static LockFreePool construct() {
218-
return new LockFreePool(SERIALIZATION_NON_SHARED);
219-
}
220-
221-
@Override
222-
public ApacheCodecRecycler createPooled() {
223-
return new ApacheCodecRecycler();
224-
}
225-
226-
// // // JDK serialization support
227-
228-
// Make sure to re-link to global/shared or non-shared.
229-
protected Object readResolve() {
230-
return _resolveToShared(GLOBAL).orElseGet(() -> construct());
231-
}
232-
}
233-
234179
/**
235180
* {@link RecyclerPool} implementation that uses
236181
* a bounded queue ({@link ArrayBlockingQueue} for recycling instances.

0 commit comments

Comments
 (0)