авторедакция упоминаний старых ключей багов на новые в комментах и описаниях
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user