Polishing

- primarily automated "clean up" using Eclipse IDE
This commit is contained in:
Sam Brannen 2022-12-09 00:53:54 -05:00
parent 52af5c2b38
commit 69f47e7700
12 changed files with 18 additions and 21 deletions

View File

@ -155,7 +155,7 @@ public final class BeanInstanceSupplier<T> extends AutowiredElementResolver impl
public BeanInstanceSupplier<T> withGenerator( public BeanInstanceSupplier<T> withGenerator(
ThrowingBiFunction<RegisteredBean, AutowiredArguments, T> generator) { ThrowingBiFunction<RegisteredBean, AutowiredArguments, T> generator) {
Assert.notNull(generator, "'generator' must not be null"); Assert.notNull(generator, "'generator' must not be null");
return new BeanInstanceSupplier<T>(this.lookup, generator, this.shortcuts); return new BeanInstanceSupplier<>(this.lookup, generator, this.shortcuts);
} }
/** /**
@ -196,7 +196,7 @@ public final class BeanInstanceSupplier<T> extends AutowiredElementResolver impl
* that uses the shortcuts * that uses the shortcuts
*/ */
public BeanInstanceSupplier<T> withShortcuts(String... beanNames) { public BeanInstanceSupplier<T> withShortcuts(String... beanNames) {
return new BeanInstanceSupplier<T>(this.lookup, this.generator, beanNames); return new BeanInstanceSupplier<>(this.lookup, this.generator, beanNames);
} }
@Override @Override

View File

