changeset 234:8a3ef39ecad5

8133556: api/jdk/dio/spi/typeChecks/index.html#SPI fails Summary: Forced to throw DNFE in case of ANY unchecked exception and NULL as providers config/device types Reviewed-by: alkonsta
author snazarki
date Thu, 13 Aug 2015 17:49:28 +0300
parents 84fdd208a6cd
children 5ba9c2a51405
files src/share/classes/jdk/dio/DeviceManager.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/DeviceManager.java	Thu Aug 13 12:59:51 2015 +0300
+++ b/src/share/classes/jdk/dio/DeviceManager.java	Thu Aug 13 17:49:28 2015 +0300
@@ -1168,7 +1168,6 @@
 
             while (iter.hasNext()) {
                 DeviceProvider provider = iter.next();
-
                 try {
                     if (provider.getConfigType().isAssignableFrom(config.getClass()) &&
                         (null == type || provider.getType().isAssignableFrom(type))) {
@@ -1189,6 +1188,12 @@
                 } catch (Throwable  e3) {
                     Logging.reportError("Provider " + provider + " throws " + e3);
                     // try other driver.
+                    // spec quotation:
+                    // A compliant implementation of the DeviceManager specification MUST catch undeclared unchecked exceptions,
+                    // unexpected values (such as null) or mismatching value types that may be thrown
+                    // or respectively returned at any of these steps
+                    // and MUST report these conditions to the caller as a DeviceNotFoundException.
+                    found = true;
                     continue;
                 }
             }