changeset 55:fdf76602f5b7

8065776: UART right initial value for controller number Summary: Corrected controllerNumber and controllerName verification Reviewed-by: snazarki Contributed-by: alexey.mironov@oracle.com
author snazarki
date Mon, 01 Dec 2014 20:40:49 +0400
parents df4b6e40bed1
children 958ec7f4180f
files src/share/classes/jdk/dio/uart/UARTConfig.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/uart/UARTConfig.java	Tue Nov 25 18:22:59 2014 +0400
+++ b/src/share/classes/jdk/dio/uart/UARTConfig.java	Mon Dec 01 20:40:49 2014 +0400
@@ -140,7 +140,7 @@
     private int outputBufferSize = DEFAULT;
     private int parity;
     private int stopBits;
-    private int controllerNumber;
+    private int controllerNumber = DEFAULT;
     private int channelNumber;
 
 
@@ -344,7 +344,8 @@
 
     private void checkParameters(){
 
-        if ((null == controllerName && channelNumber < DEFAULT) ||
+        if ((null == controllerName && controllerNumber < DEFAULT) ||
+            channelNumber < DEFAULT ||
             baudRate <= 0 ||
             (dataBits < DATABITS_5 || dataBits > DATABITS_9) ||
             (parity < PARITY_NONE || parity > PARITY_SPACE) ||