changeset 8492:e2424356a2db

8169026: Handle smartcard clean up better Reviewed-by: valeriep, ahgross
author igerasim
date Fri, 18 Nov 2016 12:25:10 +0300
parents 2e006a4f7b59
children 1e8c81651888
files src/share/classes/sun/security/smartcardio/CardImpl.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/smartcardio/CardImpl.java	Sat May 13 18:25:28 2017 -0700
+++ b/src/share/classes/sun/security/smartcardio/CardImpl.java	Fri Nov 18 12:25:10 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -284,13 +284,14 @@
     }
 
     public String toString() {
-        return "PC/SC card in " + terminal.getName()
+        return "PC/SC card in " + terminal.name
             + ", protocol " + getProtocol() + ", state " + state;
     }
 
     protected void finalize() throws Throwable {
         try {
             if (state == State.OK) {
+                state = State.DISCONNECTED;
                 SCardDisconnect(cardId, SCARD_LEAVE_CARD);
             }
         } finally {