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
This commit is contained in:
@@ -82,7 +82,7 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MvcUriComponentsBuilder extends UriComponentsBuilder {
|
||||
public class MvcUriComponentsBuilder {
|
||||
|
||||
/**
|
||||
* Well-known name for the {@link CompositeUriComponentsContributor} object in the bean factory.
|
||||
@@ -122,14 +122,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
|
||||
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
|
||||
@@ -457,7 +449,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
|
||||
});
|
||||
}
|
||||
|
||||
protected static CompositeUriComponentsContributor getConfiguredUriComponentsContributor() {
|
||||
private static CompositeUriComponentsContributor getConfiguredUriComponentsContributor() {
|
||||
WebApplicationContext wac = getWebApplicationContext();
|
||||
if (wac == null) {
|
||||
return null;
|
||||
@@ -474,7 +466,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
protected static RequestMappingInfoHandlerMapping getRequestMappingInfoHandlerMapping() {
|
||||
private static RequestMappingInfoHandlerMapping getRequestMappingInfoHandlerMapping() {
|
||||
WebApplicationContext wac = getWebApplicationContext();
|
||||
Assert.notNull(wac, "Cannot lookup handler method mappings without WebApplicationContext");
|
||||
try {
|
||||
@@ -612,11 +604,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
|
||||
return fromMethod(this.baseUrl, method, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return new MvcUriComponentsBuilder(this);
|
||||
}
|
||||
|
||||
|
||||
private static class ControllerMethodInvocationInterceptor
|
||||
implements org.springframework.cglib.proxy.MethodInterceptor, MethodInterceptor {
|
||||
|
||||
Reference in New Issue
Block a user