[fixes #825] Rename ReleaseInfo method
This is to avoid ambiguity with other uses of the word 'tag' throughout the code
This commit is contained in:
parent
3285a3265b
commit
a76b7be93f
@ -26,23 +26,23 @@ public class ReleaseInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the release tag from the GitHub release JSON object.
|
* Get the release name from the GitHub release JSON object.
|
||||||
* @return release tag (e.g. "15.0.3")
|
* @return release name (e.g. "15.0.3")
|
||||||
*/
|
*/
|
||||||
public String getReleaseTag() {
|
public String getReleaseName() {
|
||||||
if (this.obj == null) return null;
|
if (this.obj == null) return null;
|
||||||
|
|
||||||
String tag = this.obj.get("tag_name").toString(); // Release label is encapsulated in the 'tag_name'-tag
|
String name = this.obj.get("tag_name").toString(); // Release label is encapsulated in the 'tag_name'-tag
|
||||||
tag = tag.replaceAll("^\"+|\"+$", ""); // Remove double quotations in the beginning and end
|
name = name.replaceAll("^\"+|\"+$", ""); // Remove double quotations in the beginning and end
|
||||||
|
|
||||||
// Remove the 'release-' preamble of the name tag (example name tag: 'release-15.03')
|
// Remove the 'release-' preamble of the name (example name: 'release-15.03')
|
||||||
String preamble = "release-";
|
String preamble = "release-";
|
||||||
if (tag.startsWith(preamble)) {
|
if (name.startsWith(preamble)) {
|
||||||
tag = tag.substring(preamble.length());
|
name = name.substring(preamble.length());
|
||||||
} else {
|
} else {
|
||||||
log.debug("Invalid release tag format for tag: " + tag);
|
log.debug("Invalid release tag format for release: " + name);
|
||||||
}
|
}
|
||||||
return tag;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,7 +82,7 @@ public class ReleaseInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("releaseTag = %s ; releaseNotes = %s ; releaseURL = %s", getReleaseTag(), getReleaseNotes(),
|
return String.format("releaseTag = %s ; releaseNotes = %s ; releaseURL = %s", getReleaseName(), getReleaseNotes(),
|
||||||
getReleaseURL());
|
getReleaseURL());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user