Fix variable hiding warnings in Predicate classes
Change Id898e83534 made some member variables protected, which causes warnings about hiding in derived classes which declare variables of the same name. Remove or rename the definitions in the derived classes. Change-Id: I2b0dfaaf3739ea3154d5987637cc55ff162dd374
This commit is contained in:
@@ -16,25 +16,25 @@ package com.google.gerrit.server.query;
|
||||
|
||||
/** Predicate to filter a field by matching integer value. */
|
||||
public abstract class IntPredicate<T> extends OperatorPredicate<T> {
|
||||
private final int value;
|
||||
private final int intValue;
|
||||
|
||||
public IntPredicate(final String name, final String value) {
|
||||
super(name, value);
|
||||
this.value = Integer.parseInt(value);
|
||||
this.intValue = Integer.parseInt(value);
|
||||
}
|
||||
|
||||
public IntPredicate(final String name, final int value) {
|
||||
super(name, String.valueOf(value));
|
||||
this.value = value;
|
||||
public IntPredicate(final String name, final int intValue) {
|
||||
super(name, String.valueOf(intValue));
|
||||
this.intValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return value;
|
||||
return intValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getOperator().hashCode() * 31 + value;
|
||||
return getOperator().hashCode() * 31 + intValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,11 +28,8 @@ public class EqualsFilePredicate extends ChangeIndexPredicate {
|
||||
return Predicate.or(eqPath, new EqualsFilePredicate(value));
|
||||
}
|
||||
|
||||
protected final String value;
|
||||
|
||||
private EqualsFilePredicate(String value) {
|
||||
super(ChangeField.FILE_PART, ChangeQueryBuilder.FIELD_FILE, value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,11 +20,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EqualsPathPredicate extends ChangeIndexPredicate {
|
||||
protected final String value;
|
||||
|
||||
public EqualsPathPredicate(String fieldName, String value) {
|
||||
super(ChangeField.PATH, fieldName, value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user