From 702718aaadf90ffd00534c96f729bdef23efe91d Mon Sep 17 00:00:00 2001 From: igerasim Date: Wed, 31 Aug 2016 11:19:11 +0300 Subject: [PATCH] 6474807: (smartcardio) CardTerminal.connect() throws CardException instead of CardNotPresentException Reviewed-by: valeriep --- .../classes/sun/security/smartcardio/TerminalImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/share/classes/sun/security/smartcardio/TerminalImpl.java b/src/share/classes/sun/security/smartcardio/TerminalImpl.java index de1410f3e..604fac30c 100644 --- a/src/share/classes/sun/security/smartcardio/TerminalImpl.java +++ b/src/share/classes/sun/security/smartcardio/TerminalImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, 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 @@ final class TerminalImpl extends CardTerminal { } } 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); -- GitLab