Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The CopyStreamAdapter.bytesTransferred(CopyStreamEvent event) method unpacks the event in order to pass the parameters to bytesTransferred(long, int, long) method which creates a new event and propagates it to the listeners.
This means that the original event source is lost, and there is an unnecessary event creation.
It seems wrong for the bytesTransferred(long, int, long) method to create a CopyStreamEvent - the interface Javadoc specifically says that the bytesTransferred(long, int, long) method was added to avoid the need to create the event.
It would make more sense if the adapter handled the methods independently, i.e. if the caller provides an event, pass that on, otherwise pass on the individual parameters to the listeners.