Skip to content

Commit f2c455f

Browse files
committed
Minor checkstyle and codacy fixes to gcloud-java-nio
1 parent 35e6dde commit f2c455f

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
@AutoValue
2929
public abstract class CloudStorageConfiguration {
3030

31+
public static final CloudStorageConfiguration DEFAULT = builder().build();
32+
3133
/**
3234
* Returns path of current working directory. This defaults to the root directory.
3335
*/
@@ -147,8 +149,6 @@ public CloudStorageConfiguration build() {
147149
Builder() {}
148150
}
149151

150-
public static final CloudStorageConfiguration DEFAULT = builder().build();
151-
152152
static CloudStorageConfiguration fromMap(Map<String, ?> env) {
153153
Builder builder = builder();
154154
for (Map.Entry<String, ?> entry : env.entrySet()) {

gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystem.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

3838
import javax.annotation.CheckReturnValue;
3939
import javax.annotation.Nullable;
40-
import javax.annotation.concurrent.Immutable;
41-
import javax.annotation.CheckReturnValue;
4240
import javax.annotation.concurrent.ThreadSafe;
4341

4442
/**

gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ private SeekableByteChannel newWriteChannel(Path path, Set<? extends OpenOption>
308308

309309
try {
310310
return new CloudStorageWriteChannel(
311-
storage.writer(
312-
infoBuilder.build(), writeOptions.toArray(new Storage.BlobWriteOption[0])));
311+
storage.writer(infoBuilder.build(),
312+
writeOptions.toArray(new Storage.BlobWriteOption[writeOptions.size()])));
313313
} catch (StorageException oops) {
314-
throw asIOException(oops);
314+
throw asIoException(oops);
315315
}
316316
}
317317

@@ -471,7 +471,7 @@ public void copy(Path source, Path target, CopyOption... options) throws IOExcep
471471
CopyWriter copyWriter = storage.copy(copyReqBuilder.build());
472472
copyWriter.result();
473473
} catch (StorageException oops) {
474-
throw asIOException(oops);
474+
throw asIoException(oops);
475475
}
476476
}
477477

@@ -623,7 +623,7 @@ public String toString() {
623623
return MoreObjects.toStringHelper(this).add("storage", storage).toString();
624624
}
625625

626-
private IOException asIOException(StorageException oops) {
626+
private IOException asIoException(StorageException oops) {
627627
// RPC API can only throw StorageException, but CloudStorageFileSystemProvider
628628
// can only throw IOException. Square peg, round hole.
629629
// TODO(#810): Research if other codes should be translated similarly.

gcloud-java-contrib/gcloud-java-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageWriteChannelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class CloudStorageWriteChannelTest {
4949
@Rule public final ExpectedException thrown = ExpectedException.none();
5050

5151
private final WriteChannel gcsChannel = mock(WriteChannel.class);
52-
private CloudStorageWriteChannel chan = new CloudStorageWriteChannel(gcsChannel);
52+
private final CloudStorageWriteChannel chan = new CloudStorageWriteChannel(gcsChannel);
5353

5454
@Before
5555
public void before() {

0 commit comments

Comments
 (0)