mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Spelling and grammar cleanups (#4849)
This commit is contained in:
@@ -21,7 +21,7 @@ public final class RuntimeLoader<T> {
|
||||
private static String defaultExtractionRoot;
|
||||
|
||||
/**
|
||||
* Gets the default extration root location (~/.wpilib/nativecache).
|
||||
* Gets the default extraction root location (~/.wpilib/nativecache).
|
||||
*
|
||||
* @return The default extraction root location.
|
||||
*/
|
||||
@@ -87,20 +87,20 @@ public final class RuntimeLoader<T> {
|
||||
} catch (UnsatisfiedLinkError ule) {
|
||||
// Then load the hash from the resources
|
||||
String hashName = RuntimeDetector.getHashLibraryResource(m_libraryName);
|
||||
String resname = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String resName = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
try (InputStream hashIs = m_loadClass.getResourceAsStream(hashName)) {
|
||||
if (hashIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
try (Scanner scanner = new Scanner(hashIs, StandardCharsets.UTF_8.name())) {
|
||||
String hash = scanner.nextLine();
|
||||
File jniLibrary = new File(m_extractionRoot, resname + "." + hash);
|
||||
File jniLibrary = new File(m_extractionRoot, resName + "." + hash);
|
||||
try {
|
||||
// Try to load from an already extracted hash
|
||||
System.load(jniLibrary.getAbsolutePath());
|
||||
} catch (UnsatisfiedLinkError ule2) {
|
||||
// If extraction failed, extract
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
@@ -137,9 +137,9 @@ public final class RuntimeLoader<T> {
|
||||
System.loadLibrary(m_libraryName);
|
||||
} catch (UnsatisfiedLinkError ule) {
|
||||
// Then load the hash from the input file
|
||||
String resname = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String resName = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String hash;
|
||||
try (InputStream is = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream is = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (is == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
@@ -165,13 +165,13 @@ public final class RuntimeLoader<T> {
|
||||
if (hash == null) {
|
||||
throw new IOException("Weird Hash?");
|
||||
}
|
||||
File jniLibrary = new File(m_extractionRoot, resname + "." + hash);
|
||||
File jniLibrary = new File(m_extractionRoot, resName + "." + hash);
|
||||
try {
|
||||
// Try to load from an already extracted hash
|
||||
System.load(jniLibrary.getAbsolutePath());
|
||||
} catch (UnsatisfiedLinkError ule2) {
|
||||
// If extraction failed, extract
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class WPIUtilJNI {
|
||||
public static native boolean releaseSemaphore(int semHandle, int releaseCount);
|
||||
|
||||
/**
|
||||
* Waits for an handle to be signaled.
|
||||
* Waits for a handle to be signaled.
|
||||
*
|
||||
* @param handle handle to wait on
|
||||
* @throws InterruptedException on failure (e.g. object was destroyed)
|
||||
@@ -89,7 +89,7 @@ public class WPIUtilJNI {
|
||||
public static native void waitForObject(int handle) throws InterruptedException;
|
||||
|
||||
/**
|
||||
* Waits for an handle to be signaled, with timeout.
|
||||
* Waits for a handle to be signaled, with timeout.
|
||||
*
|
||||
* @param handle handle to wait on
|
||||
* @param timeout timeout in seconds
|
||||
|
||||
@@ -18,7 +18,7 @@ public final class Semaphore implements AutoCloseable {
|
||||
* Constructor.
|
||||
*
|
||||
* @param initialCount initial value for the semaphore's internal counter
|
||||
* @param maximumCount maximum value for the samephore's internal counter
|
||||
* @param maximumCount maximum value for the semaphore's internal counter
|
||||
*/
|
||||
public Semaphore(int initialCount, int maximumCount) {
|
||||
m_handle = WPIUtilJNI.createSemaphore(initialCount, maximumCount);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BooleanArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(boolean[] value, long timestamp) {
|
||||
m_log.appendBooleanArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BooleanLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(boolean value, long timestamp) {
|
||||
m_log.appendBoolean(m_entry, value, timestamp);
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class DataLog implements AutoCloseable {
|
||||
* @param name Name
|
||||
* @param type Data type
|
||||
* @param metadata Initial metadata (e.g. data properties)
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
* @return Entry index
|
||||
*/
|
||||
public int start(String name, String type, String metadata, long timestamp) {
|
||||
@@ -151,7 +151,7 @@ public final class DataLog implements AutoCloseable {
|
||||
* Finish an entry.
|
||||
*
|
||||
* @param entry Entry index
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void finish(int entry, long timestamp) {
|
||||
DataLogJNI.finish(m_impl, entry, timestamp);
|
||||
@@ -171,7 +171,7 @@ public final class DataLog implements AutoCloseable {
|
||||
*
|
||||
* @param entry Entry index
|
||||
* @param metadata New metadata for the entry
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void setMetadata(int entry, String metadata, long timestamp) {
|
||||
DataLogJNI.setMetadata(m_impl, entry, metadata, timestamp);
|
||||
@@ -192,7 +192,7 @@ public final class DataLog implements AutoCloseable {
|
||||
*
|
||||
* @param entry Entry index, as returned by Start()
|
||||
* @param data Data to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void appendRaw(int entry, byte[] data, long timestamp) {
|
||||
DataLogJNI.appendRaw(m_impl, entry, data, timestamp);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DataLogEntry {
|
||||
* Updates the metadata for the entry.
|
||||
*
|
||||
* @param metadata New metadata for the entry
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void setMetadata(String metadata, long timestamp) {
|
||||
m_log.setMetadata(m_entry, metadata, timestamp);
|
||||
@@ -41,7 +41,7 @@ public class DataLogEntry {
|
||||
/**
|
||||
* Finishes the entry.
|
||||
*
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void finish(long timestamp) {
|
||||
m_log.finish(m_entry, timestamp);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DataLogReader implements Iterable<DataLogRecord> {
|
||||
* Constructs from a file.
|
||||
*
|
||||
* @param filename filename
|
||||
* @throws IOException if could not open/read file
|
||||
* @throws IOException if unable to open/read file
|
||||
*/
|
||||
public DataLogReader(String filename) throws IOException {
|
||||
RandomAccessFile f = new RandomAccessFile(filename, "r");
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DoubleArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(double[] value, long timestamp) {
|
||||
m_log.appendDoubleArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DoubleLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(double value, long timestamp) {
|
||||
m_log.appendDouble(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FloatArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(float[] value, long timestamp) {
|
||||
m_log.appendFloatArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FloatLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(float value, long timestamp) {
|
||||
m_log.appendFloat(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class IntegerArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(long[] value, long timestamp) {
|
||||
m_log.appendIntegerArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class IntegerLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(long value, long timestamp) {
|
||||
m_log.appendInteger(m_entry, value, timestamp);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RawLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(byte[] value, long timestamp) {
|
||||
m_log.appendRaw(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class StringArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(String[] value, long timestamp) {
|
||||
m_log.appendStringArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class StringLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(String value, long timestamp) {
|
||||
m_log.appendString(m_entry, value, timestamp);
|
||||
|
||||
@@ -7,7 +7,7 @@ package edu.wpi.first.util.function;
|
||||
/**
|
||||
* Represents an operation that accepts a single boolean-valued argument and returns no result. This
|
||||
* is the primitive type specialization of {@link java.util.function.Consumer} for boolean. Unlike
|
||||
* most other functional interfaces, BooleanConsumer is expected to operate via side-effects.
|
||||
* most other functional interfaces, BooleanConsumer is expected to operate via side effects.
|
||||
*
|
||||
* <p>This is a functional interface whose functional method is {@link #accept(boolean)}.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ package edu.wpi.first.util.function;
|
||||
/**
|
||||
* Represents an operation that accepts a single float-valued argument and returns no result. This
|
||||
* is the primitive type specialization of {@link java.util.function.Consumer} for float. Unlike
|
||||
* most other functional interfaces, BooleanConsumer is expected to operate via side-effects.
|
||||
* most other functional interfaces, BooleanConsumer is expected to operate via side effects.
|
||||
*
|
||||
* <p>This is a functional interface whose functional method is {@link #accept(float)}.
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface SendableBuilder extends AutoCloseable {
|
||||
void setSmartDashboardType(String type);
|
||||
|
||||
/**
|
||||
* Set a flag indicating if this sendable should be treated as an actuator. By default this flag
|
||||
* Set a flag indicating if this Sendable should be treated as an actuator. By default, this flag
|
||||
* is false.
|
||||
*
|
||||
* @param value true if actuator, false if not
|
||||
|
||||
Reference in New Issue
Block a user