Changeset 57:41dbc4d9faab
- Timestamp:
- 02/04/08 06:46:24
(10 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Update to tango trunk -r3152. Thanks DavidLeon? for the adjustment of TracedException? to Exception and creating the patch.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4 |
r57 |
|
| 3488 | 3488 | * @see IllegalArgumentException |
|---|
| 3489 | 3489 | */ |
|---|
| 3490 | | public static void error (int code, TracedException throwable) { |
|---|
| | 3490 | public static void error (int code, Exception throwable) { |
|---|
| 3491 | 3491 | error (code, throwable, null); |
|---|
| 3492 | 3492 | } |
|---|
| … | … | |
| 3520 | 3520 | * @since 3.0 |
|---|
| 3521 | 3521 | */ |
|---|
| 3522 | | public static void error (int code, TracedException throwable, char[] detail) { |
|---|
| | 3522 | public static void error (int code, Exception throwable, char[] detail) { |
|---|
| 3523 | 3523 | |
|---|
| 3524 | 3524 | /* |
|---|
| r48 |
r57 |
|
| 55 | 55 | * or null if this information is not available. |
|---|
| 56 | 56 | */ |
|---|
| 57 | | public TracedException throwable; |
|---|
| | 57 | public Exception throwable; |
|---|
| 58 | 58 | |
|---|
| 59 | 59 | //static final long serialVersionUID = 3833467327105808433L; |
|---|
| r48 |
r57 |
|
| 35 | 35 | */ |
|---|
| 36 | 36 | |
|---|
| 37 | | public class DWTException : TracedException { |
|---|
| | 37 | public class DWTException : Exception { |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | /** |
|---|
| … | … | |
| 46 | 46 | * or null if this information is not available. |
|---|
| 47 | 47 | */ |
|---|
| 48 | | public TracedException throwable; |
|---|
| | 48 | public Exception throwable; |
|---|
| 49 | 49 | |
|---|
| 50 | 50 | //static final long serialVersionUID = 3257282552304842547L; |
|---|
| … | … | |
| 107 | 107 | * @since 3.1 |
|---|
| 108 | 108 | */ |
|---|
| 109 | | public TracedException getCause() { |
|---|
| | 109 | public Exception getCause() { |
|---|
| 110 | 110 | return throwable; |
|---|
| 111 | 111 | } |
|---|
| r52 |
r57 |
|
| 136 | 136 | super(e); |
|---|
| 137 | 137 | } |
|---|
| 138 | | this( TracedException e ){ |
|---|
| | 138 | this( Exception e ){ |
|---|
| 139 | 139 | super(e.toString); |
|---|
| 140 | 140 | } |
|---|
| r53 |
r57 |
|
| 64 | 64 | bool debug_; |
|---|
| 65 | 65 | bool tracking; |
|---|
| 66 | | TracedException [] errors; |
|---|
| | 66 | Exception [] errors; |
|---|
| 67 | 67 | Object [] objects; |
|---|
| 68 | 68 | |
|---|
| … | … | |
| 161 | 161 | init (); |
|---|
| 162 | 162 | if (tracking) { |
|---|
| 163 | | errors = new TracedException [128]; |
|---|
| | 163 | errors = new Exception [128]; |
|---|
| 164 | 164 | objects = new Object [128]; |
|---|
| 165 | 165 | } |
|---|
| … | … | |
| 205 | 205 | gdipToken = token; |
|---|
| 206 | 206 | } |
|---|
| 207 | | } catch (TracedException t) { |
|---|
| | 207 | } catch (Exception t) { |
|---|
| 208 | 208 | DWT.error (DWT.ERROR_NO_GRAPHICS_LIBRARY, t, " [GDI+ is required]"); //$NON-NLS-1$ |
|---|
| 209 | 209 | } finally { |
|---|
| … | … | |
| 393 | 393 | int index = 0; |
|---|
| 394 | 394 | data.objects = new Object [count]; |
|---|
| 395 | | data.errors = new TracedException [count]; |
|---|
| | 395 | data.errors = new Exception [count]; |
|---|
| 396 | 396 | for (int i=0; i<length; i++) { |
|---|
| 397 | 397 | if (objects [i] !is null) { |
|---|
| … | … | |
| 821 | 821 | if (objects [i] is null) { |
|---|
| 822 | 822 | objects [i] = object; |
|---|
| 823 | | errors [i] = new TracedException ( "" ); |
|---|
| | 823 | errors [i] = new Exception ( "" ); |
|---|
| 824 | 824 | return; |
|---|
| 825 | 825 | } |
|---|
| … | … | |
| 829 | 829 | newObjects [objects.length] = object; |
|---|
| 830 | 830 | objects = newObjects; |
|---|
| 831 | | TracedException [] newErrors = new TracedException [errors.length + 128]; |
|---|
| | 831 | Exception [] newErrors = new Exception [errors.length + 128]; |
|---|
| 832 | 832 | System.arraycopy (errors, 0, newErrors, 0, errors.length); |
|---|
| 833 | | newErrors [errors.length] = new TracedException (""); |
|---|
| | 833 | newErrors [errors.length] = new Exception (""); |
|---|
| 834 | 834 | errors = newErrors; |
|---|
| 835 | 835 | } |
|---|
| r19 |
r57 |
|
| 22 | 22 | public bool debug_; |
|---|
| 23 | 23 | public bool tracking; |
|---|
| 24 | | public TracedException [] errors; |
|---|
| | 24 | public Exception [] errors; |
|---|
| 25 | 25 | public Object [] objects; |
|---|
| 26 | 26 | } |
|---|
| r2 |
r57 |
|
| 68 | 68 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 69 | 69 | return null; |
|---|
| 70 | | } catch (TracedException e) { |
|---|
| | 70 | } catch (Exception e) { |
|---|
| 71 | 71 | DWT.error(DWT.ERROR_INVALID_IMAGE, e); |
|---|
| 72 | 72 | return null; |
|---|
| … | … | |
| 89 | 89 | break; |
|---|
| 90 | 90 | } |
|---|
| 91 | | } catch (TracedException e) { |
|---|
| | 91 | } catch (Exception e) { |
|---|
| 92 | 92 | } |
|---|
| 93 | 93 | } |
|---|
| … | … | |
| 114 | 114 | } |
|---|
| 115 | 115 | } |
|---|
| 116 | | } catch (TracedException e) { |
|---|
| | 116 | } catch (Exception e) { |
|---|
| 117 | 117 | DWT.error(DWT.ERROR_UNSUPPORTED_FORMAT); |
|---|
| 118 | 118 | } |
|---|
| … | … | |
| 138 | 138 | unloadIntoByteStream(loader); |
|---|
| 139 | 139 | outputStream.flush(); |
|---|
| 140 | | } catch (TracedException e) { |
|---|
| | 140 | } catch (Exception e) { |
|---|
| 141 | 141 | try {outputStream.flush();} catch (Exception f) {} |
|---|
| 142 | 142 | DWT.error(DWT.ERROR_IO, e); |
|---|
| r48 |
r57 |
|
| 232 | 232 | } |
|---|
| 233 | 233 | return comment; |
|---|
| 234 | | } catch (TracedException e) { |
|---|
| | 234 | } catch (Exception e) { |
|---|
| 235 | 235 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 236 | 236 | return null; |
|---|
| … | … | |
| 263 | 263 | } |
|---|
| 264 | 264 | return text; |
|---|
| 265 | | } catch (TracedException e) { |
|---|
| | 265 | } catch (Exception e) { |
|---|
| 266 | 266 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 267 | 267 | return null; |
|---|
| … | … | |
| 297 | 297 | inputStream.read(); |
|---|
| 298 | 298 | return controlBlock; |
|---|
| 299 | | } catch (TracedException e) { |
|---|
| | 299 | } catch (Exception e) { |
|---|
| 300 | 300 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 301 | 301 | return null; |
|---|
| … | … | |
| 338 | 338 | } |
|---|
| 339 | 339 | return data; |
|---|
| 340 | | } catch (TracedException e) { |
|---|
| | 340 | } catch (Exception e) { |
|---|
| 341 | 341 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 342 | 342 | return null; |
|---|
| r48 |
r57 |
|
| 6334 | 6334 | stream.unread(buffer); |
|---|
| 6335 | 6335 | return (buffer[0] & 0xFF) is 0xFF && (buffer[1] & 0xFF) is M_SOI; |
|---|
| 6336 | | } catch (TracedException e) { |
|---|
| | 6336 | } catch (Exception e) { |
|---|
| 6337 | 6337 | return false; |
|---|
| 6338 | 6338 | } |
|---|
| r48 |
r57 |
|
| 1376 | 1376 | stream.unread(soi.reference); |
|---|
| 1377 | 1377 | return soi.verify(); // we no longer check for appN |
|---|
| 1378 | | } catch (TracedException e) { |
|---|
| | 1378 | } catch (Exception e) { |
|---|
| 1379 | 1379 | return false; |
|---|
| 1380 | 1380 | } |
|---|
| … | … | |
| 1749 | 1749 | int delta = jpegSegment.getSegmentLength() - 2; |
|---|
| 1750 | 1750 | byteStream.skip(delta); |
|---|
| 1751 | | } catch (TracedException e) { |
|---|
| | 1751 | } catch (Exception e) { |
|---|
| 1752 | 1752 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 1753 | 1753 | } |
|---|
| r48 |
r57 |
|
| 36 | 36 | try { |
|---|
| 37 | 37 | byteStream.read(reference); |
|---|
| 38 | | } catch (TracedException e) { |
|---|
| | 38 | } catch (Exception e) { |
|---|
| 39 | 39 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 40 | 40 | } |
|---|
| r2 |
r57 |
|
| 57 | 57 | byteStream.write(reference); |
|---|
| 58 | 58 | return true; |
|---|
| 59 | | } catch (TracedException e) { |
|---|
| | 59 | } catch (Exception e) { |
|---|
| 60 | 60 | return false; |
|---|
| 61 | 61 | } |
|---|
| r2 |
r57 |
|
| 37 | 37 | byteStream.read(contents, 4, contents.length - 4); |
|---|
| 38 | 38 | reference = contents; |
|---|
| 39 | | } catch (TracedException e) { |
|---|
| | 39 | } catch (Exception e) { |
|---|
| 40 | 40 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 41 | 41 | } |
|---|
| r31 |
r57 |
|
| 469 | 469 | DWT.error(DWT.ERROR_INVALID_IMAGE); |
|---|
| 470 | 470 | } |
|---|
| 471 | | } catch (TracedException e) { |
|---|
| | 471 | } catch (Exception e) { |
|---|
| 472 | 472 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 473 | 473 | } |
|---|
| … | … | |
| 481 | 481 | try { |
|---|
| 482 | 482 | outputStream.write(block, 0, (block[0] & 0xFF) + 1); |
|---|
| 483 | | } catch (TracedException e) { |
|---|
| | 483 | } catch (Exception e) { |
|---|
| 484 | 484 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 485 | 485 | } |
|---|
| r48 |
r57 |
|
| 37 | 37 | int infoHeaderSize = (header[14] & 0xFF) | ((header[15] & 0xFF) << 8) | ((header[16] & 0xFF) << 16) | ((header[17] & 0xFF) << 24); |
|---|
| 38 | 38 | return header[0] is 0x42 && header[1] is 0x4D && infoHeaderSize is BMPHeaderFixedSize; |
|---|
| 39 | | } catch (TracedException e) { |
|---|
| | 39 | } catch (Exception e) { |
|---|
| 40 | 40 | return false; |
|---|
| 41 | 41 | } |
|---|
| … | … | |
| 79 | 79 | try { |
|---|
| 80 | 80 | inputStream.read(infoHeader); |
|---|
| 81 | | } catch (TracedException e) { |
|---|
| | 81 | } catch (Exception e) { |
|---|
| 82 | 82 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 83 | 83 | } |
|---|
| r48 |
r57 |
|
| 39 | 39 | } |
|---|
| 40 | 40 | return true; |
|---|
| 41 | | } catch (TracedException e) { |
|---|
| | 41 | } catch (Exception e) { |
|---|
| 42 | 42 | return false; |
|---|
| 43 | 43 | } |
|---|
| r48 |
r57 |
|
| 340 | 340 | int infoHeaderSize = (header[14] & 0xFF) | ((header[15] & 0xFF) << 8) | ((header[16] & 0xFF) << 16) | ((header[17] & 0xFF) << 24); |
|---|
| 341 | 341 | return header[0] is 0x42 && header[1] is 0x4D && infoHeaderSize >= BMPHeaderFixedSize; |
|---|
| 342 | | } catch (TracedException e) { |
|---|
| | 342 | } catch (Exception e) { |
|---|
| 343 | 343 | return false; |
|---|
| 344 | 344 | } |
|---|
| … | … | |
| 400 | 400 | try { |
|---|
| 401 | 401 | inputStream.read(infoHeader); |
|---|
| 402 | | } catch (TracedException e) { |
|---|
| | 402 | } catch (Exception e) { |
|---|
| 403 | 403 | DWT.error(DWT.ERROR_IO, e); |
|---|
| 404 | 404 | } |
|---|
| r31 |
r57 |
|
| 27 | 27 | Runnable runnable; |
|---|
| 28 | 28 | Thread thread; |
|---|
| 29 | | TracedException throwable; |
|---|
| | 29 | Exception throwable; |
|---|
| 30 | 30 | |
|---|
| 31 | 31 | this (Runnable runnable) { |
|---|
| r31 |
r57 |
|
| 131 | 131 | try { |
|---|
| 132 | 132 | lock.run (); |
|---|
| 133 | | } catch (TracedException t) { |
|---|
| | 133 | } catch (Exception t) { |
|---|
| 134 | 134 | lock.throwable = t; |
|---|
| 135 | 135 | DWT.error (DWT.ERROR_FAILED_EXEC, t); |
|---|