diff options
author | Andrew Niefer | 2010-04-09 20:15:37 +0000 |
---|---|---|
committer | Andrew Niefer | 2010-04-09 20:15:37 +0000 |
commit | 81c91decc0ede98ffa35ea1d9ca6e407fc0d4e50 (patch) | |
tree | 0ab335ee362d5f00a97e84fbc08e7844020e1286 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse | |
parent | a12c470e322b7d2c76bb3d679e37b244b66427e8 (diff) | |
download | rt.equinox.p2-81c91decc0ede98ffa35ea1d9ca6e407fc0d4e50.tar.gz rt.equinox.p2-81c91decc0ede98ffa35ea1d9ca6e407fc0d4e50.tar.xz rt.equinox.p2-81c91decc0ede98ffa35ea1d9ca6e407fc0d4e50.zip |
bug 280147 - fix messages - OOM during mirror
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
3 files changed, 12 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java index 4560fe96f..023ce05ca 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java @@ -34,7 +34,7 @@ public class CompositeRepositoryTask extends AbstractRepositoryTask { try { IStatus result = application.run(null); if (result.matches(IStatus.ERROR)) { - throw new BuildException(TaskHelper.statusToString(result, null).toString()); + throw new BuildException(TaskHelper.statusToString(result, IStatus.ERROR, null).toString()); } } catch (ProvisionException e) { throw new BuildException(e); diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java index c7933c227..b4cd7fe6a 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java @@ -60,7 +60,7 @@ public class MirrorTask extends AbstractRepositoryTask { application.setSourceIUs(ius); IStatus result = application.run(null); if (result.matches(IStatus.ERROR)) - throw new BuildException(TaskHelper.statusToString(result, null).toString()); + throw new BuildException(TaskHelper.statusToString(result, IStatus.ERROR, null).toString()); } catch (ProvisionException e) { throw new BuildException(e); } catch (NoSuchMethodException e) { diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java index 8eeab462e..72d051e35 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/TaskHelper.java @@ -14,13 +14,20 @@ import org.eclipse.core.runtime.IStatus; public class TaskHelper { public static StringBuffer statusToString(IStatus status, StringBuffer b) { + return statusToString(status, -1, b); + } + + public static StringBuffer statusToString(IStatus status, int severities, StringBuffer b) { IStatus[] nestedStatus = status.getChildren(); if (b == null) b = new StringBuffer(); - b.append(status.getMessage()); + if (severities == -1 || (status.getSeverity() & severities) != 0) { + if (b.length() > 0) + b.append('\n'); + b.append(status.getMessage()); + } for (int i = 0; i < nestedStatus.length; i++) { - b.append('\n'); - b.append(statusToString(nestedStatus[i], b)); + statusToString(nestedStatus[i], severities, b); } return b; } |