Mercurial > projects > dwt-addons
annotate dwtx/core/internal/runtime/PrintStackUtil.d @ 197:0ea0c9f9008f
Remove tango deprecation warnings.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Feb 2009 19:35:22 +0100 |
parents | 4878bef4a38e |
children |
rev | line source |
---|---|
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 /******************************************************************************* |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 * Copyright (c) 2008 IBM Corporation and others. |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
71 | 7 * |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 * Contributors: |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 * IBM Corporation - initial API and implementation |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 * Port to the D programming language: |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
11 * Frank Benoit <benoit@tionex.de> |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 *******************************************************************************/ |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 module dwtx.core.internal.runtime.PrintStackUtil; |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
15 import dwtx.core.runtime.IStatus; |
197
0ea0c9f9008f
Remove tango deprecation warnings.
Frank Benoit <benoit@tionex.de>
parents:
71
diff
changeset
|
16 import tango.io.stream.Format; |
71 | 17 import dwt.dwthelper.utils; |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 public class PrintStackUtil { |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
20 |
197
0ea0c9f9008f
Remove tango deprecation warnings.
Frank Benoit <benoit@tionex.de>
parents:
71
diff
changeset
|
21 static public void printChildren(IStatus status, FormatOutput!(char) output) { |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 IStatus[] children = status.getChildren(); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
23 if (children is null || children.length is 0) |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 return; |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
25 for (int i = 0; i < children.length; i++) { |
71 | 26 output.formatln("Contains: {}", children[i].getMessage()); //$NON-NLS-1$ |
27 Exception exception = children[i].getException(); | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
28 if (exception !is null) |
71 | 29 ExceptionPrintStackTrace(exception); |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 printChildren(children[i], output); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
31 } |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
32 } |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
33 |
197
0ea0c9f9008f
Remove tango deprecation warnings.
Frank Benoit <benoit@tionex.de>
parents:
71
diff
changeset
|
34 // static public void printChildren(IStatus status, FormatOutput!(char) output) { |
71 | 35 // IStatus[] children = status.getChildren(); |
36 // if (children is null || children.length is 0) | |
37 // return; | |
38 // for (int i = 0; i < children.length; i++) { | |
39 // output.formatln( "Contains: {}", children[i].getMessage()); //$NON-NLS-1$ | |
40 // output.flush(); // call to synchronize output | |
41 // Exception exception = children[i].getException(); | |
42 // if (exception !is null) | |
43 // ExceptionPrintStackTrace(exception); | |
44 // printChildren(children[i], output); | |
45 // } | |
46 // } | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 } |