Polishing

This commit is contained in:
Juergen Hoeller
2016-10-21 12:26:27 +02:00
parent be187babf9
commit 3726c6f18d
37 changed files with 104 additions and 120 deletions

View File

@@ -241,7 +241,7 @@ public abstract class Conventions {
public static String getQualifiedAttributeName(Class<?> enclosingClass, String attributeName) {
Assert.notNull(enclosingClass, "'enclosingClass' must not be null");
Assert.notNull(attributeName, "'attributeName' must not be null");
return enclosingClass.getName() + "." + attributeName;
return enclosingClass.getName() + '.' + attributeName;
}

View File

@@ -37,7 +37,6 @@ import org.springframework.core.io.support.ResourceRegion;
import org.springframework.util.Assert;
import org.springframework.util.MimeType;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.ResourceUtils;
import org.springframework.util.StreamUtils;
/**
@@ -73,6 +72,7 @@ public class ResourceRegionEncoder extends AbstractEncoder<ResourceRegion> {
}
@Override
@SuppressWarnings("unchecked")
public Flux<DataBuffer> encode(Publisher<? extends ResourceRegion> inputStream,
DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) {
@@ -138,10 +138,10 @@ public class ResourceRegionEncoder extends AbstractEncoder<ResourceRegion> {
long end = start + region.getCount() - 1;
OptionalLong contentLength = contentLength(region.getResource());
if (contentLength.isPresent()) {
return getAsciiBytes("Content-Range: bytes " + start + "-" + end + "/" + contentLength.getAsLong() + "\r\n\r\n");
return getAsciiBytes("Content-Range: bytes " + start + '-' + end + '/' + contentLength.getAsLong() + "\r\n\r\n");
}
else {
return getAsciiBytes("Content-Range: bytes " + start + "-" + end + "\r\n\r\n");
return getAsciiBytes("Content-Range: bytes " + start + '-' + end + "\r\n\r\n");
}
}