10000 Replace constants (static final CONSTANT_CASE) declaration type which… · keepfit/google-http-java-client@98e6d48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 98e6d48

Browse files
dorireuvgarrettjonesgoogle
authored andcommitted
Replace constants (static final CONSTANT_CASE) declaration type which use the general collection interface (e.g. List) with an immutable type (e.g. ImmutableList).
For constant field declarations, you should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List). This communicates to your callers important semantic guarantees (https://cantata.corp.google.com/?ticket=java:com.google.common.collect.ImmutableCollection). For more info, see: go/lsc-immutable-constants Cleanup change automatically generated by javacflume/refactory Refactoring: //third_party/java_src/error_prone/project/core/src/main/java/ 10000 com/google/errorprone/bugpatterns:MutableConstantField_refactoring Tested: TAP train for global presubmit queue http://test/OCL:149234672:BASE:149234770:1488739899777:b922b37f All failing tests were failing before this change ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150033774
1 parent 3e6c794 commit 98e6d48

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

google-http-client/src/test/java/com/google/api/client/http/HttpRequestTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.io.IOException;
3636
import java.util.Arrays;
3737
import java.util.List;
38-
import java.util.Set;
3938
import java.util.concurrent.ExecutionException;
4039
import java.util.concurrent.Executor;
4140
import java.util.concurrent.Future;
@@ -52,9 +51,9 @@
5251
*/
5352
public class HttpRequestTest extends TestCase {
5453

55-
private static final Set<String> BASIC_METHODS =
54+
private static final ImmutableSet<String> BASIC_METHODS =
5655
ImmutableSet.of(HttpMethods.GET, HttpMethods.PUT, HttpMethods.POST, HttpMethods.DELETE);
57-
private static final Set<String> OTHER_METHODS =
56+
private static final ImmutableSet<String> OTHER_METHODS =
5857
ImmutableSet.of(HttpMethods.HEAD, HttpMethods.PATCH);
5958

6059
public HttpRequestTest(String name) {

0 commit comments

Comments
 (0)
0