aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpigelvy <pigelvy@users.noreply.github.com>2017-04-25 14:16:57 +0200
committerGitHub <noreply@github.com>2017-04-25 14:16:57 +0200
commit67410025e75c12a3437cb2270f5c218d989b1be3 (patch)
tree37df64f6f69729a1b193ea7ccc36052740cb64b7
parentf6f4ef58a21f8b12af417427e8607f52c5a7b147 (diff)
downloadgeojson-jackson-67410025e75c12a3437cb2270f5c218d989b1be3.tar.gz
LngLatAltSerializer#serialize throws useless JsonProcessingException
IntelliJ code inspection warns me that: "There is a more general exception, 'java.io.IOException', in the throws list already" Declaring "JsonProcessingException" in the throws list is thus useless! This is a more general problem of jackson-databind but I think we can change the method signature without introducing regressions. What do you think?
-rw-r--r--src/main/java/org/geojson/jackson/LngLatAltSerializer.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/org/geojson/jackson/LngLatAltSerializer.java b/src/main/java/org/geojson/jackson/LngLatAltSerializer.java
index ae9a6da..a313d66 100644
--- a/src/main/java/org/geojson/jackson/LngLatAltSerializer.java
+++ b/src/main/java/org/geojson/jackson/LngLatAltSerializer.java
@@ -5,26 +5,20 @@ import java.io.IOException;
import org.geojson.LngLatAlt;
import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
-public class LngLatAltSerializer extends JsonSerializer<LngLatAlt>
-{
+public class LngLatAltSerializer extends JsonSerializer<LngLatAlt> {
@Override
- public void serialize(LngLatAlt value, JsonGenerator jgen, SerializerProvider provider)
- throws IOException, JsonProcessingException
- {
+ public void serialize(LngLatAlt value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeStartArray();
jgen.writeNumber(value.getLongitude());
jgen.writeNumber(value.getLatitude());
- if (value.hasAltitude())
- {
+ if (value.hasAltitude()) {
jgen.writeNumber(value.getAltitude());
- for (double d : value.getAdditionalElements())
- {
+ for (double d : value.getAdditionalElements()) {
jgen.writeNumber(d);
}
}