diff --git a/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java b/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java index 677e3768ce0..eb1fdf6db70 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java @@ -52,7 +52,7 @@ import static org.junit.Assert.*; public class AnnotationMetadataTests { @Test - public void standardAnnotationMetadata() throws Exception { + public void standardAnnotationMetadata() { AnnotationMetadata metadata = new StandardAnnotationMetadata(AnnotatedComponent.class, true); doTestAnnotationInfo(metadata); doTestMethodAnnotationInfo(metadata); @@ -68,7 +68,7 @@ public class AnnotationMetadataTests { } @Test - public void standardAnnotationMetadataForSubclass() throws Exception { + public void standardAnnotationMetadataForSubclass() { AnnotationMetadata metadata = new StandardAnnotationMetadata(AnnotatedComponentSubClass.class, true); doTestSubClassAnnotationInfo(metadata); } @@ -104,7 +104,7 @@ public class AnnotationMetadataTests { } @Test - public void standardAnnotationMetadataForInterface() throws Exception { + public void standardAnnotationMetadataForInterface() { AnnotationMetadata metadata = new StandardAnnotationMetadata(AnnotationMetadata.class, true); doTestMetadataForInterfaceClass(metadata); } @@ -132,7 +132,7 @@ public class AnnotationMetadataTests { } @Test - public void standardAnnotationMetadataForAnnotation() throws Exception { + public void standardAnnotationMetadataForAnnotation() { AnnotationMetadata metadata = new StandardAnnotationMetadata(Component.class, true); doTestMetadataForAnnotationClass(metadata); } @@ -172,7 +172,7 @@ public class AnnotationMetadataTests { * 'true' as is done in the main test above. */ @Test - public void standardAnnotationMetadata_nestedAnnotationsAsMap_false() throws Exception { + public void standardAnnotationMetadata_nestedAnnotationsAsMap_false() { AnnotationMetadata metadata = new StandardAnnotationMetadata(AnnotatedComponent.class); AnnotationAttributes specialAttrs = (AnnotationAttributes) metadata.getAnnotationAttributes(SpecialAttr.class.getName()); Annotation[] nestedAnnoArray = (Annotation[]) specialAttrs.get("nestedAnnoArray"); diff --git a/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java b/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java index 1494c133fe8..dcf373e6684 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java +++ b/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -21,7 +21,6 @@ import java.nio.charset.UnsupportedCharsetException; import java.util.LinkedHashMap; import java.util.Map; import java.util.Properties; -import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; @@ -34,7 +33,7 @@ import org.springframework.util.StringUtils; /** * Helper class for URL path matching. Provides support for URL paths in - * RequestDispatcher includes and support for consistent URL decoding. + * {@code RequestDispatcher} includes and support for consistent URL decoding. * *
Used by {@link org.springframework.web.servlet.handler.AbstractUrlHandlerMapping} * and {@link org.springframework.web.servlet.support.RequestContext} for path matching @@ -44,6 +43,8 @@ import org.springframework.util.StringUtils; * @author Rob Harrop * @author Rossen Stoyanchev * @since 14.01.2004 + * @see #getLookupPathForRequest + * @see javax.servlet.RequestDispatcher */ public class UrlPathHelper { @@ -70,8 +71,9 @@ public class UrlPathHelper { /** - * Whether URL lookups should always use the full path within current - * application context, i.e. within {@link ServletContext#getContextPath()}. + * Whether URL lookups should always use the full path within the current + * web application context, i.e. within + * {@link javax.servlet.ServletContext#getContextPath()}. *
If set to {@literal false} the path within the current servlet mapping * is used instead if applicable (i.e. in the case of a prefix based Servlet * mapping such as "/myServlet/*"). @@ -90,7 +92,7 @@ public class UrlPathHelper { *
By default this is set to {@literal true}. *
Note: Be aware the servlet path will not match when * compared to encoded paths. Therefore use of {@code urlDecode=false} is - * not compatible with a prefix-based Servlet mappping and likewise implies + * not compatible with a prefix-based Servlet mapping and likewise implies * also setting {@code alwaysUseFullPath=true}. * @see #getServletPath * @see #getContextPath @@ -157,8 +159,8 @@ public class UrlPathHelper { *
Detects include request URL if called within a RequestDispatcher include. * @param request current HTTP request * @return the lookup path - * @see #getPathWithinApplication * @see #getPathWithinServletMapping + * @see #getPathWithinApplication */ public String getLookupPathForRequest(HttpServletRequest request) { // Always use full path within current servlet context? @@ -187,6 +189,7 @@ public class UrlPathHelper { *
E.g.: servlet mapping = "/*.test"; request URI = "/a.test" -> "". * @param request current HTTP request * @return the path within the servlet mapping, or "" + * @see #getLookupPathForRequest */ public String getPathWithinServletMapping(HttpServletRequest request) { String pathWithinApp = getPathWithinApplication(request); @@ -234,6 +237,7 @@ public class UrlPathHelper { *
Detects include request URL if called within a RequestDispatcher include. * @param request current HTTP request * @return the path within the web application + * @see #getLookupPathForRequest */ public String getPathWithinApplication(HttpServletRequest request) { String contextPath = getContextPath(request); @@ -288,7 +292,7 @@ public class UrlPathHelper { /** * Sanitize the given path. Uses the following rules: *