changeset 240:810d9321e203

8133663: jdk.dio.RegistrationEvent(String,DeviceDescriptor) throws CCE unexpectedly Summary: Return initiator insteed descriptoor in getInitiator() Reviewed-by: snazarki Contributed-by: olga.milovskaya@oracle.com
author snazarki
date Fri, 14 Aug 2015 18:42:21 +0300
parents cbfff74807d5
children 93bbb462fa84
files src/share/classes/jdk/dio/RegistrationEvent.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/RegistrationEvent.java	Fri Aug 14 18:41:06 2015 +0300
+++ b/src/share/classes/jdk/dio/RegistrationEvent.java	Fri Aug 14 18:42:21 2015 +0300
@@ -43,6 +43,7 @@
      * unregistration; or {@code null} if none is defined.
      */
     private DeviceDescriptor<P> descriptor;
+    private String initiator;
 
     /**
      * Creates a new {@link RegistrationEvent} with the specified device descriptor and
@@ -60,6 +61,7 @@
     public RegistrationEvent(String initiator, DeviceDescriptor<P> descriptor) {
         super(descriptor);
         this.descriptor = descriptor;
+        this.initiator  = initiator;
     }
 
     /**
@@ -92,6 +94,6 @@
      * @return a {@code String} name identifying the initiator; or {@code null} if none is defined.
      */
     public String getInitiator() {
-        return (String) getSource();
+        return initiator;
     }
 }
\ No newline at end of file