changeset 229:58b384244452

8133263: I2CCombinedMessage.appendRead and appendWrite do not let 0-capacity buffers and throw IAE Summary: Remove incorrect IAE in two classes: I2CCombinedMessage and UART Reviewed-by: snazarki Contributed-by: olga.milovskaya@oracle.com
author snazarki
date Tue, 11 Aug 2015 13:08:21 +0300
parents 803e5b366711
children 6dfe35ed50a8
files src/share/classes/com/oracle/dio/i2cbus/impl/I2CCombinedMessage.java src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 2 files changed, 0 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/i2cbus/impl/I2CCombinedMessage.java	Mon Aug 10 17:57:08 2015 +0300
+++ b/src/share/classes/com/oracle/dio/i2cbus/impl/I2CCombinedMessage.java	Tue Aug 11 13:08:21 2015 +0300
@@ -65,10 +65,6 @@
             );
         }
 
-        if (0 == message.buf.capacity()) {
-            throw new IllegalArgumentException(ExceptionMessage.format(ExceptionMessage.ZERO_CAPACITY_BUFFER));
-        }
-
         if (0 > message.skip) {
             throw new IllegalArgumentException(
                 ExceptionMessage.format(ExceptionMessage.I2CBUS_NEGATIVE_SKIP_ARG)
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Mon Aug 10 17:57:08 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Aug 11 13:08:21 2015 +0300
@@ -713,8 +713,6 @@
             UnavailableDeviceException, ClosedDeviceException{
         int ret;
 
-        checkBuffer(dst);
-
         if(!dst.hasRemaining()){
             ret = 0;
         }else{
@@ -762,8 +760,6 @@
     public int write(ByteBuffer src) throws IOException,
             UnavailableDeviceException, ClosedDeviceException{
 
-        checkBuffer(src);
-
         checkPowerState();
 
         int ret = 0;