Skip to content

Commit 632f53b

Browse files
committed
Minor code cleanup
1 parent 43f4192 commit 632f53b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

java-does-usb/jextract/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The known limitations are:
9696

9797
*jextract* generates a comprehensive set of methods for each function, struct, struct member etc. Most of it will not be used as a typical application just uses a subset of struct members, might only read or write them etc. So a considerable amount of code is generated. For some types, it's a bit excessive.
9898

99-
The worst example is [`IOUSBInterfaceStruct190`](https://github.com/manuelbl/JavaDoesUSB/blob/main/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceStruct190.java) (macOS). This is a `struct` consisting of about 50 member functions. It's basically a vtable of a C++ class. For this single `struct`, *jextract* generates codes resulting in 70 class files with a total size of 227kByte..
99+
The worst example is [`IOUSBInterfaceStruct190`](https://github.com/manuelbl/JavaDoesUSB/blob/main/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceStruct190.java) (macOS). This is a `struct` consisting of about 50 member functions. It's basically a vtable of a C++ class. For this single `struct`, *jextract* generates codes resulting in 70 class files with a total size of 227kByte.
100100

101101
The table below shows statistics for version 0.6.0 of the library:
102102

java-does-usb/src/main/java/net/codecrete/usb/windows/InterfaceHandle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class InterfaceHandle {
2020
/**
2121
* The number of this interface.
2222
*/
23-
int interfaceNumber;
23+
final int interfaceNumber;
2424
/**
2525
* The number of the first interface in the same composite function.
2626
*/
27-
int firstInterfaceNumber;
27+
final int firstInterfaceNumber;
2828
/**
2929
* The file handle of the device.
3030
* <p>

java-does-usb/src/test/java/net/codecrete/usb/special/LogicAnalyzer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ void checkFirmware() {
309309
void sleep(long milliseconds) {
310310
while (true) {
311311
try {
312-
Thread.sleep(milliseconds);
312+
//noinspection BusyWait
313+
Thread.sleep(milliseconds); // NOSONAR
313314
return;
314315
} catch (InterruptedException e) {
315316
// ignore and try again
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
writer = console
22
writer.format = {date: HH:mm:ss.SSS} {level|size=5} [{class|size=40}] {message}
3-
writer.level = debug
3+
writer.level = info

0 commit comments

Comments
 (0)