changeset 9135:39e562959313

6474807: (smartcardio) CardTerminal.connect() throws CardException instead of CardNotPresentException Reviewed-by: valeriep
author igerasim
date Thu, 20 Apr 2017 04:25:30 +0100
parents 28c5423c145d
children 06fe19e58f81
files src/share/classes/sun/security/smartcardio/TerminalImpl.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/smartcardio/TerminalImpl.java	Thu Feb 16 19:27:01 2017 +0100
+++ b/src/share/classes/sun/security/smartcardio/TerminalImpl.java	Thu Apr 20 04:25:30 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, 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
@@ -75,10 +75,10 @@
             }
         }
         try {
-            card =  new CardImpl(this, protocol);
+            card = new CardImpl(this, protocol);
             return card;
         } catch (PCSCException e) {
-            if (e.code == SCARD_W_REMOVED_CARD) {
+            if (e.code == SCARD_W_REMOVED_CARD || e.code == SCARD_E_NO_SMARTCARD) {
                 throw new CardNotPresentException("No card present", e);
             } else {
                 throw new CardException("connect() failed", e);