Code cleanups
This commit is contained in:
parent
93c1078268
commit
e83a513fed
@ -48,8 +48,7 @@ public final class DeviceId implements Serializable
|
||||
* The device descriptor. Must not be null.
|
||||
*/
|
||||
public DeviceId(final int busNumber, final int deviceAddress,
|
||||
int portNumber,
|
||||
final SimpleUsbDeviceDescriptor deviceDescriptor)
|
||||
final int portNumber, final SimpleUsbDeviceDescriptor deviceDescriptor)
|
||||
{
|
||||
if (deviceDescriptor == null)
|
||||
throw new IllegalArgumentException("deviceDescriptor must be set");
|
||||
@ -71,7 +70,7 @@ public final class DeviceId implements Serializable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public boolean equals(final Object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
|
||||
@ -146,7 +146,7 @@ public final class Usb4JavaConfiguration implements UsbConfiguration
|
||||
}
|
||||
|
||||
@Override
|
||||
public Usb4JavaInterface getUsbInterface(byte number)
|
||||
public Usb4JavaInterface getUsbInterface(final byte number)
|
||||
{
|
||||
return this.activeSettings.get(number & 0xff);
|
||||
}
|
||||
@ -177,7 +177,7 @@ public final class Usb4JavaConfiguration implements UsbConfiguration
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsUsbInterface(byte number)
|
||||
public boolean containsUsbInterface(final byte number)
|
||||
{
|
||||
return this.activeSettings.containsKey(number & 0xff);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public boolean equals(final Object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
@ -355,13 +355,13 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public Usb4JavaConfiguration getUsbConfiguration(byte number)
|
||||
public Usb4JavaConfiguration getUsbConfiguration(final byte number)
|
||||
{
|
||||
return this.configMapping.get(number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsUsbConfiguration(byte number)
|
||||
public boolean containsUsbConfiguration(final byte number)
|
||||
{
|
||||
return this.configMapping.containsKey(number);
|
||||
}
|
||||
@ -500,7 +500,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public UsbStringDescriptor getUsbStringDescriptor(byte index)
|
||||
public UsbStringDescriptor getUsbStringDescriptor(final byte index)
|
||||
throws UsbException
|
||||
{
|
||||
checkConnected();
|
||||
@ -517,7 +517,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString(byte index) throws UsbException,
|
||||
public String getString(final byte index) throws UsbException,
|
||||
UnsupportedEncodingException
|
||||
{
|
||||
return getUsbStringDescriptor(index).getString();
|
||||
@ -550,7 +550,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncSubmit(UsbControlIrp irp) throws UsbException
|
||||
public void syncSubmit(final UsbControlIrp irp) throws UsbException
|
||||
{
|
||||
if (irp == null)
|
||||
throw new IllegalArgumentException("irp must not be null");
|
||||
@ -561,7 +561,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public void asyncSubmit(UsbControlIrp irp)
|
||||
public void asyncSubmit(final UsbControlIrp irp)
|
||||
{
|
||||
if (irp == null)
|
||||
throw new IllegalArgumentException("irp must not be null");
|
||||
@ -570,7 +570,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncSubmit(List list) throws UsbException
|
||||
public void syncSubmit(final List list) throws UsbException
|
||||
{
|
||||
if (list == null)
|
||||
throw new IllegalArgumentException("list must not be null");
|
||||
@ -585,7 +585,7 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public void asyncSubmit(List list)
|
||||
public void asyncSubmit(final List list)
|
||||
{
|
||||
if (list == null)
|
||||
throw new IllegalArgumentException("list must not be null");
|
||||
@ -600,21 +600,21 @@ public class Usb4JavaDevice implements UsbDevice
|
||||
}
|
||||
|
||||
@Override
|
||||
public UsbControlIrp createUsbControlIrp(byte bmRequestType, byte bRequest,
|
||||
short wValue, short wIndex)
|
||||
public UsbControlIrp createUsbControlIrp(final byte bmRequestType,
|
||||
final byte bRequest, final short wValue, final short wIndex)
|
||||
{
|
||||
return new DefaultUsbControlIrp(bmRequestType, bRequest, wValue,
|
||||
wIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUsbDeviceListener(UsbDeviceListener listener)
|
||||
public void addUsbDeviceListener(final UsbDeviceListener listener)
|
||||
{
|
||||
this.listeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUsbDeviceListener(UsbDeviceListener listener)
|
||||
public void removeUsbDeviceListener(final UsbDeviceListener listener)
|
||||
{
|
||||
this.listeners.remove(listener);
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public final class Usb4JavaHub extends Usb4JavaDevice implements UsbHub,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public boolean equals(final Object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
|
||||
@ -270,7 +270,7 @@ public final class UsbDeviceManager
|
||||
* @param device
|
||||
* The device to release. Must not be null.
|
||||
*/
|
||||
public void releaseDevice(Device device)
|
||||
public void releaseDevice(final Device device)
|
||||
{
|
||||
if (device == null)
|
||||
throw new IllegalArgumentException("device must be set");
|
||||
|
||||
@ -581,7 +581,7 @@ public final class LibUSB
|
||||
* Whether to unref the devices in the list.
|
||||
*/
|
||||
public static native void freeDeviceList(final DeviceList list,
|
||||
boolean unrefDevices);
|
||||
final boolean unrefDevices);
|
||||
|
||||
/**
|
||||
* Get the number of the bus that a device is connected to.
|
||||
@ -615,7 +615,7 @@ public final class LibUSB
|
||||
* array is too small
|
||||
*/
|
||||
public static native int getPortPath(final Context context,
|
||||
final Device device, byte[] path);
|
||||
final Device device, final byte[] path);
|
||||
|
||||
/**
|
||||
* Get the the parent from the specified device [EXPERIMENTAL].
|
||||
@ -671,7 +671,7 @@ public final class LibUSB
|
||||
* does not exist {@link #ERROR_OTHER} on other failure
|
||||
*/
|
||||
public static native int getMaxPacketSize(final Device device,
|
||||
int endpoint);
|
||||
final int endpoint);
|
||||
|
||||
/**
|
||||
* Calculate the maximum packet size which a specific endpoint is capable
|
||||
@ -702,7 +702,7 @@ public final class LibUSB
|
||||
* {@link #ERROR_OTHER} on other failure.
|
||||
*/
|
||||
public static native int getMaxIsoPacketSize(final Device device,
|
||||
int endpoint);
|
||||
final int endpoint);
|
||||
|
||||
/**
|
||||
* Increment the reference count of a device.
|
||||
@ -940,7 +940,7 @@ public final class LibUSB
|
||||
* another ERROR code on other failure
|
||||
*/
|
||||
public static native int setInterfaceAltSetting(final DeviceHandle handle,
|
||||
int interfaceNumber, int alternateSetting);
|
||||
final int interfaceNumber, final int alternateSetting);
|
||||
|
||||
/**
|
||||
* Clear the halt/stall condition for an endpoint.
|
||||
@ -961,7 +961,8 @@ public final class LibUSB
|
||||
* exist, {@link #ERROR_NO_DEVICE} if the device has been
|
||||
* disconnected, another ERROR code on other failure.
|
||||
*/
|
||||
public static native int clearHalt(final DeviceHandle handle, int endpoint);
|
||||
public static native int clearHalt(final DeviceHandle handle,
|
||||
final int endpoint);
|
||||
|
||||
/**
|
||||
* Perform a USB port reset to reinitialize a device.
|
||||
@ -1323,7 +1324,7 @@ public final class LibUSB
|
||||
*/
|
||||
public static native int controlTransfer(final DeviceHandle handle,
|
||||
final int bmRequestType, final int bRequest, final int wValue,
|
||||
int wIndex, final ByteBuffer data, final int timeout);
|
||||
final int wIndex, final ByteBuffer data, final int timeout);
|
||||
|
||||
/**
|
||||
* Perform a USB bulk transfer.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user