error-prone 2.3.2 fixes

pull/272/head
Andrew Gaul 2018-10-14 23:02:11 -07:00
rodzic 0354927082
commit 92db458cf2
5 zmienionych plików z 19 dodań i 19 usunięć

Wyświetl plik

@ -18,6 +18,8 @@ package org.gaul.s3proxy;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableMap;
@ -34,11 +36,11 @@ final class S3AuthorizationHeader {
// TODO: these fields should have accessors
// CHECKSTYLE:OFF
final AuthenticationType authenticationType;
final String hmacAlgorithm;
final String hashAlgorithm;
final String region;
final String date;
final String service;
@Nullable final String hmacAlgorithm;
@Nullable final String hashAlgorithm;
@Nullable final String region;
@Nullable final String date;
@Nullable final String service;
final String identity;
final String signature;
// CHECKSTYLE:ON

Wyświetl plik

@ -619,7 +619,7 @@ public class S3ProxyHandler {
if (!uri.equals("/") && !isValidContainer(path[1])) {
if (method.equals("PUT") &&
(path.length <= 2 || path[2].isEmpty()) &&
!("".equals(request.getParameter("acl")))) {
!"".equals(request.getParameter("acl"))) {
throw new S3Exception(S3ErrorCode.INVALID_BUCKET_NAME);
} else {
throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET);
@ -649,7 +649,7 @@ public class S3ProxyHandler {
handleGetContainerAcl(response, blobStore, path[1]);
return;
} else if ("".equals(request.getParameter("location"))) {
handleContainerLocation(response, blobStore, path[1]);
handleContainerLocation(response);
return;
} else if ("".equals(request.getParameter("uploads"))) {
handleListMultipartUploads(request, response, blobStore,
@ -1091,8 +1091,8 @@ public class S3ProxyHandler {
}
}
private void handleContainerLocation(HttpServletResponse response,
BlobStore blobStore, String containerName) throws IOException {
private void handleContainerLocation(HttpServletResponse response)
throws IOException {
response.setCharacterEncoding(UTF_8);
try (Writer writer = response.getWriter()) {
response.setContentType(XML_CONTENT_TYPE);

Wyświetl plik

@ -57,7 +57,6 @@ import com.amazonaws.services.s3.model.Bucket;
import com.amazonaws.services.s3.model.BucketLoggingConfiguration;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
import com.amazonaws.services.s3.model.CompleteMultipartUploadResult;
import com.amazonaws.services.s3.model.CopyObjectRequest;
import com.amazonaws.services.s3.model.CopyPartRequest;
import com.amazonaws.services.s3.model.CopyPartResult;
@ -456,8 +455,7 @@ public final class AwsSdkTest {
new CompleteMultipartUploadRequest(
containerName, targetBlobName, uploadId,
ImmutableList.of(copyPartResult.getPartETag()));
CompleteMultipartUploadResult completeUploadResponse =
client.completeMultipartUpload(completeRequest);
client.completeMultipartUpload(completeRequest);
S3Object object = client.getObject(containerName, targetBlobName);
assertThat(object.getObjectMetadata().getContentLength()).isEqualTo(

Wyświetl plik

@ -86,7 +86,7 @@ public final class NullBlobStoreTest {
nullBlobStore.putBlob(containerName, blob);
blob = nullBlobStore.getBlob(containerName, blobName);
validateBlobMetadata(blob.getMetadata(), BYTE_SOURCE);
validateBlobMetadata(blob.getMetadata());
// content differs, only compare length
try (InputStream actual = blob.getPayload().openStream();
@ -113,7 +113,7 @@ public final class NullBlobStoreTest {
nullBlobStore.putBlob(containerName, blob);
BlobMetadata metadata = nullBlobStore.blobMetadata(containerName,
blobName);
validateBlobMetadata(metadata, BYTE_SOURCE);
validateBlobMetadata(metadata);
}
@Test
@ -151,7 +151,7 @@ public final class NullBlobStoreTest {
part2));
Blob newBlob = nullBlobStore.getBlob(containerName, blobName);
validateBlobMetadata(newBlob.getMetadata(), byteSource);
validateBlobMetadata(newBlob.getMetadata());
// content differs, only compare length
try (InputStream actual = newBlob.getPayload().openStream();
@ -185,8 +185,8 @@ public final class NullBlobStoreTest {
.build();
}
private static void validateBlobMetadata(BlobMetadata metadata,
ByteSource byteSource) throws IOException {
private static void validateBlobMetadata(BlobMetadata metadata)
throws IOException {
assertThat(metadata).isNotNull();
ContentMetadata contentMetadata = metadata.getContentMetadata();

Wyświetl plik

@ -42,8 +42,8 @@ public class S3ProxyRuleTest {
private static final String MY_TEST_BUCKET = "my-test-bucket";
public @Rule TemporaryFolder temporaryFolder = new TemporaryFolder();
public @Rule S3ProxyRule s3Proxy = S3ProxyRule
@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
@Rule public S3ProxyRule s3Proxy = S3ProxyRule
.builder()
.withCredentials("access", "secret")
.build();