Skip to content

Commit e39d186

Browse files
committed
fix a number of spelling/grammar issues
1 parent 043524d commit e39d186

20 files changed

+37
-32
lines changed

core/src/main/java/tel/schich/javacan/AbstractCanChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected long readSocket(ByteBuffer buffer) throws IOException {
224224
* @see <a href="https://man7.org/linux/man-pages/man2/recv.2.html">recv man page</a>
225225
* @param buffer the buffer to receive into
226226
* @param flags flags to pass to the underlying recv syscall
227-
* @return The number of bytes receive from the socket
227+
* @return The number of bytes received from the socket
228228
* @throws IOException if the native call fails
229229
*/
230230
protected long receiveFromSocket(ByteBuffer buffer, int flags) throws IOException {

core/src/main/java/tel/schich/javacan/BcmCanChannel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class BcmCanChannel extends AbstractCanChannel {
5050
* the buffer is large enough (~ 18 kB) for all use cases.
5151
*/
5252
public static final int MTU = BcmMessage.HEADER_LENGTH + MAX_FRAMES_PER_MESSAGE * RawCanChannel.FD_MTU;
53+
5354
@Nullable
5455
private NetworkDevice device;
5556

core/src/main/java/tel/schich/javacan/BcmFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* The BcmFlag enum represent the Broadcast Manager message flags. When sending a message to the
30-
* broadcast manager the ‘flags’ element influence the behavior.
30+
* broadcast manager, the ‘flags’ element influences the behavior.
3131
*
3232
* @see <a href="https://www.kernel.org/doc/html/latest/networking/can.html#broadcast-manager-message-flags">
3333
* Kernel CAN documentation: BCM message flags</a>

core/src/main/java/tel/schich/javacan/BcmMessage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*/
4747
public class BcmMessage {
4848
/**
49-
* The platform dependent byte count for {@code struct bcm_msg_head} from {@code linux/can/bcm.h}
49+
* The platform-dependent byte count for {@code struct bcm_msg_head} from {@code linux/can/bcm.h}
5050
*/
5151
public static final int HEADER_LENGTH;
5252
/**
@@ -110,7 +110,7 @@ public class BcmMessage {
110110

111111
/**
112112
* Create a BCM message from the given {@link ByteBuffer} expecting a valid BCM message at the
113-
* buffer's position and a correct amount of remaining bytes.
113+
* buffer's position and a correct number of remaining bytes.
114114
*
115115
* @param buffer the backing buffer for the message
116116
*/
@@ -206,7 +206,7 @@ public int getCount() {
206206
* <ul>
207207
* <li><strong>When used with {@link BcmOpcode#TX_SETUP}</strong>:<br>
208208
* The broadcast manager sends {@link #getCount()} messages with this interval, then continues to
209-
* send at {@link #getInterval2()}. If only one timer is needed set
209+
* send at {@link #getInterval2()}. If only one timer is needed, set
210210
* {@link BcmMessage.Builder#count(int) count} to {@code 0} and {@link BcmMessage.Builder#interval1(Duration)} to {@code null}.</li>
211211
* <li><strong>When used with {@link BcmOpcode#RX_SETUP}</strong>:<br>
212212
* Send {@link BcmOpcode#RX_TIMEOUT} when a received message is not received again within the given

core/src/main/java/tel/schich/javacan/BcmOpcode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
*/
3535
public enum BcmOpcode {
3636
/**
37-
* Create (cyclic) transmission task.
37+
* Create a (cyclic) transmission task.
3838
*/
3939
TX_SETUP(1),
4040

4141
/**
42-
* Remove (cyclic) transmission task.
42+
* Remove a (cyclic) transmission task.
4343
*/
4444
TX_DELETE(2),
4545

core/src/main/java/tel/schich/javacan/CanChannels.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
/**
2828
* This utility class provides helper methods to easily create new channels similar to those in
2929
* {@link java.nio.file.Files} and {@link java.nio.channels.Channels}.
30-
* implementation.
3130
*/
3231
public class CanChannels {
3332

core/src/main/java/tel/schich/javacan/CanFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class CanFilter {
6060
private final int mask;
6161

6262
/**
63-
* Creates a filter to exactly matches the given ID.
63+
* Creates a filter to exactly match the given ID.
6464
*
6565
* @param id the CAN ID to match
6666
*/
@@ -89,7 +89,7 @@ public int getId() {
8989
}
9090

9191
/**
92-
* Gets the mask to used to match the CAN ID.
92+
* Gets the mask to be used to match the CAN ID.
9393
*
9494
* @return the mask
9595
*/

core/src/main/java/tel/schich/javacan/CanFrame.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void getData(ByteBuffer dest) {
200200
*
201201
* @param dest the destination buffer
202202
* @param offset the offset in the destination buffer
203-
* @param length the amount of bytes to write to the destination
203+
* @param length the number of bytes to write to the destination
204204
*/
205205
public void getData(byte[] dest, int offset, int length) {
206206
this.buffer.position(getDataOffset());
@@ -347,7 +347,7 @@ public static CanFrame create(int id, byte flags, byte[] data) {
347347
* @param flags the CAN FD flags, ignored for non-FD frames
348348
* @param data the data
349349
* @param offset the offset within data
350-
* @param length amount of bytes to use from data
350+
* @param length number of bytes to use from data
351351
* @return the newly created frame
352352
*/
353353
public static CanFrame create(int id, byte flags, byte[] data, int offset, int length) {
@@ -377,7 +377,7 @@ public static CanFrame createExtended(int id, byte flags, byte[] data) {
377377
* @param flags the CAN FD flags, ignored for non-FD frames
378378
* @param data the data
379379
* @param offset the offset within data
380-
* @param length amount of bytes to use from data
380+
* @param length number of bytes to use from data
381381
* @return the newly created frame
382382
*/
383383
public static CanFrame createExtended(int id, byte flags, byte[] data, int offset, int length) {
@@ -403,7 +403,7 @@ private static CanFrame create(int id, boolean extended, byte flags, byte[] data
403403
* @param flags the CAN FD flags, ignored for non-FD frames
404404
* @param data the data
405405
* @param offset the offset within data
406-
* @param length amount of bytes to use from data
406+
* @param length number of bytes to use from data
407407
* @return the newly created frame
408408
*/
409409
public static CanFrame createRaw(int id, byte flags, byte[] data, int offset, int length) {

core/src/main/java/tel/schich/javacan/IsotpCanChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public IsotpCanChannel(int sock) {
8181
*
8282
* @see <a href="https://man7.org/linux/man-pages/man2/read.2.html">read man page</a>
8383
* @param buffer the destination buffer
84-
* @return the amount of bytes that have been read
84+
* @return the number of bytes that have been read
8585
* @throws IOException if the native calls fail
8686
*/
8787
public abstract int read(ByteBuffer buffer) throws IOException;
@@ -93,7 +93,7 @@ public IsotpCanChannel(int sock) {
9393
*
9494
* @see <a href="https://man7.org/linux/man-pages/man2/write.2.html">write man page</a>
9595
* @param buffer the source buffer
96-
* @return the amount of bytes that have been written
96+
* @return the number of bytes that have been written
9797
* @throws IOException if the native calls fail
9898
*/
9999
public abstract int write(ByteBuffer buffer) throws IOException;

core/src/main/java/tel/schich/javacan/J1939CanChannel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public J1939CanChannel(int sock) {
8282
*
8383
* @see <a href="https://man7.org/linux/man-pages/man2/recv.2.html">read man page</a>
8484
* @param buffer the destination buffer
85-
* @return the amount of bytes that have been received
85+
* @return the number of bytes that have been received
8686
* @throws IOException if the native calls fail
8787
*/
8888
public abstract long receive(ByteBuffer buffer) throws IOException;
@@ -95,7 +95,7 @@ public J1939CanChannel(int sock) {
9595
* @see <a href="https://man7.org/linux/man-pages/man2/recvmsg.2.html">recvmsg man page</a>
9696
* @param buffer the destination buffer
9797
* @param messageHeaderBuffer the buffer to read message headers into.
98-
* @return the amount of bytes that have been read
98+
* @return the number of bytes that have been read
9999
* @throws IOException if the native calls fail
100100
*/
101101
public abstract long receive(ByteBuffer buffer, @Nullable J1939ReceiveMessageHeaderBuffer messageHeaderBuffer) throws IOException;
@@ -107,7 +107,7 @@ public J1939CanChannel(int sock) {
107107
*
108108
* @see <a href="https://man7.org/linux/man-pages/man2/send.2.html">send man page</a>
109109
* @param buffer the source buffer
110-
* @return the amount of bytes that have been sent
110+
* @return the number of bytes that have been sent
111111
* @throws IOException if the native calls fail
112112
*/
113113
public abstract long send(ByteBuffer buffer) throws IOException;
@@ -120,7 +120,7 @@ public J1939CanChannel(int sock) {
120120
* @see <a href="https://man7.org/linux/man-pages/man2/send.2.html">send man page</a>
121121
* @param buffer the source buffer
122122
* @param destination the destination address to the send the message to.
123-
* @return the amount of bytes that have been sent
123+
* @return the number of bytes that have been sent
124124
* @throws IOException if the native calls fail
125125
*/
126126
public abstract long send(ByteBuffer buffer, @Nullable J1939Address destination) throws IOException;

0 commit comments

Comments
 (0)