diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpResponse.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpResponse.java index 17c097fdcfd..746b335b807 100644 --- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpResponse.java +++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpResponse.java @@ -98,24 +98,23 @@ public class ApacheHttpResponse implements IHttpResponse { } if (charset == null) { if (Constants.STATUS_HTTP_204_NO_CONTENT != myResponse.getStatusLine().getStatusCode()) { - ourLog.warn("Response did not specify a charset."); + ourLog.debug("Response did not specify a charset, defaulting to utf-8"); } charset = Charset.forName("UTF-8"); } - Reader reader = new InputStreamReader(readEntity(), charset); - return reader; + return new InputStreamReader(readEntity(), charset); } @Override public Map> getAllHeaders() { - Map> headers = new HashMap>(); + Map> headers = new HashMap<>(); if (myResponse.getAllHeaders() != null) { for (Header next : myResponse.getAllHeaders()) { String name = next.getName().toLowerCase(); List list = headers.get(name); if (list == null) { - list = new ArrayList(); + list = new ArrayList<>(); headers.put(name, list); } list.add(next.getValue()); @@ -131,7 +130,7 @@ public class ApacheHttpResponse implements IHttpResponse { if (headers == null) { headers = new Header[0]; } - List retVal = new ArrayList(); + List retVal = new ArrayList<>(); for (Header next : headers) { retVal.add(next.getValue()); } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java index 1b388001c7e..f1c30fcecc7 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/validation/InstanceValidator.java @@ -292,7 +292,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat source = Source.InstanceValidator; } - +t @Override public boolean isNoInvariantChecks() { diff --git a/src/changes/changes.xml b/src/changes/changes.xml index ce8306977c6..ead24aa43cb 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -64,6 +64,11 @@ If-Match header when passed in via Bundle.entry.request.ifMatch]]> value + + In Apache client, remove a log message at WARN level when the response does not + specify a charset. This log line often showed up any time a server was not supplying + a response, making client logs quite noisy +