Browse Source

Polishing

pull/1423/head
Juergen Hoeller 9 years ago
parent
commit
f25c6ba9bc
  1. 4
      spring-web/src/main/java/org/springframework/http/converter/json/AbstractJsonHttpMessageConverter.java
  2. 3
      spring-web/src/test/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverterTests.java

4
spring-web/src/main/java/org/springframework/http/converter/json/AbstractJsonHttpMessageConverter.java

@ -104,7 +104,7 @@ public abstract class AbstractJsonHttpMessageConverter extends AbstractGenericHt
return readInternal(resolvedType, reader); return readInternal(resolvedType, reader);
} }
catch (Exception ex) { catch (Exception ex) {
throw new HttpMessageNotReadableException("Could not read JSON document: " + ex.getMessage(), ex); throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
} }
} }
@ -120,7 +120,7 @@ public abstract class AbstractJsonHttpMessageConverter extends AbstractGenericHt
writeInternal(o, type, writer); writeInternal(o, type, writer);
} }
catch (Exception ex) { catch (Exception ex) {
throw new HttpMessageNotWritableException("Could not write JSON document: " + ex.getMessage(), ex); throw new HttpMessageNotWritableException("Could not write JSON: " + ex.getMessage(), ex);
} }
writer.close(); writer.close();
} }

3
spring-web/src/test/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverterTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2017 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -32,7 +32,6 @@ import org.springframework.http.MediaType;
import org.springframework.http.MockHttpInputMessage; import org.springframework.http.MockHttpInputMessage;
import org.springframework.http.MockHttpOutputMessage; import org.springframework.http.MockHttpOutputMessage;
import org.springframework.http.converter.AbstractHttpMessageConverter; import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.json.MappingJacksonValue; import org.springframework.http.converter.json.MappingJacksonValue;
import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.CoreMatchers.*;

Loading…
Cancel
Save