Skip to content

Commit 566ea30

Browse files
committed
Polishing
1 parent 2bb7164 commit 566ea30

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

spring-core/src/main/java/org/springframework/core/ResolvableType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public ResolvableType asMap() {
389389
* implement or extend the specified class.
390390
* @param type the required class type
391391
* @return a {@link ResolvableType} representing this object as the specified
392-
* type or {@link #NONE}
392+
* type, or {@link #NONE} if not resolvable as that type
393393
* @see #asCollection()
394394
* @see #asMap()
395395
* @see #getSuperType()

spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public TypeDescriptor narrow(Object value) {
201201
/**
202202
* Cast this {@link TypeDescriptor} to a superclass or implemented interface
203203
* preserving annotations and nested type context.
204-
* @param superType the super type to cast to (can be {@code null}
204+
* @param superType the super type to cast to (can be {@code null})
205205
* @return a new TypeDescriptor for the up-cast type
206206
* @throws IllegalArgumentException if this type is not assignable to the super-type
207207
* @since 3.2

spring-core/src/main/java/org/springframework/core/serializer/DefaultSerializer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,8 @@
2222
import java.io.Serializable;
2323

2424
/**
25-
* Serializer that writes an object to an output stream using Java Serialization.
25+
* A {@link Serializer} implementation that writes an object to an output stream
26+
* using Java serialization.
2627
*
2728
* @author Gary Russell
2829
* @author Mark Fisher
@@ -31,8 +32,9 @@
3132
public class DefaultSerializer implements Serializer<Object> {
3233

3334
/**
34-
* Writes the source object to an output stream using Java Serialization.
35+
* Writes the source object to an output stream using Java serialization.
3536
* The source object must implement {@link Serializable}.
37+
* @see ObjectOutputStream#writeObject(Object)
3638
*/
3739
@Override
3840
public void serialize(Object object, OutputStream outputStream) throws IOException {

spring-core/src/main/java/org/springframework/core/serializer/support/SerializingConverter.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,8 @@
2424
import org.springframework.util.Assert;
2525

2626
/**
27-
* A {@link Converter} that delegates to a {@link org.springframework.core.serializer.Serializer}
27+
* A {@link Converter} that delegates to a
28+
* {@link org.springframework.core.serializer.Serializer}
2829
* to convert an object to a byte array.
2930
*
3031
* @author Gary Russell
@@ -37,14 +38,14 @@ public class SerializingConverter implements Converter<Object, byte[]> {
3738

3839

3940
/**
40-
* Create a default SerializingConverter that uses standard Java serialization.
41+
* Create a default {@code SerializingConverter} that uses standard Java serialization.
4142
*/
4243
public SerializingConverter() {
4344
this.serializer = new DefaultSerializer();
4445
}
4546

4647
/**
47-
* Create a SerializingConverter that delegates to the provided {@link Serializer}
48+
* Create a {@code SerializingConverter} that delegates to the provided {@link Serializer}.
4849
*/
4950
public SerializingConverter(Serializer<Object> serializer) {
5051
Assert.notNull(serializer, "Serializer must not be null");
@@ -57,7 +58,7 @@ public SerializingConverter(Serializer<Object> serializer) {
5758
*/
5859
@Override
5960
public byte[] convert(Object source) {
60-
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(256);
61+
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(1024);
6162
try {
6263
this.serializer.serialize(source, byteStream);
6364
return byteStream.toByteArray();

0 commit comments

Comments
 (0)