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