Use "abbreviation" instead of "abbreviatedName" for labels
Change-Id: I22b8c9e4323d73caa02f2768d74ab5f0fa53cbed
This commit is contained in:
@@ -175,8 +175,8 @@ text"`. The `<#>` may be any positive or negative number with an
|
||||
optional leading `+`.
|
||||
|
||||
|
||||
[[label_abbreviatedName]]
|
||||
`label.Label-Name.abbreviatedName`
|
||||
[[label_abbreviation]]
|
||||
`label.Label-Name.abbreviation`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
An abbreviated name for a label shown as a compact column header, for
|
||||
|
||||
@@ -93,7 +93,7 @@ public class LabelType {
|
||||
|
||||
protected String name;
|
||||
|
||||
protected String abbreviatedName;
|
||||
protected String abbreviation;
|
||||
protected String functionName;
|
||||
protected boolean copyMinScore;
|
||||
|
||||
@@ -113,7 +113,7 @@ public class LabelType {
|
||||
canOverride = true;
|
||||
values = sortValues(valueList);
|
||||
|
||||
abbreviatedName = defaultAbbreviation(name);
|
||||
abbreviation = defaultAbbreviation(name);
|
||||
functionName = "MaxWithBlock";
|
||||
|
||||
maxNegative = Short.MIN_VALUE;
|
||||
@@ -136,12 +136,12 @@ public class LabelType {
|
||||
return psa.getLabelId().get().equalsIgnoreCase(name);
|
||||
}
|
||||
|
||||
public String getAbbreviatedName() {
|
||||
return abbreviatedName;
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
}
|
||||
|
||||
public void setAbbreviatedName(String abbreviatedName) {
|
||||
this.abbreviatedName = abbreviatedName;
|
||||
public void setAbbreviation(String abbreviation) {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
public String getFunctionName() {
|
||||
|
||||
@@ -566,7 +566,7 @@ public class ProjectConfig extends VersionedMetaData {
|
||||
}
|
||||
String abbr = rc.getString(LABEL, name, KEY_ABBREVIATION);
|
||||
if (abbr != null) {
|
||||
label.setAbbreviatedName(abbr);
|
||||
label.setAbbreviation(abbr);
|
||||
}
|
||||
|
||||
String functionName = Objects.firstNonNull(
|
||||
@@ -837,9 +837,9 @@ public class ProjectConfig extends VersionedMetaData {
|
||||
rc.setString(LABEL, name, KEY_FUNCTION, label.getFunctionName());
|
||||
|
||||
if (!LabelType.defaultAbbreviation(name)
|
||||
.equals(label.getAbbreviatedName())) {
|
||||
.equals(label.getAbbreviation())) {
|
||||
rc.setString(
|
||||
LABEL, name, KEY_ABBREVIATION, label.getAbbreviatedName());
|
||||
LABEL, name, KEY_ABBREVIATION, label.getAbbreviation());
|
||||
} else {
|
||||
rc.unset(LABEL, name, KEY_ABBREVIATION);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class LabelPredicate extends OperatorPredicate<ChangeData> {
|
||||
}
|
||||
|
||||
for (LabelType lt : types.getLabelTypes()) {
|
||||
if (toFind.equalsIgnoreCase(lt.getAbbreviatedName())) {
|
||||
if (toFind.equalsIgnoreCase(lt.getAbbreviation())) {
|
||||
return lt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public class SchemaCreator {
|
||||
new LabelValue((short) 0, "No score"),
|
||||
new LabelValue((short) -1, "I would prefer that you didn't submit this"),
|
||||
new LabelValue((short) -2, "Do not submit")));
|
||||
type.setAbbreviatedName("CR");
|
||||
type.setAbbreviation("CR");
|
||||
type.setCopyMinScore(true);
|
||||
c.getLabelSections().put(type.getName(), type);
|
||||
return type;
|
||||
|
||||
@@ -229,7 +229,7 @@ public class Schema_77 extends SchemaVersion {
|
||||
LegacyLabelType type =
|
||||
new LegacyLabelType(getLabelName(catRs.getString("name")), values);
|
||||
type.setId(id);
|
||||
type.setAbbreviatedName(catRs.getString("abbreviated_name"));
|
||||
type.setAbbreviation(catRs.getString("abbreviated_name"));
|
||||
type.setFunctionName(catRs.getString("function_name"));
|
||||
type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score")));
|
||||
types.add(type);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class SchemaCreatorTest extends TestCase {
|
||||
LabelType codeReview = getLabelTypes().byLabel("Code-Review");
|
||||
assertNotNull(codeReview);
|
||||
assertEquals("Code-Review", codeReview.getName());
|
||||
assertEquals("CR", codeReview.getAbbreviatedName());
|
||||
assertEquals("CR", codeReview.getAbbreviation());
|
||||
assertEquals("MaxWithBlock", codeReview.getFunctionName());
|
||||
assertTrue(codeReview.isCopyMinScore());
|
||||
assertValueRange(codeReview, 2, 1, 0, -1, -2);
|
||||
|
||||
Reference in New Issue
Block a user