mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid calling HTTP in EDT
This commit is contained in:
@@ -340,7 +340,7 @@ public class TaskManagerImpl extends TaskManager implements ProjectComponent, Pe
|
||||
if (createChangelist) {
|
||||
if (changeLists.isEmpty()) {
|
||||
String name = getChangelistName(origin);
|
||||
String comment = TaskUtil.getChangeListComment(this, origin);
|
||||
String comment = TaskUtil.getChangeListComment(origin);
|
||||
createChangeList(task, name, comment);
|
||||
} else {
|
||||
String id = changeLists.get(0).id;
|
||||
@@ -368,7 +368,7 @@ public class TaskManagerImpl extends TaskManager implements ProjectComponent, Pe
|
||||
}
|
||||
|
||||
public void createChangeList(LocalTask task, String name) {
|
||||
String comment = TaskUtil.getChangeListComment(this, task);
|
||||
String comment = TaskUtil.getChangeListComment(task);
|
||||
createChangeList(task, name, comment);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,23 +33,12 @@ public class TaskUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getChangeListComment(TaskManagerImpl manager, Task task) {
|
||||
public static String getChangeListComment(Task task) {
|
||||
final TaskRepository repository = task.getRepository();
|
||||
if (repository != null) {
|
||||
return getChangeListComment(task, repository);
|
||||
if (repository == null || !repository.isShouldFormatCommitMessage()) {
|
||||
return null;
|
||||
}
|
||||
for (TaskRepository repo : manager.getAllRepositories()) {
|
||||
try {
|
||||
final Task origin = repo.findTask(task.getId());
|
||||
if (origin != null) return getChangeListComment(task, repo);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String getChangeListComment(Task task, TaskRepository repository) {
|
||||
return repository.isShouldFormatCommitMessage() ? formatTask(task, repository.getCommitMessageFormat()) : null;
|
||||
return formatTask(task, repository.getCommitMessageFormat());
|
||||
}
|
||||
|
||||
public static String getTrimmedSummary(LocalTask task) {
|
||||
|
||||
Reference in New Issue
Block a user