Browse Source

Turned ByteBufferConverter's visibility to package level

pull/375/head
Juergen Hoeller 12 years ago
parent
commit
bd4c64af04
  1. 3
      spring-core/src/main/java/org/springframework/core/convert/support/ByteBufferConverter.java
  2. 7
      spring-websocket/src/test/java/org/springframework/web/socket/adapter/ConvertingEncoderDecoderSupportTests.java

3
spring-core/src/main/java/org/springframework/core/convert/support/ByteBufferConverter.java

@ -30,8 +30,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter; @@ -30,8 +30,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter;
* any type that the {@link ConversionService} support via {@code byte[]}.
*
* @author Phillip Webb
* @since 4.0
*/
public class ByteBufferConverter implements ConditionalGenericConverter {
final class ByteBufferConverter implements ConditionalGenericConverter {
private static final TypeDescriptor BYTE_BUFFER_TYPE = TypeDescriptor.valueOf(ByteBuffer.class);

7
spring-websocket/src/test/java/org/springframework/web/socket/adapter/ConvertingEncoderDecoderSupportTests.java

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.web.socket.adapter;
import java.nio.ByteBuffer;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EncodeException;
@ -28,13 +27,14 @@ import org.junit.Before; @@ -28,13 +27,14 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.support.ByteBufferConverter;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
@ -188,8 +188,7 @@ public class ConvertingEncoderDecoderSupportTests { @@ -188,8 +188,7 @@ public class ConvertingEncoderDecoderSupportTests {
@Bean
public ConversionService webSocketConversionService() {
GenericConversionService conversionService = new GenericConversionService();
conversionService.addConverter(new ByteBufferConverter(conversionService));
GenericConversionService conversionService = new DefaultConversionService();
conversionService.addConverter(new MyTypeToStringConverter());
conversionService.addConverter(new MyTypeToBytesConverter());
conversionService.addConverter(new StringToMyTypeConverter());

Loading…
Cancel
Save