Skip to content

Commit

Permalink
Suppress compiler warning (#105)
Browse files Browse the repository at this point in the history
* Suppress compiler warning
* Fix more warnings :)
* Fix transitive module warnings
  • Loading branch information
tresf authored Aug 5, 2021
1 parent 135350e commit 8a7148b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/cpp/_nix_based/jssc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_writeBytes
/**
* Waits until 'read()' has something to tell for the specified filedescriptor.
*/
static void awaitReadReady(JNIEnv*env, jlong fd){
static void awaitReadReady(JNIEnv*, jlong fd){
#if HAVE_POLL == 0
// Alternative impl using 'select' as 'poll' isn't available (or broken).

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jssc/DefaultJniExtractorStub.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DefaultJniExtractorStub extends DefaultJniExtractor {
/**
* Default constructor
*/
public DefaultJniExtractorStub(Class libraryJarClass) throws IOException {
public DefaultJniExtractorStub(Class<?> libraryJarClass) throws IOException {
super(libraryJarClass);
}

Expand All @@ -33,7 +33,7 @@ public DefaultJniExtractorStub(Class libraryJarClass) throws IOException {
* NativeLoader.loadLibrary("mylibrary");
* </code>
*/
public DefaultJniExtractorStub(Class libraryJarClass, String bootPath) throws IOException {
public DefaultJniExtractorStub(Class<?> libraryJarClass, String bootPath) throws IOException {
this(libraryJarClass);

if(bootPath != null) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jssc/SerialNativeInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ else if(osName.equals("Mac OS X") || osName.equals("Darwin"))
}
}

/**
* Default constructor
* TODO: This class is effectively static, why instantiate it?
*/
public SerialNativeInterface() {}

/**
* Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS)
*
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jssc/SerialPortList.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public class SerialPortList {
private static final Pattern PORTNAMES_REGEXP;
private static final String PORTNAMES_PATH;

/**
* Default constructor
* private: no constructor available
*/
private SerialPortList() {}

static {
serialInterface = new SerialNativeInterface();
switch (SerialNativeInterface.getOsType()) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/module-info/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" })
open module jssc {
requires org.scijava.nativelib;
requires transitive org.scijava.nativelib;
exports jssc;
}

0 comments on commit 8a7148b

Please sign in to comment.