You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2022/01/06 01:20:17 UTC
[sis] 04/07: Editions in comments (mostly spelling). No code change.
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 b9e0c4fc4c94f212bc4d1e00c7ee7e1bef83bbc4
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Jan 5 05:39:45 2022 +0100
Editions in comments (mostly spelling). No code change.
---
.../src/main/java/org/apache/sis/io/wkt/Formatter.java | 2 +-
.../org/apache/sis/storage/netcdf/NetcdfStoreProvider.java | 5 +++++
.../apache/sis/internal/storage/io/RewindableLineReader.java | 6 +++---
.../main/java/org/apache/sis/storage/StorageConnector.java | 12 ++++++------
.../java/org/apache/sis/storage/DataStoreProviderTest.java | 2 +-
.../java/org/apache/sis/storage/StorageConnectorTest.java | 4 ++--
.../sis/internal/storage/xml/stream/StaxDataStore.java | 6 +++---
7 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
index 1a362be..892e74d 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
@@ -539,7 +539,7 @@ public class Formatter implements Localized {
}
/**
- * Appends in the {@linkplain #buffer} the ANSI escape sequence for reseting the color to the default.
+ * Appends in the {@linkplain #buffer} the ANSI escape sequence for resetting the color to the default.
* This method does nothing unless syntax coloring has been explicitly enabled.
*/
private void resetColor() {
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
index cb6acba..1058f22 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
@@ -192,6 +192,11 @@ public class NetcdfStoreProvider extends DataStoreProvider {
boolean isSupported = false;
final ByteBuffer buffer = connector.getStorageAs(ByteBuffer.class);
if (buffer != null) {
+ /*
+ * This block is written as if `ByteBuffer` was an immutable object.
+ * In particular we use the "absolute position" variants of `get(…)`.
+ * Consequently we do not need to mark and reset buffer position.
+ */
if (buffer.remaining() < Integer.BYTES) {
return ProbeResult.INSUFFICIENT_BYTES;
}
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
index ab59f23..7fe6ce4 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
@@ -25,7 +25,7 @@ import org.apache.sis.io.InvalidSeekException;
/**
- * A {@link LineNumberReader} which may be rewinded to its original position even if the mark is no longer valid.
+ * A {@link LineNumberReader} which may be rewound to its original position even if the mark is no longer valid.
* This class assumes that {@link #mark(int)} has not been invoked, or has been invoked at the position where to
* rewind. A call to {@link #rewind()} performs the following actions:
*
@@ -49,7 +49,7 @@ public final class RewindableLineReader extends LineNumberReader {
* The input stream, or {@code null} if this reader can not rewind anymore.
*
* <div class="note"><b>Note:</b> we do not use the more generic {@link java.io.InputStream} class
- * because this whole {@code ReaderFactory} class is useless if we can not seek in this stream.</div>
+ * because this whole {@code RewindableLineReader} class is useless if we can not seek in this stream.</div>
*/
private InputStreamAdapter input;
@@ -82,7 +82,7 @@ public final class RewindableLineReader extends LineNumberReader {
}
/**
- * Returns a reader rewinded to the beginning of data to read. This method invokes {@link #reset()} first.
+ * Returns a reader rewound to the beginning of data to read. This method invokes {@link #reset()} first.
* If that call succeed, then this method returns {@code this}. Otherwise this method returns a new reader.
* In the later case, {@code this} reader should not be used anymore.
*
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
index 5a569a6..c487f85 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
@@ -135,7 +135,7 @@ public class StorageConnector implements Serializable {
/**
* A flag for <code>{@linkplain #addView(Class, Object, Class, byte) addView}(…, view, source, flags)</code>
- * telling that before reseting the {@code view}, we need to reset the {@code source} first. This flag should
+ * telling that before resetting the {@code view}, we need to reset the {@code source} first. This flag should
* can be unset if any change in the position of {@code view} is immediately reflected in the position of
* {@code source}, and vice-versa.
*
@@ -145,7 +145,7 @@ public class StorageConnector implements Serializable {
/**
* A flag for <code>{@linkplain #addView(Class, Object, Class, byte) addView}(…, view, source, flags)</code>
- * telling that {@code view} can not be reseted, so it should be set to {@code null} instead. This implies
+ * telling that {@code view} can not be reset, so it should be set to {@code null} instead. This implies
* that a new view of the same type will be recreated next time it will be requested.
*
* <p>When this flag is set, the {@link #CASCADE_ON_RESET} should usually be set at the same time.</p>
@@ -794,7 +794,7 @@ public class StorageConnector implements Serializable {
}
/*
* Verify if the cache contains an instance created by a previous invocation of this method.
- * Note that InputStream may need to be reseted if it has been used indirectly by other kind
+ * Note that InputStream may need to be reset if it has been used indirectly by other kind
* of stream (for example a java.io.Reader). Example:
*
* 1) The storage specified at construction time is a java.nio.file.Path.
@@ -810,7 +810,7 @@ public class StorageConnector implements Serializable {
}
/*
* If the storage is already an instance of the requested type, returns the storage as-is.
- * We check if the storage needs to be reseted in the same way than in getStorage() method.
+ * We check if the storage needs to be reset in the same way than in getStorage() method.
* As a special case, we ensure that InputStream and Reader can be marked.
*/
if (type.isInstance(storage)) {
@@ -886,7 +886,7 @@ public class StorageConnector implements Serializable {
* <div class="note"><b>Rational:</b>
* {@link DataStoreProvider#probeContent(StorageConnector)} contract requires that implementers reset the
* input stream themselves. However if {@link ChannelDataInput} or {@link InputStreamReader} has been used,
- * then the user performed a call to {@link ChannelDataInput#reset()} (for instance), which did not reseted
+ * then the user performed a call to {@link ChannelDataInput#reset()} (for instance), which did not reset
* the underlying input stream. So we need to perform the missing {@link InputStream#reset()} here, then
* synchronize the {@code ChannelDataInput} position accordingly.</div>
*
@@ -914,7 +914,7 @@ public class StorageConnector implements Serializable {
/**
* Resets the root {@link #storage} object.
*
- * @throws DataStoreException if the storage can not be reseted.
+ * @throws DataStoreException if the storage can not be reset.
*/
private void reset() throws DataStoreException {
if (views != null && !views.isEmpty() && !reset(views.get(null))) {
diff --git a/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreProviderTest.java b/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreProviderTest.java
index ebf2875..f2a4d5e 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreProviderTest.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreProviderTest.java
@@ -87,7 +87,7 @@ public final strictfp class DataStoreProviderTest extends TestCase {
public void testProbeWithByteBuffer() throws DataStoreException {
/*
* Change the buffer position for simulating a read operation
- * without reseting the buffer position.
+ * without resetting the buffer position.
*/
final StorageConnector connector = StorageConnectorTest.create(false);
assertEquals(provider.probeContent(connector, ByteBuffer.class, buffer -> {
diff --git a/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java b/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java
index 613143c..8231ead 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java
@@ -227,7 +227,7 @@ public final strictfp class StorageConnectorTest extends TestCase {
data.readFully(sample);
/*
* Request again the InputStream and read the same amount of bytes than above. The intent of this test
- * is to verify that StorageConnector has reseted the InputStream position before to return it.
+ * is to verify that StorageConnector has reset the InputStream position before to return it.
* Note that this test requires InputStream implementations supporting mark/reset operations
* (which is the case when the resource is an ordinary file, not an entry inside a JAR file),
* otherwise the call to connector.getStorageAs(…) throws a DataStoreException.
@@ -236,7 +236,7 @@ public final strictfp class StorageConnectorTest extends TestCase {
assertSame(in, connector.getStorageAs(InputStream.class));
final byte[] actual = new byte[sample.length];
assertEquals("Should read all requested bytes.", actual.length, in.read(actual));
- assertArrayEquals("InputStream shall be reseted to the beginning of the stream.", sample, actual);
+ assertArrayEquals("InputStream shall be reset to the beginning of the stream.", sample, actual);
connector.closeAllExcept(null);
}
diff --git a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
index 91bb80e..2a7b7ac 100644
--- a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
+++ b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
@@ -259,11 +259,11 @@ public abstract class StaxDataStore extends URIDataStore {
}
/**
- * Resets the stream position to the mark created at construction time, then marks again the stream
- * for allowing future resets.
+ * Resets the stream position to the mark created at construction time,
+ * then marks again the stream for allowing future resets.
*
* @return {@code true} of success, or {@code false} if the stream can not be reset.
- * @throws IOException if an error occurred while reseting the stream.
+ * @throws IOException if an error occurred while resetting the stream.
*/
private boolean reset() throws IOException {
if (streamPosition >= 0) try {