@ -75,7 +75,7 @@ public interface InstanceSupplier<T> extends ThrowingSupplier<T> {
default <V> InstanceSupplier<V> andThen( default <V> InstanceSupplier<V> andThen(
ThrowingBiFunction<RegisteredBean, ? super T, ? extends V> after) { ThrowingBiFunction<RegisteredBean, ? super T, ? extends V> after) {
Assert.notNull(after, "'after' function must not be null"); Assert.notNull(after, "'after' function must not be null");
return new InstanceSupplier<V>() { return new InstanceSupplier<>() {
@Override @Override
public V get(RegisteredBean registeredBean) throws Exception { public V get(RegisteredBean registeredBean) throws Exception {
@ -119,7 +119,7 @@ public interface InstanceSupplier<T> extends ThrowingSupplier<T> {
&& instanceSupplier.getFactoryMethod() == factoryMethod) { && instanceSupplier.getFactoryMethod() == factoryMethod) {
return instanceSupplier; return instanceSupplier;
} }
return new InstanceSupplier<T>() { return new InstanceSupplier<>() {
@Override @Override
public T get(RegisteredBean registeredBean) throws Exception { public T get(RegisteredBean registeredBean) throws Exception {

View File

@ -380,6 +380,7 @@ class BeanWrapperTests extends AbstractPropertyAccessorTests {
} }
@SuppressWarnings("try")
public static class ActiveResource implements AutoCloseable { public static class ActiveResource implements AutoCloseable {
public ActiveResource getResource() { public ActiveResource getResource() {

View File

@ -56,8 +56,7 @@ public final class CompilerFiles implements UnaryOperator<TestCompiler> {
return testCompiler return testCompiler
.withSources(adapt(Kind.SOURCE, (path, inputStreamSource) -> .withSources(adapt(Kind.SOURCE, (path, inputStreamSource) ->
SourceFile.of(inputStreamSource))) SourceFile.of(inputStreamSource)))
.withResources(adapt(Kind.RESOURCE, (path, inputStreamSource) -> .withResources(adapt(Kind.RESOURCE, ResourceFile::of))
ResourceFile.of(path, inputStreamSource)))
.withClasses(adapt(Kind.CLASS, (path, inputStreamSource) -> .withClasses(adapt(Kind.CLASS, (path, inputStreamSource) ->
ClassFile.of(ClassFile.toClassName(path), inputStreamSource))); ClassFile.of(ClassFile.toClassName(path), inputStreamSource)));
} }

View File

@ -117,8 +117,7 @@ public abstract class AbstractFileResolvingResource extends AbstractResource {
return false; return false;
} }
} }
else if (con instanceof JarURLConnection) { else if (con instanceof JarURLConnection jarCon) {
JarURLConnection jarCon = (JarURLConnection) con;
JarEntry jarEntry = jarCon.getJarEntry(); JarEntry jarEntry = jarCon.getJarEntry();
if (jarEntry == null) { if (jarEntry == null) {
return false; return false;

View File

@ -417,7 +417,7 @@ public interface DataBuffer {
*/ */
default InputStream asInputStream(boolean releaseOnClose) { default InputStream asInputStream(boolean releaseOnClose) {
return new DataBufferInputStream(this, releaseOnClose); return new DataBufferInputStream(this, releaseOnClose);
}; }
/** /**
* Expose this buffer's data as an {@link OutputStream}. Both data and write position are * Expose this buffer's data as an {@link OutputStream}. Both data and write position are

View File

@ -370,8 +370,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable {
} }
private void addRequestParameter(MockHttpServletRequest request, NameValuePair param) { private void addRequestParameter(MockHttpServletRequest request, NameValuePair param) {
if (param instanceof KeyDataPair) { if (param instanceof KeyDataPair pair) {
KeyDataPair pair = (KeyDataPair) param;
File file = pair.getFile(); File file = pair.getFile();
MockPart part; MockPart part;
if (file != null) { if (file != null) {

View File

@ -24,11 +24,10 @@ import io.micrometer.common.KeyValues;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode; import org.springframework.http.HttpStatusCode;
import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames;
import org.springframework.http.client.observation.ClientHttpObservationDocumentation.LowCardinalityKeyNames;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import static org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames;
import static org.springframework.http.client.observation.ClientHttpObservationDocumentation.LowCardinalityKeyNames;
/** /**
* Default implementation for a {@link ClientRequestObservationConvention}, * Default implementation for a {@link ClientRequestObservationConvention},
* extracting information from the {@link ClientRequestObservationContext}. * extracting information from the {@link ClientRequestObservationContext}.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -85,6 +85,7 @@ public class ExtractingResponseErrorHandler extends DefaultResponseErrorHandler
/** /**
* Set the message converters to use by this extractor. * Set the message converters to use by this extractor.
*/ */
@Override
public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) { public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
this.messageConverters = messageConverters; this.messageConverters = messageConverters;
} }

View File

@ -24,9 +24,8 @@ import io.micrometer.common.KeyValues;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode; import org.springframework.http.HttpStatusCode;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.reactive.function.client.ClientHttpObservationDocumentation.HighCardinalityKeyNames;
import static org.springframework.web.reactive.function.client.ClientHttpObservationDocumentation.HighCardinalityKeyNames; import org.springframework.web.reactive.function.client.ClientHttpObservationDocumentation.LowCardinalityKeyNames;
import static org.springframework.web.reactive.function.client.ClientHttpObservationDocumentation.LowCardinalityKeyNames;
/** /**
* Default implementation for a {@link ClientRequestObservationConvention}, * Default implementation for a {@link ClientRequestObservationConvention},

View File

@ -125,7 +125,7 @@ class DefaultWebClient implements WebClient {
handlerMap.entrySet().stream() handlerMap.entrySet().stream()
.map(entry -> new DefaultResponseSpec.StatusHandler(entry.getKey(), entry.getValue())) .map(entry -> new DefaultResponseSpec.StatusHandler(entry.getKey(), entry.getValue()))
.toList()); .toList());
}; }
@Override @Override

View File

@ -232,8 +232,8 @@ public abstract class MvcNamespaceUtils {
} }
/** /**
* Registers an {@link FixedThemeResolver} under a well-known name * Registers an {@link org.springframework.web.servlet.theme.FixedThemeResolver}
* unless already registered. * under a well-known name unless already registered.
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private static void registerThemeResolver(ParserContext context, @Nullable Object source) { private static void registerThemeResolver(ParserContext context, @Nullable Object source) {