# HG changeset patch # User Frank Benoit # Date 1219839003 -7200 # Node ID b903c16b6f4827c86bbe59752aaaac93b36852ec # Parent 1a8b3cb347e0f20f0ec43e9925f43da42143c08e Removed throws decls diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/custom/StyledText.d Wed Aug 27 14:10:03 2008 +0200 @@ -6855,7 +6855,7 @@ * @exception DWTError, see Clipboard.setContents * @see dwt.dnd.Clipboard#setContents */ -void setClipboardContent(int start, int length, int clipboardType) throws DWTError { +void setClipboardContent(int start, int length, int clipboardType) { if (clipboardType is DND.SELECTION_CLIPBOARD && !(IS_MOTIF || IS_GTK)) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/LEDataInputStream.d --- a/dwt/internal/image/LEDataInputStream.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/LEDataInputStream.d Wed Aug 27 14:10:03 2008 +0200 @@ -44,7 +44,7 @@ else throw new IllegalArgumentException(); } - public void close() throws IOException { + public void close() { buf = null; if (in !is null) { in.close(); @@ -62,7 +62,7 @@ /** * Answers how many bytes are available for reading without blocking */ - public int available() throws IOException { + public int available() { if (buf is null) throw new IOException(); return (buf.length - pos) + in.available(); } @@ -70,7 +70,7 @@ /** * Answer the next byte of the input stream. */ - public int read() throws IOException { + public int read() { if (buf is null) throw new IOException(); if (pos < buf.length) { position++; @@ -85,7 +85,7 @@ * Don't imitate the JDK behaviour of reading a random number * of bytes when you can actually read them all. */ - public int read(byte b[], int off, int len) throws IOException { + public int read(byte b[], int off, int len) { int read = 0, count; while (read !is len && (count = readData(b, off, len - read)) !is -1) { off += count; @@ -113,7 +113,7 @@ * * @exception java.io.IOException if an IOException occurs. */ - private int readData(byte[] buffer, int offset, int length) throws IOException { + private int readData(byte[] buffer, int offset, int length) { if (buf is null) throw new IOException(); if (offset < 0 || offset > buffer.length || length < 0 || (length > buffer.length - offset)) { @@ -146,7 +146,7 @@ * Answer an integer comprised of the next * four bytes of the input stream. */ - public int readInt() throws IOException { + public int readInt() { byte[] buf = new byte[4]; read(buf); return ((buf[3] & 0xFF) << 24) | @@ -159,7 +159,7 @@ * Answer a short comprised of the next * two bytes of the input stream. */ - public short readShort() throws IOException { + public short readShort() { byte[] buf = new byte[2]; read(buf); return (short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF)); @@ -177,7 +177,7 @@ * * @exception java.io.IOException if the pushback buffer is too small */ - public void unread(byte[] b) throws IOException { + public void unread(byte[] b) { int length = b.length; if (length > pos) throw new IOException(); position -= length; diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/LEDataOutputStream.d --- a/dwt/internal/image/LEDataOutputStream.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/LEDataOutputStream.d Wed Aug 27 14:10:03 2008 +0200 @@ -23,26 +23,26 @@ * Write the specified number of bytes of the given byte array, * starting at the specified offset, to the output stream. */ -public void write(byte b[], int off, int len) throws IOException { +public void write(byte b[], int off, int len) { out.write(b, off, len); } /** * Write the given byte to the output stream. */ -public void write(int b) throws IOException { +public void write(int b) { out.write(b); } /** * Write the given byte to the output stream. */ -public void writeByte(byte b) throws IOException { +public void writeByte(byte b) { out.write(b & 0xFF); } /** * Write the four bytes of the given integer * to the output stream. */ -public void writeInt(int theInt) throws IOException { +public void writeInt(int theInt) { out.write(theInt & 0xFF); out.write((theInt >> 8) & 0xFF); out.write((theInt >> 16) & 0xFF); @@ -52,7 +52,7 @@ * Write the two bytes of the given short * to the output stream. */ -public void writeShort(int theShort) throws IOException { +public void writeShort(int theShort) { out.write(theShort & 0xFF); out.write((theShort >> 8) & 0xFF); } diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PNGFileFormat.d --- a/dwt/internal/image/PNGFileFormat.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PNGFileFormat.d Wed Aug 27 14:10:03 2008 +0200 @@ -37,7 +37,7 @@ * Skip over signature data. This has already been * verified in isFileFormat(). */ -void readSignature() throws IOException { +void readSignature() { byte[] signature = new byte[SIGNATURE_LENGTH]; inputStream.read(signature); } @@ -90,7 +90,7 @@ * Read and handle the next chunk of data from the * PNG file. */ -void readNextChunk(PngChunkReader chunkReader) throws IOException { +void readNextChunk(PngChunkReader chunkReader) { PngChunk chunk = chunkReader.readNextChunk(); switch (chunk.getChunkType()) { case PngChunk.CHUNK_IEND: @@ -293,7 +293,7 @@ * Read the image data from the data stream. This must handle * decoding the data, filtering, and interlacing. */ -void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) throws IOException { +void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) { InputStream stream = new PngInputStream(chunk, chunkReader); //TEMPORARY CODE bool use3_2 = System.getProperty("dwt.internal.image.PNGFileFormat_3.2") !is null; @@ -366,7 +366,7 @@ int columnInterval, int startRow, int startColumn, - int frameCount) throws IOException + int frameCount) { int width = headerChunk.getWidth(); int alignedBytesPerRow = getAlignedBytesPerRow(); @@ -428,7 +428,7 @@ * Read the pixel data for an interlaced image from the * data stream. */ -void readInterlacedImage(InputStream inputStream) throws IOException { +void readInterlacedImage(InputStream inputStream) { readInterlaceFrame(inputStream, 8, 8, 0, 0, 0); readInterlaceFrame(inputStream, 8, 8, 0, 4, 1); readInterlaceFrame(inputStream, 8, 4, 4, 0, 2); @@ -455,7 +455,7 @@ * data stream. * Update the imageData to reflect the new data. */ -void readNonInterlacedImage(InputStream inputStream) throws IOException { +void readNonInterlacedImage(InputStream inputStream) { int dataOffset = 0; int alignedBytesPerRow = getAlignedBytesPerRow(); int bytesPerRow = getBytesPerRow(); diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngDecodingDataStream.d --- a/dwt/internal/image/PngDecodingDataStream.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngDecodingDataStream.d Wed Aug 27 14:10:03 2008 +0200 @@ -27,7 +27,7 @@ static final int PRIME = 65521; static final int MAX_BIT = 7; -this(InputStream stream) throws IOException { +this(InputStream stream) { super(); this.stream = stream; nextBitIndex = MAX_BIT + 1; @@ -44,16 +44,16 @@ * block marker. If there are more blocks after this one, * the method will read them and ensure that they are empty. */ -void assertImageDataAtEnd() throws IOException { +void assertImageDataAtEnd() { lzBlockReader.assertCompressedDataAtEnd(); } -public void close() throws IOException { +public void close() { assertImageDataAtEnd(); checkAdler(); } -int getNextIdatBits(int length) throws IOException { +int getNextIdatBits(int length) { int value = 0; for (int i = 0; i < length; i++) { value |= (getNextIdatBit() << i); @@ -61,7 +61,7 @@ return value; } -int getNextIdatBit() throws IOException { +int getNextIdatBit() { if (nextBitIndex > MAX_BIT) { currentByte = getNextIdatByte(); nextBitIndex = 0; @@ -69,7 +69,7 @@ return (currentByte & (1 << nextBitIndex)) >> nextBitIndex++; } -byte getNextIdatByte() throws IOException { +byte getNextIdatByte() { byte nextByte = (byte)stream.read(); nextBitIndex = MAX_BIT + 1; return nextByte; @@ -84,13 +84,13 @@ adlerValue = (high << 16) | low; } -public int read() throws IOException { +public int read() { byte nextDecodedByte = lzBlockReader.getNextByte(); updateAdler(nextDecodedByte); return nextDecodedByte & 0xFF; } -public int read(byte[] buffer, int off, int len) throws IOException { +public int read(byte[] buffer, int off, int len) { for (int i = 0; i < len; i++) { int b = read(); if (b is -1) return i; @@ -103,7 +103,7 @@ DWT.error(DWT.ERROR_INVALID_IMAGE); } -private void readCompressedDataHeader() throws IOException { +private void readCompressedDataHeader() { byte headerByte1 = getNextIdatByte(); byte headerByte2 = getNextIdatByte(); @@ -124,7 +124,7 @@ // int compressionLevel = (headerByte2 & 0xC0) >> 6; } -void checkAdler() throws IOException { +void checkAdler() { int storedAdler = ((getNextIdatByte() & 0xFF) << 24) | ((getNextIdatByte() & 0xFF) << 16) | ((getNextIdatByte() & 0xFF) << 8) diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngEncoder.d --- a/dwt/internal/image/PngEncoder.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngEncoder.d Wed Aug 27 14:10:03 2008 +0200 @@ -229,7 +229,7 @@ } -void writeImageData() throws IOException { +void writeImageData() { ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); OutputStream os = Compatibility.newDeflaterOutputStream(baos); diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngHuffmanTable.d --- a/dwt/internal/image/PngHuffmanTable.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngHuffmanTable.d Wed Aug 27 14:10:03 2008 +0200 @@ -91,7 +91,7 @@ } } -int getNextValue(PngDecodingDataStream stream) throws IOException { +int getNextValue(PngDecodingDataStream stream) { int code = stream.getNextIdatBit(); int codelength = 0; diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngHuffmanTables.d --- a/dwt/internal/image/PngHuffmanTables.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngHuffmanTables.d Wed Aug 27 14:10:03 2008 +0200 @@ -47,7 +47,7 @@ 11, 4, 12, 3, 13, 2, 14, 1, 15 }; -static PngHuffmanTables getDynamicTables(PngDecodingDataStream stream) throws IOException { +static PngHuffmanTables getDynamicTables(PngDecodingDataStream stream) { return new PngHuffmanTables(stream); } static PngHuffmanTables getFixedTables() { @@ -73,7 +73,7 @@ distanceTable = getFixedDistanceTable(); } -private this (PngDecodingDataStream stream) throws IOException { +private this (PngDecodingDataStream stream) { int literals = PngLzBlockReader.FIRST_LENGTH_CODE + stream.getNextIdatBits(5); int distances = PngLzBlockReader.FIRST_DISTANCE_CODE @@ -111,7 +111,7 @@ private int [] readLengths (PngDecodingDataStream stream, int numLengths, PngHuffmanTable lengthsTable, - int tableSize) throws IOException + int tableSize) { int[] lengths = new int[tableSize]; @@ -149,11 +149,11 @@ return lengths; } -int getNextLiteralValue(PngDecodingDataStream stream) throws IOException { +int getNextLiteralValue(PngDecodingDataStream stream) { return literalTable.getNextValue(stream); } -int getNextDistanceValue(PngDecodingDataStream stream) throws IOException { +int getNextDistanceValue(PngDecodingDataStream stream) { return distanceTable.getNextValue(stream); } diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngInputStream.d --- a/dwt/internal/image/PngInputStream.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngInputStream.d Wed Aug 27 14:10:03 2008 +0200 @@ -27,7 +27,7 @@ offset = 0; } -private bool checkChunk() throws IOException { +private bool checkChunk() { while (offset is length) { chunk = reader.readNextChunk(); if (chunk is null) throw new IOException(); @@ -39,11 +39,11 @@ return true; } -public void close() throws IOException { +public void close() { chunk = null; } -public int read() throws IOException { +public int read() { if (chunk is null) throw new IOException(); if (offset is length && !checkChunk()) return -1; int b = chunk.reference[DATA_OFFSET + offset] & 0xFF; @@ -51,7 +51,7 @@ return b; } -public int read(byte[] b, int off, int len) throws IOException { +public int read(byte[] b, int off, int len) { if (chunk is null) throw new IOException(); if (offset is length && !checkChunk()) return -1; len = Math.min(len, length - offset); diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/PngLzBlockReader.d --- a/dwt/internal/image/PngLzBlockReader.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/PngLzBlockReader.d Wed Aug 27 14:10:03 2008 +0200 @@ -64,7 +64,7 @@ window = new byte[windowSize]; } -void readNextBlockHeader() throws IOException { +void readNextBlockHeader() { isLastBlock = stream.getNextIdatBit() !is 0; compressionType = (byte)(stream.getNextIdatBits(2) & 0xFF); if (compressionType > 2) stream.error(); @@ -83,7 +83,7 @@ } } -byte getNextByte() throws IOException { +byte getNextByte() { if (compressionType is UNCOMPRESSED) { if (uncompressedBytesRemaining is 0) { readNextBlockHeader(); @@ -103,7 +103,7 @@ } } -private void assertBlockAtEnd() throws IOException { +private void assertBlockAtEnd() { if (compressionType is UNCOMPRESSED) { if (uncompressedBytesRemaining > 0) stream.error(); } else if (copyBytesRemaining > 0 || @@ -112,7 +112,7 @@ stream.error(); } } -void assertCompressedDataAtEnd() throws IOException { +void assertCompressedDataAtEnd() { assertBlockAtEnd(); while (!isLastBlock) { readNextBlockHeader(); @@ -120,7 +120,7 @@ } } -private byte getNextCompressedByte() throws IOException { +private byte getNextCompressedByte() { if (copyBytesRemaining > 0) { byte value = window[copyIndex]; window[windowIndex] = value; diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/TIFFDirectory.d --- a/dwt/internal/image/TIFFDirectory.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/TIFFDirectory.d Wed Aug 27 14:10:03 2008 +0200 @@ -115,7 +115,7 @@ return toInt(buffer, index + 8, type); } -void getEntryValue(int type, byte[] buffer, int index, int[] values) throws IOException { +void getEntryValue(int type, byte[] buffer, int index, int[] values) { int start = index + 8; int size; int offset = toInt(buffer, start, TYPE_LONG); @@ -138,7 +138,7 @@ } } -void decodePixels(ImageData image) throws IOException { +void decodePixels(ImageData image) { /* Each row is byte aligned */ byte[] imageData = new byte[(imageWidth * depth + 7) / 8 * imageLength]; image.data = imageData; @@ -169,7 +169,7 @@ } } -PaletteData getColorMap() throws IOException { +PaletteData getColorMap() { int numColors = 1 << bitsPerSample[0]; /* R, G, B entries are 16 bit wide (2 bytes) */ int numBytes = 3 * 2 * numColors; @@ -298,7 +298,7 @@ return colorMap; } -void parseEntries(byte[] buffer) throws IOException { +void parseEntries(byte[] buffer) { for (int offset = 0; offset < buffer.length; offset += IFD_ENTRY_SIZE) { int tag = toInt(buffer, offset, TYPE_SHORT); int type = toInt(buffer, offset + 2, TYPE_SHORT); @@ -379,7 +379,7 @@ } } -public ImageData read() throws IOException { +public ImageData read() { /* Set TIFF default values */ bitsPerSample = new int[] {1}; colorMapOffset = NO_VALUE; @@ -466,7 +466,7 @@ return -1; } -void write(int photometricInterpretation) throws IOException { +void write(int photometricInterpretation) { bool isRGB = photometricInterpretation is 2; bool isColorMap = photometricInterpretation is 3; bool isBiLevel = photometricInterpretation is 0 || photometricInterpretation is 1; @@ -567,14 +567,14 @@ out.write(data); } -void writeEntry(short tag, int type, int count, int value) throws IOException { +void writeEntry(short tag, int type, int count, int value) { out.writeShort(tag); out.writeShort(type); out.writeInt(count); out.writeInt(value); } -void writeHeader() throws IOException { +void writeHeader() { /* little endian */ out.write(0x49); out.write(0x49); @@ -588,7 +588,7 @@ out.writeInt(8); } -void writeToStream(LEDataOutputStream byteStream) throws IOException { +void writeToStream(LEDataOutputStream byteStream) { out = byteStream; int photometricInterpretation = -1; diff -r 1a8b3cb347e0 -r b903c16b6f48 dwt/internal/image/TIFFRandomFileAccess.d --- a/dwt/internal/image/TIFFRandomFileAccess.d Wed Aug 27 14:02:31 2008 +0200 +++ b/dwt/internal/image/TIFFRandomFileAccess.d Wed Aug 27 14:10:03 2008 +0200 @@ -27,7 +27,7 @@ buffers = new byte[LIST_SIZE][]; } -void seek(int pos) throws IOException { +void seek(int pos) { if (pos is current) return; if (pos < start) throw new IOException(); current = pos; @@ -52,7 +52,7 @@ } } -void read(byte b[]) throws IOException { +void read(byte b[]) { int size = b.length; int nCached = Math.min(size, next - current); int nMissing = size - next + current;