changeset 223:dd3123ec4c0d

8132537: PWM: jdk.dio.RegistrationEvent(String,DeviceDescriptor) should throw IAE if descriptor is null Summary: jdk.dio.RegistrationEvent(String,DeviceDescriptor) throws IAE if descriptor is null Reviewed-by: snazarki Contributed-by: olga.milovskaya@oracle.com
author snazarki
date Wed, 29 Jul 2015 18:08:05 +0300
parents 622781a8dcaf
children 197db5731b92
files src/share/classes/jdk/dio/RegistrationEvent.java
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/RegistrationEvent.java	Wed Jul 29 18:06:45 2015 +0300
+++ b/src/share/classes/jdk/dio/RegistrationEvent.java	Wed Jul 29 18:08:05 2015 +0300
@@ -53,13 +53,11 @@
      * @param descriptor
      *            the identifying and descriptive information of the registered or unregistered
      *            device.
-     * @throws NullPointerException
+     * @throws IllegalArgumentException
      *             if {@code descriptor} is {@code null}.
      */
     public RegistrationEvent(String initiator, DeviceDescriptor<P> descriptor) {
-        super(initiator);
-        //NPE check
-        descriptor.getID();
+        super(descriptor);
         this.descriptor = descriptor;
     }
 
@@ -70,7 +68,7 @@
      * @param descriptor
      *            the identifying and descriptive information of the registered or unregistered
      *            device.
-     * @throws NullPointerException
+     * @throws IllegalArgumentException
      *             if {@code descriptor} is {@code null}.
      */
     public RegistrationEvent(DeviceDescriptor<P> descriptor) {