From: Michael Koch Date: Thu, 13 Feb 2003 08:40:35 +0000 (+0000) Subject: natByteBufferImpl.cc, [...]: Added copyright and license. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9038b8b4d3e00d74a494aeab8a8f619fd1e87cc9;p=gcc.git natByteBufferImpl.cc, [...]: Added copyright and license. 2003-02-13 Michael Koch * gnu/java/nio/natByteBufferImpl.cc, gnu/java/nio/natCharBufferImpl.cc, gnu/java/nio/natDoubleBufferImpl.cc, gnu/java/nio/natFloatBufferImpl.cc, gnu/java/nio/natIntBufferImpl.cc, gnu/java/nio/natLongBufferImpl.cc, gnu/java/nio/natShortBufferImpl.cc: Added copyright and license. * java/nio/DoubleBuffer.java, java/nio/FloatBuffer.java, java/nio/IntBuffer.java, java/nio/LongBuffer.java, java/nio/ShortBuffer.java (array): Throw exceptions. (arrayOffset): Throw exceptions. From-SVN: r62832 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 16491e6d026..cc4e671e120 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,21 @@ +2003-02-13 Michael Koch + + * gnu/java/nio/natByteBufferImpl.cc, + gnu/java/nio/natCharBufferImpl.cc, + gnu/java/nio/natDoubleBufferImpl.cc, + gnu/java/nio/natFloatBufferImpl.cc, + gnu/java/nio/natIntBufferImpl.cc, + gnu/java/nio/natLongBufferImpl.cc, + gnu/java/nio/natShortBufferImpl.cc: + Added copyright and license. + * java/nio/DoubleBuffer.java, + java/nio/FloatBuffer.java, + java/nio/IntBuffer.java, + java/nio/LongBuffer.java, + java/nio/ShortBuffer.java + (array): Throw exceptions. + (arrayOffset): Throw exceptions. + 2003-02-13 Michael Koch * gnu/java/util/prefs/FileBasedFactory.java, diff --git a/libjava/gnu/java/nio/natByteBufferImpl.cc b/libjava/gnu/java/nio/natByteBufferImpl.cc index b98b694e87b..2bb1e41a622 100644 --- a/libjava/gnu/java/nio/natByteBufferImpl.cc +++ b/libjava/gnu/java/nio/natByteBufferImpl.cc @@ -1,3 +1,13 @@ +// natByteBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natCharBufferImpl.cc b/libjava/gnu/java/nio/natCharBufferImpl.cc index 6f9bf6474d6..9fb54e14561 100644 --- a/libjava/gnu/java/nio/natCharBufferImpl.cc +++ b/libjava/gnu/java/nio/natCharBufferImpl.cc @@ -1,3 +1,13 @@ +// natCharBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natDoubleBufferImpl.cc b/libjava/gnu/java/nio/natDoubleBufferImpl.cc index c71fd032082..6c66a337417 100644 --- a/libjava/gnu/java/nio/natDoubleBufferImpl.cc +++ b/libjava/gnu/java/nio/natDoubleBufferImpl.cc @@ -1,3 +1,13 @@ +// natDoubleBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natFloatBufferImpl.cc b/libjava/gnu/java/nio/natFloatBufferImpl.cc index 3464c7656c2..9785454634c 100644 --- a/libjava/gnu/java/nio/natFloatBufferImpl.cc +++ b/libjava/gnu/java/nio/natFloatBufferImpl.cc @@ -1,3 +1,13 @@ +// natFloatBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natIntBufferImpl.cc b/libjava/gnu/java/nio/natIntBufferImpl.cc index 399062804eb..eff70f838bb 100644 --- a/libjava/gnu/java/nio/natIntBufferImpl.cc +++ b/libjava/gnu/java/nio/natIntBufferImpl.cc @@ -1,3 +1,13 @@ +// natIntBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natLongBufferImpl.cc b/libjava/gnu/java/nio/natLongBufferImpl.cc index 81181e035d6..a84248136e5 100644 --- a/libjava/gnu/java/nio/natLongBufferImpl.cc +++ b/libjava/gnu/java/nio/natLongBufferImpl.cc @@ -1,3 +1,13 @@ +// natLongBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/gnu/java/nio/natShortBufferImpl.cc b/libjava/gnu/java/nio/natShortBufferImpl.cc index 576573a9048..188bff9575e 100644 --- a/libjava/gnu/java/nio/natShortBufferImpl.cc +++ b/libjava/gnu/java/nio/natShortBufferImpl.cc @@ -1,3 +1,13 @@ +// natShortBufferImpl.cc + +/* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + #include #include diff --git a/libjava/java/nio/DoubleBuffer.java b/libjava/java/nio/DoubleBuffer.java index 72a6c09078d..036579a802b 100644 --- a/libjava/java/nio/DoubleBuffer.java +++ b/libjava/java/nio/DoubleBuffer.java @@ -125,11 +125,23 @@ public abstract class DoubleBuffer extends Buffer implements Comparable public final double[] array() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return backing_buffer; } public final int arrayOffset() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return array_offset; } diff --git a/libjava/java/nio/FloatBuffer.java b/libjava/java/nio/FloatBuffer.java index b780ff597d8..8531cb99f9d 100644 --- a/libjava/java/nio/FloatBuffer.java +++ b/libjava/java/nio/FloatBuffer.java @@ -126,11 +126,23 @@ public abstract class FloatBuffer extends Buffer implements Comparable public final float[] array() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return backing_buffer; } public final int arrayOffset() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return array_offset; } diff --git a/libjava/java/nio/IntBuffer.java b/libjava/java/nio/IntBuffer.java index aca6e0f1902..ddf03d8364d 100644 --- a/libjava/java/nio/IntBuffer.java +++ b/libjava/java/nio/IntBuffer.java @@ -126,11 +126,23 @@ public abstract class IntBuffer extends Buffer implements Comparable public final int[] array() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return backing_buffer; } public final int arrayOffset() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return array_offset; } diff --git a/libjava/java/nio/LongBuffer.java b/libjava/java/nio/LongBuffer.java index 0ddc7938a49..63eb5af1a11 100644 --- a/libjava/java/nio/LongBuffer.java +++ b/libjava/java/nio/LongBuffer.java @@ -126,11 +126,23 @@ public abstract class LongBuffer extends Buffer implements Comparable public final long[] array() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return backing_buffer; } public final int arrayOffset() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return array_offset; } diff --git a/libjava/java/nio/ShortBuffer.java b/libjava/java/nio/ShortBuffer.java index 512c9fd8bec..7a71cad6d85 100644 --- a/libjava/java/nio/ShortBuffer.java +++ b/libjava/java/nio/ShortBuffer.java @@ -126,11 +126,23 @@ public abstract class ShortBuffer extends Buffer implements Comparable public final short[] array() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return backing_buffer; } public final int arrayOffset() { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + return array_offset; }