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
|
@Override
|
||||||
public <K, V> Cache<K, V> build(CacheBinding<K, V> def) {
|
public <K, V> Cache<K, V> build(CacheBinding<K, V> def) {
|
||||||
Preconditions.checkState(!started, "cache must be built before start");
|
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.PatchLineComment;
|
||||||
import com.google.gerrit.reviewdb.client.PatchSetApproval;
|
import com.google.gerrit.reviewdb.client.PatchSetApproval;
|
||||||
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
||||||
import com.google.gerrit.reviewdb.client.Project;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@@ -19,7 +19,6 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
import com.google.inject.TypeLiteral;
|
import com.google.inject.TypeLiteral;
|
||||||
import com.google.inject.internal.UniqueAnnotations;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -27,8 +26,6 @@ import java.util.List;
|
|||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
class DynamicSetProvider<T> implements Provider<DynamicSet<T>> {
|
class DynamicSetProvider<T> implements Provider<DynamicSet<T>> {
|
||||||
private static final Class<?> UNIQUE_ANNOTATION =
|
|
||||||
UniqueAnnotations.create().getClass();
|
|
||||||
private final TypeLiteral<T> type;
|
private final TypeLiteral<T> type;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@@ -18,7 +18,6 @@ import com.google.gerrit.common.data.AccountInfoCache;
|
|||||||
import com.google.gerrit.common.data.SubmitTypeRecord;
|
import com.google.gerrit.common.data.SubmitTypeRecord;
|
||||||
import com.google.gerrit.reviewdb.client.Change;
|
import com.google.gerrit.reviewdb.client.Change;
|
||||||
import com.google.gerrit.reviewdb.client.PatchSetInfo;
|
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.Composite;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
||||||
|
@@ -51,7 +51,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
@@ -89,7 +89,6 @@ public class ChangeMergeQueue implements MergeQueue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@Provides
|
@Provides
|
||||||
public PerThreadRequestScope.Scoper provideScoper(
|
public PerThreadRequestScope.Scoper provideScoper(
|
||||||
final PerThreadRequestScope.Propagator propagator) {
|
final PerThreadRequestScope.Propagator propagator) {
|
||||||
|
@@ -478,28 +478,6 @@ public abstract class QueryRewriter<T> {
|
|||||||
return r;
|
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) {
|
private static <T> boolean isAND(final Predicate<T> p) {
|
||||||
return p instanceof AndPredicate;
|
return p instanceof AndPredicate;
|
||||||
}
|
}
|
||||||
|
@@ -274,7 +274,6 @@ public class QueryProcessor {
|
|||||||
if (includeSubmitRecords) {
|
if (includeSubmitRecords) {
|
||||||
PatchSet.Id psId = d.getChange().currentPatchSetId();
|
PatchSet.Id psId = d.getChange().currentPatchSetId();
|
||||||
PatchSet patchSet = db.get().patchSets().get(psId);
|
PatchSet patchSet = db.get().patchSets().get(psId);
|
||||||
Change.Id changeId = psId.getParentKey();
|
|
||||||
List<SubmitRecord> submitResult = d.changeControl().canSubmit( //
|
List<SubmitRecord> submitResult = d.changeControl().canSubmit( //
|
||||||
db.get(), patchSet, null, false, true);
|
db.get(), patchSet, null, false, true);
|
||||||
eventFactory.addSubmitRecords(c, submitResult);
|
eventFactory.addSubmitRecords(c, submitResult);
|
||||||
|
@@ -62,7 +62,6 @@ public abstract class BaseCommand implements Command {
|
|||||||
static final int STATUS_NOT_FOUND = PRIVATE_STATUS | 2;
|
static final int STATUS_NOT_FOUND = PRIVATE_STATUS | 2;
|
||||||
public static final int STATUS_NOT_ADMIN = PRIVATE_STATUS | 3;
|
public static final int STATUS_NOT_ADMIN = PRIVATE_STATUS | 3;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@Option(name = "--", usage = "end of options", handler = EndOfOptionsHandler.class)
|
@Option(name = "--", usage = "end of options", handler = EndOfOptionsHandler.class)
|
||||||
private boolean endOfOptions;
|
private boolean endOfOptions;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user