private String flattenStatus(IStatus[] childs, String indent) { StringBuffer sb = new StringBuffer(); for (int i = 0; (childs != null) && (i < childs.length); i++) { sb.append(indent).append(childs[i].getMessage()).append(NEW_LINE); sb.append(flattenStatus(childs[i].getChildren(), indent + " ")); } return sb.toString(); }
private void populateText(StringBuffer sb, IStatus status, int nesting) { for (int i = 0; i < nesting; i++) { sb.append(" "); //$NON-NLS-1$ } sb.append(getMessageForDisplay(status)); sb.append('\n'); IStatus[] children = status.getChildren(); for (int i = 0; i < children.length; i++) { populateText(sb, children[i], nesting + 1); } }
private void extractExpectedMD5(IStatus status, Set<String> expected) { if (status.getCode() == ProvisionException.ARTIFACT_MD5_NOT_MATCH) { Pattern p = Pattern.compile(Messages.Error_unexpected_hash.replaceAll("[{][01][}]", "(.*)")); Matcher m = p.matcher(status.getMessage()); if (!m.matches()) throw new Error("Failed to parse message about unexpected hash."); expected.add(m.group(2)); } for (IStatus c : status.getChildren()) { extractExpectedMD5(c, expected); } }
public void printStatus(String prefix, IStatus status) { System.err.print(prefix); System.err.println(status.getMessage()); IStatus [] children = status.getChildren(); String childPrefix = " " + prefix; for (int i = 0; i < children.length; ++i) { printStatus(childPrefix, children[i]); } }
public void printStatus(String prefix, IStatus status) { System.err.print(prefix); System.err.println(status.getMessage()); IStatus [] children = status.getChildren(); String childPrefix = " " + prefix; for (int i = 0; i < children.length; ++i) { printStatus(childPrefix, children[i]); } }
private IStatus getHighestSeverityStatusImpl(IStatus status, IStatus highestSeverity) { if (status.isMultiStatus()) { for (IStatus child : status.getChildren()) { highestSeverity = getHighestSeverityStatusImpl(child, highestSeverity); } return highestSeverity; } if (highestSeverity.getSeverity() < status.getSeverity()) { highestSeverity = status; } return highestSeverity; }
static public void printChildren(IStatus status, PrintStream output) { IStatus[] children = status.getChildren(); if (children == null || children.length == 0) return; for (int i = 0; i < children.length; i++) { output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$ Throwable exception = children[i].getException(); if (exception != null) exception.printStackTrace(output); printChildren(children[i], output); } }
static public void printChildren(IStatus status, PrintStream output) { IStatus[] children = status.getChildren(); if (children == null || children.length == 0) return; for (int i = 0; i < children.length; i++) { output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$ Throwable exception = children[i].getException(); if (exception != null) exception.printStackTrace(output); printChildren(children[i], output); } }
static public void printChildren(IStatus status, PrintStream output) { IStatus[] children = status.getChildren(); if (children == null || children.length == 0) return; for (int i = 0; i < children.length; i++) { output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$ Throwable exception = children[i].getException(); if (exception != null) exception.printStackTrace(output); printChildren(children[i], output); } }
protected void appendLeafs(IStatus status, StringBuilder result) { if (status.isOK()) { return; } result.append(status.getMessage()).append('\n'); IStatus[] children = status.getChildren(); for(IStatus child: children) { appendLeafs(child, result); } }
static public void printChildren(IStatus status, PrintStream output) { IStatus[] children = status.getChildren(); if (children == null || children.length == 0) return; for (int i = 0; i < children.length; i++) { output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$ Throwable exception = children[i].getException(); if (exception != null) exception.printStackTrace(output); printChildren(children[i], output); } }
private void computeSeverity(IStatus status) { IStatus[] children = status.getChildren(); for (int i = 0; i < children.length; i++) { computeSeverity(children[i]); if (getSeverity() == IStatus.ERROR) return; } }
/** * Adds all of the children of the given status to this multi-status. * Does nothing if the given status has no children (which includes * the case where it is not a multi-status). * * @param status the status whose children are to be added to this one */ public void addAll(IStatus status) { Assert.isLegal(status != null); IStatus[] statuses = status.getChildren(); for (int i = 0; i < statuses.length; i++) { add(statuses[i]); } }
protected boolean isErrorStatus(IStatus status) { if (!super.isErrorStatus(status)) return false; if (!status.isMultiStatus()) return !isReadOnlyLocalStatus(status); IStatus[] childrenStatus= status.getChildren(); for (int i= 0; i < childrenStatus.length; i++) { if (childrenStatus[i].getSeverity() == IStatus.ERROR && !isReadOnlyLocalStatus(childrenStatus[i])) return true; } return false; }
protected void assertCopyRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkCopyRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // This assert is ok because the error cases generated by the check method above // indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
protected void assertCopyRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkCopyRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
protected void assertCopyRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkCopyRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // This assert is ok because the error cases generated by the check method // above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }