mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Fix handling of potential ugrade issues with no space in title
This commit is contained in:
parent
28b3054a9e
commit
00e46192e4
@ -189,9 +189,12 @@ public abstract class UpgradeDependencies extends DefaultTask {
|
|||||||
private Issue findExistingUpgradeIssue(List<Issue> existingUpgradeIssues, Upgrade upgrade) {
|
private Issue findExistingUpgradeIssue(List<Issue> existingUpgradeIssues, Upgrade upgrade) {
|
||||||
String toMatch = "Upgrade to " + upgrade.getLibrary().getName();
|
String toMatch = "Upgrade to " + upgrade.getLibrary().getName();
|
||||||
for (Issue existingUpgradeIssue : existingUpgradeIssues) {
|
for (Issue existingUpgradeIssue : existingUpgradeIssues) {
|
||||||
if (existingUpgradeIssue.getTitle()
|
String title = existingUpgradeIssue.getTitle();
|
||||||
.substring(0, existingUpgradeIssue.getTitle().lastIndexOf(' '))
|
int lastSpaceIndex = title.lastIndexOf(' ');
|
||||||
.equals(toMatch)) {
|
if (lastSpaceIndex > -1) {
|
||||||
|
title = title.substring(0, lastSpaceIndex);
|
||||||
|
}
|
||||||
|
if (title.equals(toMatch)) {
|
||||||
return existingUpgradeIssue;
|
return existingUpgradeIssue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user