diff --git a/src/main/cpp/windows/jssc.cpp b/src/main/cpp/windows/jssc.cpp index 9c68d1a0d..71d53ec0e 100644 --- a/src/main/cpp/windows/jssc.cpp +++ b/src/main/cpp/windows/jssc.cpp @@ -290,7 +290,7 @@ JNIEXPORT jbyteArray JNICALL Java_jssc_SerialNativeInterface_readBytes } returnArray = env->NewByteArray(byteCount); - if( returnArray == NULL ){ goto Finally; } + if( returnArray == NULL ) goto Finally; lpBuffer = (jbyte *)malloc(byteCount * sizeof(jbyte)); if(lpBuffer == NULL){ diff --git a/src/test/java/jssc/SerialNativeInterfaceTest.java b/src/test/java/jssc/SerialNativeInterfaceTest.java index 492d4bc44..07dafde67 100644 --- a/src/test/java/jssc/SerialNativeInterfaceTest.java +++ b/src/test/java/jssc/SerialNativeInterfaceTest.java @@ -5,7 +5,6 @@ import org.junit.Before; import org.junit.Test; -import static java.lang.Integer.MAX_VALUE; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; @@ -96,7 +95,7 @@ public void throwsNpeIfPassedBufferIsNull() throws Exception { } @Test - public void throwsIaeIfCountNegative() throws Exception { + public void throwsIaeIfCountNegative() { SerialNativeInterface testTarget = new SerialNativeInterface(); byte[] ret; try{ @@ -115,13 +114,13 @@ public void throwsIaeIfCountNegative() throws Exception { +" test run will just happily wait infinitely for those 2GiB to arrive" +" at the stdin fd. Feel free to remove this test if you think it" +" doesn't make sense to have it here.") - public void throwsOOMExIfRequestTooLarge() throws Exception { + public void throwsOOMExIfRequestTooLarge() { SerialNativeInterface testTarget = new SerialNativeInterface(); try{ - byte[] ret = testTarget.readBytes(0, MAX_VALUE); + byte[] ret = testTarget.readBytes(0, Integer.MAX_VALUE); fail("Where's the exception?"); }catch( OutOfMemoryError ex ){ - assertTrue(ex.getMessage().contains(String.valueOf(MAX_VALUE))); + assertTrue(ex.getMessage().contains(String.valueOf(Integer.MAX_VALUE))); } }