Browse Source

MvcUriCB no longer extends UriCB

Before 4.2 the MvcUriComponentsBuilder exposed only static factory
methods and therefore there should be no reason for it to extend
UriComponentsBuilder (design oversight). It's also highly unlikely
for application code to treat MvcUriCB as UriCB since there is no
need and no way to obtain an instance (constructor is protected).

This change removes the base class declaration from MvcUriCB.

Issue: SPR-12617
pull/783/merge
Rossen Stoyanchev 11 years ago
parent
commit
0ddcbce90a
  1. 19
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java

19
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java

@ -82,7 +82,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 4.0 * @since 4.0
*/ */
public class MvcUriComponentsBuilder extends UriComponentsBuilder { public class MvcUriComponentsBuilder {
/** /**
* Well-known name for the {@link CompositeUriComponentsContributor} object in the bean factory. * Well-known name for the {@link CompositeUriComponentsContributor} object in the bean factory.
@ -122,14 +122,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
} }
/**
* Create a deep copy of the given MvcUriComponentsBuilder.
* @param other the other builder to copy from
*/
protected MvcUriComponentsBuilder(MvcUriComponentsBuilder other) {
super(other);
this.baseUrl = other.baseUrl;
}
/** /**
* Create an instance of this class with a base URL. After that calls to one * Create an instance of this class with a base URL. After that calls to one
@ -457,7 +449,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
}); });
} }
protected static CompositeUriComponentsContributor getConfiguredUriComponentsContributor() { private static CompositeUriComponentsContributor getConfiguredUriComponentsContributor() {
WebApplicationContext wac = getWebApplicationContext(); WebApplicationContext wac = getWebApplicationContext();
if (wac == null) { if (wac == null) {
return null; return null;
@ -474,7 +466,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
} }
} }
protected static RequestMappingInfoHandlerMapping getRequestMappingInfoHandlerMapping() { private static RequestMappingInfoHandlerMapping getRequestMappingInfoHandlerMapping() {
WebApplicationContext wac = getWebApplicationContext(); WebApplicationContext wac = getWebApplicationContext();
Assert.notNull(wac, "Cannot lookup handler method mappings without WebApplicationContext"); Assert.notNull(wac, "Cannot lookup handler method mappings without WebApplicationContext");
try { try {
@ -612,11 +604,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
return fromMethod(this.baseUrl, method, args); return fromMethod(this.baseUrl, method, args);
} }
@Override
public Object clone() {
return new MvcUriComponentsBuilder(this);
}
private static class ControllerMethodInvocationInterceptor private static class ControllerMethodInvocationInterceptor
implements org.springframework.cglib.proxy.MethodInterceptor, MethodInterceptor { implements org.springframework.cglib.proxy.MethodInterceptor, MethodInterceptor {

Loading…
Cancel
Save