From a39276addcbbc38d1f1f5fb76366fa1ff068f33c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 20 Jul 2016 23:22:06 +0200 Subject: [PATCH] Polishing --- .../springframework/core/io/FileSystemResource.java | 5 ++--- .../java/org/springframework/core/io/UrlResource.java | 4 ++-- .../main/java/org/springframework/util/ClassUtils.java | 10 +++++----- .../web/servlet/mvc/ServletWrappingController.java | 6 +----- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/FileSystemResource.java b/spring-core/src/main/java/org/springframework/core/io/FileSystemResource.java index 294a3e3726..9179d92110 100644 --- a/spring-core/src/main/java/org/springframework/core/io/FileSystemResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/FileSystemResource.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. @@ -30,7 +30,7 @@ import org.springframework.util.StringUtils; /** * {@link Resource} implementation for {@code java.io.File} handles. - * Obviously supports resolution as File, and also as URL. + * Supports resolution as a {@code File} and also as a {@code URL}. * Implements the extended {@link WritableResource} interface. * * @author Juergen Hoeller @@ -85,7 +85,6 @@ public class FileSystemResource extends AbstractResource implements WritableReso return this.path; } - /** * This implementation returns whether the underlying file exists. * @see java.io.File#exists() diff --git a/spring-core/src/main/java/org/springframework/core/io/UrlResource.java b/spring-core/src/main/java/org/springframework/core/io/UrlResource.java index 44e6516ed8..584b67f6d8 100644 --- a/spring-core/src/main/java/org/springframework/core/io/UrlResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/UrlResource.java @@ -32,7 +32,7 @@ import org.springframework.util.StringUtils; /** * {@link Resource} implementation for {@code java.net.URL} locators. - *

Supports resolution as a {@code URL} and also as a {@code File} in + * Supports resolution as a {@code URL} and also as a {@code File} in * case of the {@code "file:"} protocol. * * @author Juergen Hoeller @@ -134,6 +134,7 @@ public class UrlResource extends AbstractFileResolvingResource { } } + /** * Determine a cleaned URL for the given original URL. * @param originalUrl the original URL @@ -152,7 +153,6 @@ public class UrlResource extends AbstractFileResolvingResource { } } - /** * This implementation opens an InputStream for the given URL. *

It sets the {@code useCaches} flag to {@code false}, diff --git a/spring-core/src/main/java/org/springframework/util/ClassUtils.java b/spring-core/src/main/java/org/springframework/util/ClassUtils.java index ce09285746..6d152017ea 100644 --- a/spring-core/src/main/java/org/springframework/util/ClassUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ClassUtils.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. @@ -56,16 +56,16 @@ public abstract class ClassUtils { /** Prefix for internal non-primitive array class names: "[L" */ private static final String NON_PRIMITIVE_ARRAY_PREFIX = "[L"; - /** The package separator character '.' */ + /** The package separator character: '.' */ private static final char PACKAGE_SEPARATOR = '.'; - /** The path separator character '/' */ + /** The path separator character: '/' */ private static final char PATH_SEPARATOR = '/'; - /** The inner class separator character '$' */ + /** The inner class separator character: '$' */ private static final char INNER_CLASS_SEPARATOR = '$'; - /** The CGLIB class separator character "$$" */ + /** The CGLIB class separator: "$$" */ public static final String CGLIB_CLASS_SEPARATOR = "$$"; /** The ".class" file suffix */ diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java index 1b63444b9d..bda15e5fd5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/ServletWrappingController.java @@ -131,11 +131,7 @@ public class ServletWrappingController extends AbstractController @Override public void afterPropertiesSet() throws Exception { if (this.servletClass == null) { - throw new IllegalArgumentException("servletClass is required"); - } - if (!Servlet.class.isAssignableFrom(this.servletClass)) { - throw new IllegalArgumentException("servletClass [" + this.servletClass.getName() + - "] needs to implement interface [javax.servlet.Servlet]"); + throw new IllegalArgumentException("'servletClass' is required"); } if (this.servletName == null) { this.servletName = this.beanName;