Consistent use of Charset.forName over JDK 7 StandardCharsets in 4.x line
This commit is contained in:
@@ -20,7 +20,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Principal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -539,7 +538,7 @@ public class SendToMethodReturnValueHandlerTests {
|
||||
Message<?> message = this.messageCaptor.getValue();
|
||||
assertNotNull(message);
|
||||
|
||||
String bytes = new String((byte[]) message.getPayload(), StandardCharsets.UTF_8);
|
||||
String bytes = new String((byte[]) message.getPayload(), Charset.forName("UTF-8"));
|
||||
assertEquals("{\"withView1\":\"with\"}", bytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,6 @@ package org.springframework.messaging.simp.annotation.support;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Principal;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
@@ -179,7 +178,7 @@ public class SubscriptionMethodReturnValueHandlerTests {
|
||||
Message<?> message = this.messageCaptor.getValue();
|
||||
assertNotNull(message);
|
||||
|
||||
assertEquals("{\"withView1\":\"with\"}", new String((byte[]) message.getPayload(), StandardCharsets.UTF_8));
|
||||
assertEquals("{\"withView1\":\"with\"}", new String((byte[]) message.getPayload(), Charset.forName("UTF-8")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user