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

Refactor : remove superfluous exceptions in throws declaration #3763

Closed
Closed
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
51 changes: 25 additions & 26 deletions src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2873,8 +2873,7 @@ public boolean isEnabled(StreamWriteFeature f) {
@Override
@SuppressWarnings("unchecked")
public <T> T readValue(JsonParser p, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
{
throws IOException {
_assertNotNull("p", p);
return (T) _readValue(getDeserializationConfig(), p, _typeFactory.constructType(valueType));
}
Expand All @@ -2898,7 +2897,7 @@ public <T> T readValue(JsonParser p, Class<T> valueType)
@Override
@SuppressWarnings("unchecked")
public <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("p", p);
return (T) _readValue(getDeserializationConfig(), p, _typeFactory.constructType(valueTypeRef));
Expand All @@ -2922,7 +2921,7 @@ public <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef)
@Override
@SuppressWarnings("unchecked")
public final <T> T readValue(JsonParser p, ResolvedType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("p", p);
return (T) _readValue(getDeserializationConfig(), p, (JavaType) valueType);
Expand All @@ -2942,7 +2941,7 @@ public final <T> T readValue(JsonParser p, ResolvedType valueType)
*/
@SuppressWarnings("unchecked")
public <T> T readValue(JsonParser p, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("p", p);
return (T) _readValue(getDeserializationConfig(), p, valueType);
Expand Down Expand Up @@ -3536,7 +3535,7 @@ public boolean canDeserialize(JavaType type, AtomicReference<Throwable> cause)
*/
@SuppressWarnings("unchecked")
public <T> T readValue(File src, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueType));
Expand All @@ -3556,7 +3555,7 @@ public <T> T readValue(File src, Class<T> valueType)
*/
@SuppressWarnings({ "unchecked" })
public <T> T readValue(File src, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
Expand All @@ -3576,7 +3575,7 @@ public <T> T readValue(File src, TypeReference<T> valueTypeRef)
*/
@SuppressWarnings("unchecked")
public <T> T readValue(File src, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), valueType);
Expand All @@ -3602,7 +3601,7 @@ public <T> T readValue(File src, JavaType valueType)
*/
@SuppressWarnings("unchecked")
public <T> T readValue(URL src, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueType));
Expand All @@ -3613,7 +3612,7 @@ public <T> T readValue(URL src, Class<T> valueType)
*/
@SuppressWarnings({ "unchecked" })
public <T> T readValue(URL src, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
Expand All @@ -3624,7 +3623,7 @@ public <T> T readValue(URL src, TypeReference<T> valueTypeRef)
*/
@SuppressWarnings("unchecked")
public <T> T readValue(URL src, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), valueType);
Expand Down Expand Up @@ -3684,55 +3683,55 @@ public <T> T readValue(String content, JavaType valueType)

@SuppressWarnings("unchecked")
public <T> T readValue(Reader src, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueType));
}

@SuppressWarnings({ "unchecked" })
public <T> T readValue(Reader src, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
}

@SuppressWarnings("unchecked")
public <T> T readValue(Reader src, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), valueType);
}

@SuppressWarnings("unchecked")
public <T> T readValue(InputStream src, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueType));
}

@SuppressWarnings({ "unchecked" })
public <T> T readValue(InputStream src, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
}

@SuppressWarnings("unchecked")
public <T> T readValue(InputStream src, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), valueType);
}

@SuppressWarnings("unchecked")
public <T> T readValue(byte[] src, Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueType));
Expand All @@ -3741,39 +3740,39 @@ public <T> T readValue(byte[] src, Class<T> valueType)
@SuppressWarnings("unchecked")
public <T> T readValue(byte[] src, int offset, int len,
Class<T> valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src, offset, len), _typeFactory.constructType(valueType));
}

@SuppressWarnings({ "unchecked" })
public <T> T readValue(byte[] src, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
}

@SuppressWarnings({ "unchecked" })
public <T> T readValue(byte[] src, int offset, int len, TypeReference<T> valueTypeRef)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src, offset, len), _typeFactory.constructType(valueTypeRef));
}

@SuppressWarnings("unchecked")
public <T> T readValue(byte[] src, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src), valueType);
}

@SuppressWarnings("unchecked")
public <T> T readValue(byte[] src, int offset, int len, JavaType valueType)
throws IOException, StreamReadException, DatabindException
throws IOException
{
_assertNotNull("src", src);
return (T) _readMapAndClose(_jsonFactory.createParser(src, offset, len), valueType);
Expand Down Expand Up @@ -3806,7 +3805,7 @@ public <T> T readValue(DataInput src, JavaType valueType) throws IOException
* JSON output, written to File provided.
*/
public void writeValue(File resultFile, Object value)
throws IOException, StreamWriteException, DatabindException
throws IOException
{
_writeValueAndClose(createGenerator(resultFile, JsonEncoding.UTF8), value);
}
Expand All @@ -3823,7 +3822,7 @@ public void writeValue(File resultFile, Object value)
* is closed).
*/
public void writeValue(OutputStream out, Object value)
throws IOException, StreamWriteException, DatabindException
throws IOException
{
_writeValueAndClose(createGenerator(out, JsonEncoding.UTF8), value);
}
Expand All @@ -3847,7 +3846,7 @@ public void writeValue(DataOutput out, Object value) throws IOException
* is closed).
*/
public void writeValue(Writer w, Object value)
throws IOException, StreamWriteException, DatabindException
throws IOException
{
_writeValueAndClose(createGenerator(w), value);
}
Expand Down