Skip to content

Commit 5a7b24f

Browse files
committed
Address PR comments and linter fixes
1 parent 412337f commit 5a7b24f

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,10 @@ public Integer getDaysSinceCustomTime() {
701701
}
702702

703703
public List<String> getMatchesPrefix() {
704-
return matchesPrefix;
704+
return matchesPrefix;
705705
}
706706

707-
public List<String> getMatchesSuffix() {
707+
public List<String> getMatchesSuffix() {
708708
return matchesSuffix;
709709
}
710710

@@ -820,22 +820,20 @@ public Builder setDaysSinceCustomTime(Integer daysSinceCustomTime) {
820820
}
821821

822822
/**
823-
* Sets the list of prefixes.
824-
* If any prefix matches the beginning of the object’s name,
825-
* this portion of the condition is satisfied for that object.
823+
* Sets the list of prefixes. If any prefix matches the beginning of the object’s name, this
824+
* portion of the condition is satisfied for that object.
826825
*/
827826
public Builder setMatchesPrefix(List<String> matchesPrefix) {
828-
this.matchesPrefix = matchesPrefix;
827+
this.matchesPrefix = matchesPrefix != null ? ImmutableList.copyOf(matchesPrefix) : null;
829828
return this;
830829
}
831830

832831
/**
833-
* Sets the list of suffixes.
834-
* If any suffix matches the end of the object’s name,
835-
* this portion of the condition is satisfied for that object.
832+
* Sets the list of suffixes. If any suffix matches the end of the object’s name, this
833+
* portion of the condition is satisfied for that object.
836834
*/
837835
public Builder setMatchesSuffix(List<String> matchesSuffix) {
838-
this.matchesSuffix = matchesSuffix;
836+
this.matchesSuffix = matchesSuffix != null ? ImmutableList.copyOf(matchesSuffix) : null;
839837
return this;
840838
}
841839

google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public void testLifecycleRules() {
369369
assertEquals(StorageClass.COLDLINE.toString(), lifecycleRule.getAction().getStorageClass());
370370
assertEquals(30, lifecycleRule.getCondition().getDaysSinceCustomTime().intValue());
371371
assertNotNull(lifecycleRule.getCondition().getCustomTimeBefore());
372-
assertEquals("prefix-",lifecycleRule.getCondition().getMatchesPrefix().get(0));
372+
assertEquals("prefix-", lifecycleRule.getCondition().getMatchesPrefix().get(0));
373373
assertEquals("-suffix", lifecycleRule.getCondition().getMatchesSuffix().get(0));
374374

375375
Rule unsupportedRule =

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy