Hashtags: use Collections.emptySet() instead of ImmutableSet.of()
Change-Id: I33f7a46ef6c0535ebb2ee034ea8dd3e01b347f61
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.google.gerrit.server.change;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.gerrit.extensions.restapi.AuthException;
|
||||
import com.google.gerrit.extensions.restapi.BadRequestException;
|
||||
import com.google.gerrit.extensions.restapi.Response;
|
||||
@@ -25,6 +24,7 @@ import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GetHashtags implements RestReadView<ChangeResource> {
|
||||
ChangeNotes notes = control.getNotes().load();
|
||||
Set<String> hashtags = notes.getHashtags();
|
||||
if (hashtags == null) {
|
||||
hashtags = ImmutableSet.of();
|
||||
hashtags = Collections.emptySet();
|
||||
}
|
||||
return Response.ok(new TreeSet<String>(hashtags));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.google.gerrit.server.change;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.gerrit.common.ChangeHooks;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.gerrit.extensions.restapi.AuthException;
|
||||
@@ -38,6 +37,7 @@ import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
@@ -71,7 +71,7 @@ public class PostHashtags implements RestModifyView<ChangeResource, Input> {
|
||||
private Set<String> extractTags(Set<String> input)
|
||||
throws BadRequestException {
|
||||
if (input == null) {
|
||||
return ImmutableSet.of();
|
||||
return Collections.emptySet();
|
||||
} else {
|
||||
HashSet<String> result = new HashSet<>();
|
||||
for (String hashtag : input) {
|
||||
|
||||
Reference in New Issue
Block a user