changeset 54:df4b6e40bed1

8065877: Instead of DeviceNotFoundException, UnsupportedDeviceTypeException is thrown when calling DeviceManager.open Summary: This is update for previous commit (http://hg.openjdk.java.net/dio/dev/rev/8a38ebab04a0) that was merged incorrectly. Reviewed-by: snazarki Contributed-by: alexey.mironov@oracle.com
author snazarki
date Tue, 25 Nov 2014 18:22:59 +0400
parents 8a38ebab04a0
children fdf76602f5b7
files src/share/classes/jdk/dio/DeviceManager.java
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/DeviceManager.java	Mon Nov 24 20:28:14 2014 +0400
+++ b/src/share/classes/jdk/dio/DeviceManager.java	Tue Nov 25 18:22:59 2014 +0400
@@ -438,13 +438,12 @@
         }
         DeviceDescriptor<P> descr = Registry.getInstance().get(id);
         if (null == descr) {
-            // checks if device type is from installed driver
-            getFactory(intf);
             throw new DeviceNotFoundException(
                 ExceptionMessage.format(ExceptionMessage.DEVICE_NOT_FOUND, String.valueOf(id))
             );
         }
         if (!intf.isAssignableFrom(descr.getInterface())) {
+            getFactory(intf);
             throw new DeviceNotFoundException(
                 ExceptionMessage.format(ExceptionMessage.DEVICE_HAS_DIFFERENT_TYPE, id, descr.getInterface())
             );