changeset 163:f3b2ea714446

8085970: Support native event with variable number of arguments Summary: processNativeEvent accept arbitrary number of arguments Reviewed-by: alkonsta
author snazarki
date Mon, 08 Jun 2015 15:17:30 +0300
parents 4d3bde06f8db
children b69e341f7472
files src/share/classes/com/oracle/dio/impl/AbstractPeripheral.java src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/impl/AbstractPeripheral.java	Fri Jun 05 13:36:37 2015 +0300
+++ b/src/share/classes/com/oracle/dio/impl/AbstractPeripheral.java	Mon Jun 08 15:17:30 2015 +0300
@@ -214,6 +214,6 @@
     protected void processDeviceEvent(DeviceEvent event) {
     }
 
-    protected void processNativeEvent(int type, int data) {
+    protected void processNativeEvent(int type, int... data) {
     }
 }
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Fri Jun 05 13:36:37 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Mon Jun 08 15:17:30 2015 +0300
@@ -199,7 +199,8 @@
     }
 
     @Override
-    protected void processNativeEvent(int event, int bytesProcessed) {
+    protected void processNativeEvent(int event, int... data) {
+        final int bytesProcessed = data[0];
         UARTEventListener listener = eventListeners.get(event);
         if (listener != null){
             try{