Remove deprecated methods

Closes gh-33123
This commit is contained in:
rstoyanchev
2024-07-18 10:42:45 +01:00
parent 9409543dac
commit ade8128060
8 changed files with 10 additions and 290 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@@ -155,16 +155,4 @@ public final class WebClientAdapter extends AbstractReactorHttpExchangeAdapter {
return new WebClientAdapter(webClient);
}
/**
* Create a {@link WebClientAdapter} for the given {@code WebClient} instance.
* @param webClient the client to use
* @return the created adapter instance
* @deprecated in favor of {@link #create(WebClient)} aligning with other adapter
* implementations; to be removed in 6.2.
*/
@Deprecated(since = "6.1", forRemoval = true)
public static WebClientAdapter forClient(WebClient webClient) {
return new WebClientAdapter(webClient);
}
}

View File

@@ -248,24 +248,9 @@ public class FreeMarkerView extends AbstractUrlBasedView {
* multiple templates to be rendered into a single view.
*/
@Override
public boolean checkResourceExists(Locale locale) throws Exception {
try {
// Check that we can get the template, even if we might subsequently get it again.
getTemplate(locale);
return true;
}
catch (FileNotFoundException ex) {
// Allow for ViewResolver chaining...
return false;
}
catch (ParseException ex) {
throw new ApplicationContextException(
"Failed to parse FreeMarker template for URL [" + getUrl() + "]", ex);
}
catch (IOException ex) {
throw new ApplicationContextException(
"Could not load FreeMarker template for URL [" + getUrl() + "]", ex);
}
public boolean checkResourceExists(Locale locale) {
throw new UnsupportedOperationException(
"This should never be called as we override resourceExists returning Mono<Boolean>");
}
/**
@@ -378,23 +363,6 @@ public class FreeMarkerView extends AbstractUrlBasedView {
return (ow != null ? ow : new DefaultObjectWrapperBuilder(version).build());
}
/**
* Retrieve the FreeMarker {@link Template} to be rendered by this view, for
* the specified locale and using the {@linkplain #setEncoding(String) configured
* encoding} if set.
* <p>By default, the template specified by the "url" bean property will be retrieved.
* @param locale the current locale
* @return the FreeMarker template to render
* @deprecated since 6.1, in favor of {@link #lookupTemplate(Locale)}, to be
* removed in 6.2
*/
@Deprecated(since = "6.1", forRemoval = true)
protected Template getTemplate(Locale locale) throws IOException {
return (getEncoding() != null ?
obtainConfiguration().getTemplate(getUrl(), locale, getEncoding()) :
obtainConfiguration().getTemplate(getUrl(), locale));
}
/**
* Retrieve the FreeMarker {@link Template} to be rendered by this view, for
* the specified locale and using the {@linkplain #setEncoding(String) configured

View File

@@ -91,11 +91,11 @@ class FreeMarkerViewTests {
}
@Test
void checkResourceExists() throws Exception {
void checkResourceExists() {
freeMarkerView.setConfiguration(this.freeMarkerConfig);
freeMarkerView.setUrl("test.ftl");
assertThat(freeMarkerView.checkResourceExists(Locale.US)).isTrue();
assertThat(freeMarkerView.resourceExists(Locale.US).block(Duration.ofSeconds(1))).isTrue();
}
@Test