Polishing

This commit is contained in:
Juergen Hoeller 2022-05-10 13:07:00 +02:00
parent de6180b093
commit c81e11d537
2 changed files with 6 additions and 16 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 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.
@ -53,7 +53,7 @@ import org.springframework.lang.Nullable;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.5 * @since 2.5
* @see java.sql.SQLTransientException * @see java.sql.SQLTransientException
* @see java.sql.SQLTransientException * @see java.sql.SQLNonTransientException
* @see java.sql.SQLRecoverableException * @see java.sql.SQLRecoverableException
*/ */
public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLExceptionTranslator { public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLExceptionTranslator {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 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.
@ -100,13 +100,12 @@ abstract class DefaultParts {
/** /**
* Abstract base class. * Abstract base class for {@link Part} implementations.
*/ */
private static abstract class AbstractPart implements Part { private static abstract class AbstractPart implements Part {
private final HttpHeaders headers; private final HttpHeaders headers;
protected AbstractPart(HttpHeaders headers) { protected AbstractPart(HttpHeaders headers) {
Assert.notNull(headers, "HttpHeaders is required"); Assert.notNull(headers, "HttpHeaders is required");
this.headers = headers; this.headers = headers;
@ -119,7 +118,6 @@ abstract class DefaultParts {
return name; return name;
} }
@Override @Override
public HttpHeaders headers() { public HttpHeaders headers() {
return this.headers; return this.headers;
@ -172,7 +170,6 @@ abstract class DefaultParts {
protected final Content content; protected final Content content;
public DefaultPart(HttpHeaders headers, Content content) { public DefaultPart(HttpHeaders headers, Content content) {
super(headers); super(headers);
this.content = content; this.content = content;
@ -198,7 +195,6 @@ abstract class DefaultParts {
return "DefaultPart"; return "DefaultPart";
} }
} }
} }
@ -213,7 +209,7 @@ abstract class DefaultParts {
@Override @Override
public String filename() { public String filename() {
String filename = this.headers().getContentDisposition().getFilename(); String filename = headers().getContentDisposition().getFilename();
Assert.state(filename != null, "No filename found"); Assert.state(filename != null, "No filename found");
return filename; return filename;
} }
@ -235,7 +231,6 @@ abstract class DefaultParts {
return "DefaultFilePart{(" + filename + ")}"; return "DefaultFilePart{(" + filename + ")}";
} }
} }
} }
@ -249,9 +244,9 @@ abstract class DefaultParts {
Mono<Void> transferTo(Path dest); Mono<Void> transferTo(Path dest);
Mono<Void> delete(); Mono<Void> delete();
} }
/** /**
* {@code Content} implementation based on a flux of data buffers. * {@code Content} implementation based on a flux of data buffers.
*/ */
@ -259,12 +254,10 @@ abstract class DefaultParts {
private final Flux<DataBuffer> content; private final Flux<DataBuffer> content;
public FluxContent(Flux<DataBuffer> content) { public FluxContent(Flux<DataBuffer> content) {
this.content = content; this.content = content;
} }
@Override @Override
public Flux<DataBuffer> content() { public Flux<DataBuffer> content() {
return this.content; return this.content;
@ -279,7 +272,6 @@ abstract class DefaultParts {
public Mono<Void> delete() { public Mono<Void> delete() {
return Mono.empty(); return Mono.empty();
} }
} }
@ -292,13 +284,11 @@ abstract class DefaultParts {
private final Scheduler scheduler; private final Scheduler scheduler;
public FileContent(Path file, Scheduler scheduler) { public FileContent(Path file, Scheduler scheduler) {
this.file = file; this.file = file;
this.scheduler = scheduler; this.scheduler = scheduler;
} }
@Override @Override
public Flux<DataBuffer> content() { public Flux<DataBuffer> content() {
return DataBufferUtils.readByteChannel( return DataBufferUtils.readByteChannel(