авторедакция упоминаний старых ключей багов на новые в комментах и описаниях

This commit is contained in:
2025-12-15 22:27:46 +03:00
parent 7bb4531c1b
commit f104335bfe
2 changed files with 21 additions and 3 deletions

View File

@@ -79,6 +79,7 @@ public class BugReportsDatabase extends SQLiteDatabase {
for (BugReport bugReport: sortedBugs){
bugReport.id_ = i;
++i;
//--
Update(bugReport);
}
//--
@@ -111,5 +112,25 @@ public class BugReportsDatabase extends SQLiteDatabase {
}
}
//--
//упоминания других багов.
for (BugReport bugReport: sortedBugs){
//--
Vector<String> mentioned_keys = new Vector<>();
for (String id: bugReports.Data.keySet()){
if ((bugReport.description.contains(id) || bugReport.comment.contains(id)) && !mentioned_keys.contains(id)){
mentioned_keys.add(id);
}
}
//--
for (String id: mentioned_keys){
BugReport owner = bugReports.get(id);
if (owner!=null) {
bugReport.comment = bugReport.comment.replace(id, String.valueOf(owner.id_));
bugReport.description = bugReport.description.replace(id, String.valueOf(owner.id_));
Update(bugReport);
}
}
}
}
}