changeset 67:f87ca4482faf

8067434: UART read wrong return value in JavaME Summary: corrected value returned from read() called from event processing thread Reviewed-by: snazarki Contributed-by: alexey.mironov@oracle.com
author snazarki
date Tue, 16 Dec 2014 13:51:58 +0400
parents 5528dd55f222
children 35a49b03d773
files src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Mon Dec 15 15:37:13 2014 +0400
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Dec 16 13:51:58 2014 +0400
@@ -671,7 +671,6 @@
                         the user calls read() from the event callback,
                         exit immediatelly
                      */
-                    ret = readRes;
                 }else{
                     /*
                         start asynch read with timer
@@ -686,9 +685,9 @@
                             }
                         } //synch
                         stopReading();
-                        ret = dst.position() - ret;
                     }
                 }// else if isDispatchThread()
+                ret = dst.position() - ret;
             }//if(dst.hasRemaining())
         }//synch handle
         return ret==0?-1:ret;