Skip to content

Commit bbfa59d

Browse files
author
André Behrens (serious6)
committed
dont Override finalize() and remove deprecated code in dispose(..)
- removed code of finalize method since it will provide no benefit to be called - removed deprecated code from dispose method since it will result in possible errors
1 parent c975012 commit bbfa59d

1 file changed

Lines changed: 1 addition & 25 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/notification/StreamingSubscriptionConnection.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ public StreamingSubscriptionConnection(ExchangeService service,
243243
Iterable<StreamingSubscription> subscriptions, int lifetime)
244244
throws Exception {
245245
this(service, lifetime);
246-
EwsUtilities.validateParamCollection(subscriptions.iterator(),
247-
"subscriptions");
246+
EwsUtilities.validateParamCollection(subscriptions.iterator(), "subscriptions");
248247
for (StreamingSubscription subscription : subscriptions) {
249248
this.subscriptions.put(subscription.getId(), subscription);
250249
}
@@ -527,33 +526,10 @@ private void issueNotificationEvents(GetStreamingEventsResponse gseResponse) {
527526
}
528527
}
529528

530-
/**
531-
* Finalizes an instance of the StreamingSubscriptionConnection class.
532-
*/
533-
@Override
534-
protected void finalize() throws Throwable {
535-
this.dispose(false);
536-
}
537-
538529
/**
539530
* Frees resources associated with this StreamingSubscriptionConnection.
540531
*/
541532
public void dispose() {
542-
this.dispose(true);
543-
}
544-
545-
/**
546-
* Performs application-defined tasks associated with freeing, releasing, or
547-
* resetting unmanaged resources.
548-
*
549-
* @param suppressFinalizer Value indicating whether to suppress the garbage collector's
550-
* finalizer.
551-
*/
552-
private void dispose(boolean suppressFinalizer) {
553-
if (suppressFinalizer) {
554-
System.runFinalizersOnExit(false);
555-
}
556-
557533
synchronized (this) {
558534
if (!this.isDisposed) {
559535
if (this.currentHangingRequest != null) {

0 commit comments

Comments
 (0)