changeset 82:7016cd2773b3

8069051: IAE at DeviceManager.register if name and properties are NULL Summary: Exception is caught and considered as legal Reviewed-by: raimandi
author snazarki
date Thu, 15 Jan 2015 19:28:50 +0400
parents 5c8f58479d59
children d890b3e2738e
files src/share/classes/jdk/dio/DeviceManager.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/DeviceManager.java	Thu Jan 15 19:10:10 2015 +0400
+++ b/src/share/classes/jdk/dio/DeviceManager.java	Thu Jan 15 19:28:50 2015 +0400
@@ -925,18 +925,19 @@
                         continue;
                     } while (true);
 
-                    while (null != name || null != properties) {
+                    do {
                         try {
                             Device p = open(name, intf, properties);
                             p.close();
-                        } catch (DeviceNotFoundException pnfe2) {
-                            // this is the only right way to continue
+                        } catch (DeviceNotFoundException | IllegalArgumentException e1) {
+                            // this is the only right way to continue.
+                            // catch IAE to avoid duplicate of name/properties verification
                             break;
                         } catch (UnavailableDeviceException pnae2) {}
                         throw new DeviceAlreadyExistsException(
                             ExceptionMessage.format(ExceptionMessage.DEVICE_ALREADY_EXISTING_CONFIG)
                         );
-                    }
+                    } while(false);
 
                     try {
                         Device p = open(intf, config);