Skip to content

Commit

Permalink
Override getNumberValueExact added in Jackson 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-kraemer committed Jan 17, 2021
1 parent 344ea73 commit 36377e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
18 changes: 14 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ configurations {
integrationTest29 { extendsFrom integrationTestBase }
integrationTest210 { extendsFrom integrationTestBase }
integrationTest211 { extendsFrom integrationTestBase }
integrationTest212 { extendsFrom integrationTestBase }
}

String jacksonCore = 'com.fasterxml.jackson.core:jackson-core:'
Expand All @@ -40,9 +41,9 @@ String junit = 'junit:junit:4.13'
String mongoDbJavaDriver = 'org.mongodb:mongo-java-driver:3.12.6'

dependencies {
compile jacksonCore + '2.11.1'
compile jacksonAnnotations + '2.11.1'
compile jacksonDatabind + '2.11.1'
compile jacksonCore + '2.12.1'
compile jacksonAnnotations + '2.12.1'
compile jacksonDatabind + '2.12.1'

testCompile junit
testCompile mongoDbJavaDriver
Expand Down Expand Up @@ -93,6 +94,10 @@ dependencies {
integrationTest211 jacksonCore + '2.11.1'
integrationTest211 jacksonAnnotations + '2.11.1'
integrationTest211 jacksonDatabind + '2.11.1'

integrationTest212 jacksonCore + '2.12.1'
integrationTest212 jacksonAnnotations + '2.12.1'
integrationTest212 jacksonDatabind + '2.12.1'
}

jar {
Expand Down Expand Up @@ -193,10 +198,15 @@ task doIntegrationTest211(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest211
}

task doIntegrationTest212(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest212
}

task integrationTest(dependsOn: [ doIntegrationTest21, doIntegrationTest22,
doIntegrationTest23, doIntegrationTest24, doIntegrationTest25,
doIntegrationTest26, doIntegrationTest27, doIntegrationTest28,
doIntegrationTest29, doIntegrationTest210, doIntegrationTest211 ])
doIntegrationTest29, doIntegrationTest210, doIntegrationTest211,
doIntegrationTest212 ])

check.dependsOn integrationTest

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/undercouch/bson4jackson/BsonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@ public Number getNumberValue() throws IOException, JsonParseException {
return (Number)getContext().value;
}

@Override
public Number getNumberValueExact() throws IOException {
return getNumberValue();
}

@Override
public JsonParser.NumberType getNumberType() throws IOException, JsonParseException {
if (_currentContext == null) {
Expand Down

0 comments on commit 36377e8

Please sign in to comment.