Fix various warnings
Remove unused imports, unused fields and variables, unused private methods and unnecessary @SuppressWarnings. Change-Id: Iff3dbd9e2669fcaa7cb42c1accfddfb2ba82b6e0 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -146,7 +146,7 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes", "cast"})
|
||||
@SuppressWarnings({"unchecked", "cast"})
|
||||
@Override
|
||||
public <K, V> Cache<K, V> build(CacheBinding<K, V> def) {
|
||||
Preconditions.checkState(!started, "cache must be built before start");
|
||||
|
@@ -19,7 +19,6 @@ import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.PatchLineComment;
|
||||
import com.google.gerrit.reviewdb.client.PatchSetApproval;
|
||||
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@@ -19,7 +19,6 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.TypeLiteral;
|
||||
import com.google.inject.internal.UniqueAnnotations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -27,8 +26,6 @@ import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
class DynamicSetProvider<T> implements Provider<DynamicSet<T>> {
|
||||
private static final Class<?> UNIQUE_ANNOTATION =
|
||||
UniqueAnnotations.create().getClass();
|
||||
private final TypeLiteral<T> type;
|
||||
|
||||
@Inject
|
||||
|
@@ -18,7 +18,6 @@ import com.google.gerrit.common.data.AccountInfoCache;
|
||||
import com.google.gerrit.common.data.SubmitTypeRecord;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
||||
|
@@ -51,7 +51,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@@ -89,7 +89,6 @@ public class ChangeMergeQueue implements MergeQueue {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Provides
|
||||
public PerThreadRequestScope.Scoper provideScoper(
|
||||
final PerThreadRequestScope.Propagator propagator) {
|
||||
|
@@ -478,28 +478,6 @@ public abstract class QueryRewriter<T> {
|
||||
return r;
|
||||
}
|
||||
|
||||
private static <T> void expand(final List<Predicate<T>> out,
|
||||
final List<Predicate<T>> allOR, final List<Predicate<T>> tmp,
|
||||
final List<Predicate<T>> nonOR) {
|
||||
if (tmp.size() == allOR.size()) {
|
||||
final int sz = nonOR.size() + tmp.size();
|
||||
final List<Predicate<T>> newList = new ArrayList<Predicate<T>>(sz);
|
||||
newList.addAll(nonOR);
|
||||
newList.addAll(tmp);
|
||||
out.add(Predicate.and(newList));
|
||||
|
||||
} else {
|
||||
for (final Predicate<T> c : allOR.get(tmp.size()).getChildren()) {
|
||||
try {
|
||||
tmp.add(c);
|
||||
expand(out, allOR, tmp, nonOR);
|
||||
} finally {
|
||||
tmp.remove(tmp.size() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> boolean isAND(final Predicate<T> p) {
|
||||
return p instanceof AndPredicate;
|
||||
}
|
||||
|
@@ -274,7 +274,6 @@ public class QueryProcessor {
|
||||
if (includeSubmitRecords) {
|
||||
PatchSet.Id psId = d.getChange().currentPatchSetId();
|
||||
PatchSet patchSet = db.get().patchSets().get(psId);
|
||||
Change.Id changeId = psId.getParentKey();
|
||||
List<SubmitRecord> submitResult = d.changeControl().canSubmit( //
|
||||
db.get(), patchSet, null, false, true);
|
||||
eventFactory.addSubmitRecords(c, submitResult);
|
||||
|
@@ -62,7 +62,6 @@ public abstract class BaseCommand implements Command {
|
||||
static final int STATUS_NOT_FOUND = PRIVATE_STATUS | 2;
|
||||
public static final int STATUS_NOT_ADMIN = PRIVATE_STATUS | 3;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Option(name = "--", usage = "end of options", handler = EndOfOptionsHandler.class)
|
||||
private boolean endOfOptions;
|
||||
|
||||
|
Reference in New Issue
Block a user