Skip to content
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

Update to java 11 and newer mockito and junit to compile #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="https://maven.apache.org/POM/4.0.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
Expand All @@ -26,7 +28,7 @@
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand All @@ -41,8 +43,8 @@
</developers>

<properties>
<java-version>1.6</java-version>
<jackson-version>2.10.0</jackson-version>
<java-version>11</java-version>
<jackson-version>2.16.1</jackson-version>
</properties>

<dependencies>
Expand All @@ -64,13 +66,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -120,5 +122,11 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<url>https://repo.maven.apache.org/maven2/</url>
<id>apache</id>
</repository>
</repositories>

</project>
9 changes: 4 additions & 5 deletions src/main/java/org/geojson/jackson/LngLatAltDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public LngLatAlt deserialize(JsonParser jp, DeserializationContext ctxt) throws
if (jp.isExpectedStartArrayToken()) {
return deserializeArray(jp, ctxt);
}
throw ctxt.mappingException(LngLatAlt.class);
throw ctxt.wrongTokenException(jp,LngLatAlt.class, JsonToken.START_ARRAY, "expected JSON Array");
}

protected LngLatAlt deserializeArray(JsonParser jp, DeserializationContext ctxt) throws IOException {
Expand Down Expand Up @@ -46,23 +46,22 @@ private double extractDouble(JsonParser jp, DeserializationContext ctxt, boolean
if (optional)
return Double.NaN;
else
throw ctxt.mappingException("Unexpected end-of-input when binding data into LngLatAlt");
throw ctxt.instantiationException(LngLatAltDeserializer.class, "Unexpected end-of-input when binding data into LngLatAlt");
} else {
switch (token) {
case END_ARRAY:
if (optional)
return Double.NaN;
else
throw ctxt.mappingException("Unexpected end-of-input when binding data into LngLatAlt");
throw ctxt.instantiationException( this.getClass(), "Unexpected end-of-input when binding data into LngLatAlt");
case VALUE_NUMBER_FLOAT:
return jp.getDoubleValue();
case VALUE_NUMBER_INT:
return jp.getLongValue();
case VALUE_STRING:
return jp.getValueAsDouble();
default:
throw ctxt.mappingException(
"Unexpected token (" + token.name() + ") when binding data into LngLatAlt");
throw ctxt.instantiationException(this.getClass(), "Unexpected token (" + token.name() + ") when binding data into LngLatAlt");
}
}
}
Expand Down