Allow illegal label names from default search predicate
Ancient user watch filters may be configured with strings that are not valid label names, e.g. "plugins/defaultuser". At the time these were created the user was expecting to match a project. Now they blow up the strict checking in LabelType trying to setup an object for EqualsLabelPredicate to fail to match. Be more lenient here to allow the label to fail to match. Change-Id: I52d45456c67924e1981fbbe52a62adfceeebe869
This commit is contained in:
@@ -27,6 +27,10 @@ import java.util.Map;
|
||||
public class LabelType {
|
||||
public static LabelType withDefaultValues(String name) {
|
||||
checkName(name);
|
||||
return withDefaultValuesDoNotCheckName(name);
|
||||
}
|
||||
|
||||
public static LabelType withDefaultValuesDoNotCheckName(String name) {
|
||||
List<LabelValue> values = new ArrayList<>(2);
|
||||
values.add(new LabelValue((short) 0, "Rejected"));
|
||||
values.add(new LabelValue((short) 1, "Approved"));
|
||||
|
@@ -104,7 +104,7 @@ class EqualsLabelPredicate extends IndexPredicate<ChangeData> {
|
||||
}
|
||||
}
|
||||
|
||||
return LabelType.withDefaultValues(toFind);
|
||||
return LabelType.withDefaultValuesDoNotCheckName(toFind);
|
||||
}
|
||||
|
||||
private boolean match(Change change, int value, Account.Id approver,
|
||||
|
Reference in New Issue
Block a user