From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29902 invoked by alias); 4 Jul 2008 16:19:39 -0000 Received: (qmail 29876 invoked by uid 367); 4 Jul 2008 16:19:38 -0000 Date: Fri, 04 Jul 2008 16:19:00 -0000 Message-ID: <20080704161938.29861.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: frysk-sys/inua/ChangeLog X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fbcdfd6bd19693304caf613b79fd1d69fa1eca67 X-Git-Newrev: 6a0ea520d3eaebb371820f312c3bb40666c60265 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q3/txt/msg00001.txt.bz2 The branch, master has been updated via 6a0ea520d3eaebb371820f312c3bb40666c60265 (commit) from fbcdfd6bd19693304caf613b79fd1d69fa1eca67 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 6a0ea520d3eaebb371820f312c3bb40666c60265 Author: Andrew Cagney Date: Fri Jul 4 11:24:41 2008 -0400 frysk-sys/inua/ChangeLog 2008-07-04 Andrew Cagney * eio/ByteBuffer.java: Throw InternalException. * eio/BufferUnderflowException.java: Extend UserException. ----------------------------------------------------------------------- Summary of changes: frysk-sys/inua/ChangeLog | 5 ++ frysk-sys/inua/eio/BufferUnderflowException.java | 10 ++- frysk-sys/inua/eio/ByteBuffer.java | 74 ++++++++++------------ 3 files changed, 45 insertions(+), 44 deletions(-) First 500 lines of diff: diff --git a/frysk-sys/inua/ChangeLog b/frysk-sys/inua/ChangeLog index 1827bf2..16ae59b 100644 --- a/frysk-sys/inua/ChangeLog +++ b/frysk-sys/inua/ChangeLog @@ -1,3 +1,8 @@ +2008-07-04 Andrew Cagney + + * eio/ByteBuffer.java: Throw InternalException. + * eio/BufferUnderflowException.java: Extend UserException. + 2008-06-05 Andrew Cagney * eio/ByteBuffer.java: Add missing indexed word get/put methods. diff --git a/frysk-sys/inua/eio/BufferUnderflowException.java b/frysk-sys/inua/eio/BufferUnderflowException.java index a17063d..2f9f7ed 100644 --- a/frysk-sys/inua/eio/BufferUnderflowException.java +++ b/frysk-sys/inua/eio/BufferUnderflowException.java @@ -34,10 +34,14 @@ // modification, you must delete this exception statement from your // version and license this file solely under the GPL without // exception. + package inua.eio; -public class BufferUnderflowException - extends java.nio.BufferUnderflowException -{ +import frysk.UserException; + +public class BufferUnderflowException extends UserException { private static final long serialVersionUID = 1L; + BufferUnderflowException(long address) { + super("Address 0x" + Long.toHexString(address) + " out of bounds"); + } } diff --git a/frysk-sys/inua/eio/ByteBuffer.java b/frysk-sys/inua/eio/ByteBuffer.java index 6549a58..873e481 100644 --- a/frysk-sys/inua/eio/ByteBuffer.java +++ b/frysk-sys/inua/eio/ByteBuffer.java @@ -40,9 +40,10 @@ * A ByteBuffer. Just like {@link java.nio.ByteBuffer} only 64-bit. */ - package inua.eio; +import frysk.InternalException; + public abstract class ByteBuffer extends Buffer { @@ -293,9 +294,8 @@ public abstract class ByteBuffer * Given BUFFER, return a new subBuffer. Used by {@link #slice}. */ protected ByteBuffer subBuffer (ByteBuffer buffer, long lowerExtreem, - long upperExtreem) - { - throw new RuntimeException("not implemented"); + long upperExtreem) { + throw new InternalException("not implemented"); } public ByteBuffer slice (long off, long len) @@ -321,14 +321,12 @@ public abstract class ByteBuffer return (byte) peek(lowWater + index); } - public ByteBuffer get (long index, byte[] dst, int off, int len) - throws BufferUnderflowException - { - if (ULong.GT(index + len, limit())) - throw new BufferUnderflowException(); - peekFully(lowWater + index,dst,off,len); - return this; - } + public ByteBuffer get(long index, byte[] dst, int off, int len) { + if (ULong.GT(index + len, limit())) + throw new BufferUnderflowException(index + len); + peekFully(lowWater + index,dst,off,len); + return this; + } public int safeGet (long index, byte[] dst, int off, int len) { @@ -339,35 +337,29 @@ public abstract class ByteBuffer return maxLen; } - public ByteBuffer get (byte[] dst, int off, int len) - throws BufferUnderflowException - { - if (ULong.GT(len, remaining())) - throw new BufferUnderflowException(); - peek(cursor, dst, off, len); - cursor += len; - return this; - } + public ByteBuffer get(byte[] dst, int off, int len) { + if (ULong.GT(len, remaining())) + throw new BufferUnderflowException(len); + peek(cursor, dst, off, len); + cursor += len; + return this; + } - public final ByteBuffer get (byte[] dst) throws BufferUnderflowException - { - return get(dst, 0, dst.length); - } + public final ByteBuffer get (byte[] dst) { + return get(dst, 0, dst.length); + } - public ByteBuffer put (byte[] src, int off, int len) - throws BufferUnderflowException - { - if (ULong.GT(len, remaining())) - throw new BufferUnderflowException(); - poke(cursor, src, off, len); - cursor += len; - return this; - } + public ByteBuffer put (byte[] src, int off, int len) { + if (ULong.GT(len, remaining())) + throw new BufferUnderflowException(len); + poke(cursor, src, off, len); + cursor += len; + return this; + } - public final ByteBuffer put (byte[] src) throws BufferUnderflowException - { - return put(src, 0, src.length); - } + public final ByteBuffer put (byte[] src) { + return put(src, 0, src.length); + } protected ByteOrdered byteOrdered; hooks/post-receive -- frysk system monitor/debugger