From f6ebc4ce977e49d800b5ea5332dd4b5934eb0706 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 11 Feb 2016 22:24:50 +0100 Subject: [PATCH] Polishing --- .../convert/support/NumberToNumberConverterFactory.java | 6 +++--- .../convert/support/StringToNumberConverterFactory.java | 3 ++- .../java/org/springframework/core/io/AbstractResource.java | 6 +++--- .../web/servlet/resource/DefaultResourceResolverChain.java | 5 ++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/NumberToNumberConverterFactory.java b/spring-core/src/main/java/org/springframework/core/convert/support/NumberToNumberConverterFactory.java index b98af70e31..773721a234 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/NumberToNumberConverterFactory.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/NumberToNumberConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 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. @@ -40,8 +40,7 @@ import org.springframework.util.NumberUtils; * @see java.math.BigDecimal * @see NumberUtils */ -final class NumberToNumberConverterFactory implements ConverterFactory, - ConditionalConverter { +final class NumberToNumberConverterFactory implements ConverterFactory, ConditionalConverter { @Override public Converter getConverter(Class targetType) { @@ -53,6 +52,7 @@ final class NumberToNumberConverterFactory implements ConverterFactory implements Converter { private final Class targetType; diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/StringToNumberConverterFactory.java b/spring-core/src/main/java/org/springframework/core/convert/support/StringToNumberConverterFactory.java index 506dcec929..172e8d2d5d 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/StringToNumberConverterFactory.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/StringToNumberConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 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. @@ -45,6 +45,7 @@ final class StringToNumberConverterFactory implements ConverterFactory(targetType); } + private static final class StringToNumber implements Converter { private final Class targetType; diff --git a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java index cd00102035..1bc9e1b934 100644 --- a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -123,8 +123,8 @@ public abstract class AbstractResource implements Resource { */ @Override public long contentLength() throws IOException { - InputStream is = this.getInputStream(); - Assert.state(is != null, "resource input stream must not be null"); + InputStream is = getInputStream(); + Assert.state(is != null, "Resource InputStream must not be null"); try { long size = 0; byte[] buf = new byte[255]; diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultResourceResolverChain.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultResourceResolverChain.java index 7bb638f206..501f2371c4 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultResourceResolverChain.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/DefaultResourceResolverChain.java @@ -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. @@ -78,12 +78,11 @@ class DefaultResourceResolverChain implements ResourceResolverChain { private ResourceResolver getNext() { Assert.state(this.index <= this.resolvers.size(), - "Current index exceeds the number of configured ResourceResolver's"); + "Current index exceeds the number of configured ResourceResolvers"); if (this.index == (this.resolvers.size() - 1)) { return null; } - this.index++; return this.resolvers.get(this.index); }