sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/02: Settle the policy regarding ChannelData.reset(). Opportunistic typo fixes.
Date Tue, 05 May 2020 22:45:23 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 1f1fdbf0d062a6909490c89ec12be2ba42fdd8da
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue May 5 15:14:50 2020 +0200

    Settle the policy regarding ChannelData.reset(). Opportunistic typo fixes.
---
 .../src/main/java/org/apache/sis/image/TransferType.java       | 10 +++++-----
 .../src/main/java/org/apache/sis/measure/Units.java            |  2 +-
 .../java/org/apache/sis/internal/storage/io/ChannelData.java   | 10 +++++-----
 .../sis/internal/storage/io/RewindableLineReaderTest.java      |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/TransferType.java b/core/sis-feature/src/main/java/org/apache/sis/image/TransferType.java
index e70c1ee..07c1bf4 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/TransferType.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/TransferType.java
@@ -70,10 +70,10 @@ public final class TransferType<T extends Buffer> implements Serializable
{
     final int dataBufferType;
 
     /**
-     * Specifies that sample values are transfered as 32 bits signed integer.
+     * Specifies that sample values are transferred as 32 bits signed integer.
      * If the raster stores sample values as {@code byte} or {@code short}, the values are
casted by a widening
-     * conversion before to be transfered. If the raster stores sample values as {@code float}
or {@code double},
-     * the values are rounded toward 0 before to be transfered.
+     * conversion before to be transferred. If the raster stores sample values as {@code
float} or {@code double},
+     * the values are rounded toward 0 before to be transferred.
      *
      * @see PixelIterator#getSample(int)
      * @see PixelIterator#getPixel(int[])
@@ -81,7 +81,7 @@ public final class TransferType<T extends Buffer> implements Serializable
{
     public static final TransferType<IntBuffer> INT = new TransferType<>("INT",
DataBuffer.TYPE_INT);
 
     /**
-     * Specifies that sample values are transfered as single-precision floating point number.
+     * Specifies that sample values are transferred as single-precision floating point number.
      * Values of other types are casted as needed.
      *
      * @see PixelIterator#getSampleFloat(int)
@@ -90,7 +90,7 @@ public final class TransferType<T extends Buffer> implements Serializable
{
     public static final TransferType<FloatBuffer> FLOAT = new TransferType<>("FLOAT",
DataBuffer.TYPE_FLOAT);
 
     /**
-     * Specifies that sample values are transfered as double-precision floating point number.
+     * Specifies that sample values are transferred as double-precision floating point number.
      * Values of other types are casted as needed. This is the safest transfer type to use
      * when wanting to avoid any precision lost.
      *
diff --git a/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java b/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
index 0d3181e..d82ebe2 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
@@ -824,7 +824,7 @@ public final class Units extends Static {
 
     /**
      * The SI derived unit for electric charge (C).
-     * One coulomb is the charge transfered by a current of one ampere during one second.
+     * One coulomb is the charge transferred by a current of one ampere during one second.
      * The unlocalized name is “coulomb”.
      *
      * <div class="note">
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java
index 282dbb2..49e5195 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java
@@ -278,8 +278,8 @@ public abstract class ChannelData implements Markable {
      * <h4>Departure from Image I/O specification</h4>
      * The {@link javax.imageio.stream.ImageInputStream#reset()} contract specifies that
if there is no matching mark,
      * then this method shall do nothing. This method throws {@link InvalidMarkException}
instead; silently ignoring
-     * the mismatch is considered too dangerous. However we may revisit this policy in the
future if it appears to be
-     * a compatibility problem. Consequently, no code shall rely on {@code InvalidMarkException}
to be thrown.
+     * the mismatch is considered too dangerous. This is a departure from {@code ImageInputStream}
but is consistent
+     * with {@link java.io.InputStream#reset()} contract.
      *
      * @throws IOException if an I/O error occurs.
      */
@@ -295,10 +295,10 @@ public abstract class ChannelData implements Markable {
     }
 
     /**
-     * Invoked when an operation between the channel and the buffer transfered no byte. Note
that this is unrelated
+     * Invoked when an operation between the channel and the buffer transferred no byte.
Note that this is unrelated
      * to end-of-file, in which case {@link java.nio.channels.ReadableByteChannel#read(ByteBuffer)}
returns -1.
      * A return value of 0 happen for example if the channel is a socket in non-blocking
mode and the socket buffer
-     * has not yet transfered new data.
+     * has not yet transferred new data.
      *
      * <p>The current implementation sleeps an arbitrary amount of time before to allow
a new try.
      * We do that in order to avoid high CPU consumption when data are expected to take more
than
@@ -313,7 +313,7 @@ public abstract class ChannelData implements Markable {
             /*
              * Someone doesn't want to let us sleep. Stop the reading or writing process.
We don't try to go back to
              * work, because the waiting time was short and this method is invoked in loops.
Consequently if the user
-             * interrupted us, it is probably because he waited for a long time and we still
have not transfered any
+             * interrupted us, it is probably because he waited for a long time and we still
have not transferred any
              * new data.
              */
             throw new IOException(e);
diff --git a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/io/RewindableLineReaderTest.java
b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/io/RewindableLineReaderTest.java
index c353924..0dd0bde 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/io/RewindableLineReaderTest.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/io/RewindableLineReaderTest.java
@@ -105,7 +105,7 @@ public final strictfp class RewindableLineReaderTest extends TestCase
{
 
             /**
              * Transfers at most {@value #TRANSFERT_SIZE} bytes. We put a limit in the number
of bytes
-             * to be transfered in order to cause {@link BufferedReader} to invalidate the
mark sooner
+             * to be transferred in order to cause {@link BufferedReader} to invalidate the
mark sooner
              * than waiting that we have filled the buffer.
              */
             @Override public int read(final byte[] buffer, int offset, int length) {


Mime
View raw message