Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DF05181CF for ; Tue, 29 Sep 2015 22:59:40 +0000 (UTC) Received: (qmail 89077 invoked by uid 500); 29 Sep 2015 22:59:40 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 89010 invoked by uid 500); 29 Sep 2015 22:59:40 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 88998 invoked by uid 99); 29 Sep 2015 22:59:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2015 22:59:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 16880DFE80; Tue, 29 Sep 2015 22:59:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: drankye@apache.org To: commits@directory.apache.org Date: Tue, 29 Sep 2015 22:59:40 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] directory-kerby git commit: DIRKRB Default KDC network repeatedly reports socket timeout exception unnecessarily Repository: directory-kerby Updated Branches: refs/heads/master f9d9974b9 -> 59a6b65bb DIRKRB Default KDC network repeatedly reports socket timeout exception unnecessarily Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/3b5a4463 Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/3b5a4463 Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/3b5a4463 Branch: refs/heads/master Commit: 3b5a44638c2cfbc4ba968f82e52ace09dd6edd32 Parents: 3dd63f3 Author: Kai Zheng Authored: Wed Sep 30 06:57:42 2015 +0800 Committer: Kai Zheng Committed: Wed Sep 30 06:57:42 2015 +0800 ---------------------------------------------------------------------- docs/kerby-checkstyle.xml | 3 +++ .../kerberos/kdc/identitybackend/JsonIdentityBackend.java | 8 ++++---- .../org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java | 8 +++++--- 3 files changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3b5a4463/docs/kerby-checkstyle.xml ---------------------------------------------------------------------- diff --git a/docs/kerby-checkstyle.xml b/docs/kerby-checkstyle.xml index 239edbd..3538cd6 100644 --- a/docs/kerby-checkstyle.xml +++ b/docs/kerby-checkstyle.xml @@ -133,6 +133,7 @@ + @@ -144,4 +145,6 @@ + + http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3b5a4463/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java ---------------------------------------------------------------------- diff --git a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java index 7aadf43..6139ef3 100644 --- a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java +++ b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java @@ -298,8 +298,8 @@ public class JsonIdentityBackend extends AbstractIdentityBackend { @Override public BatchTrans addIdentity(KrbIdentity identity) throws KrbException { - if (identity != null && - identities.containsKey(identity.getPrincipalName())) { + if (identity != null + && identities.containsKey(identity.getPrincipalName())) { identities.put(identity.getPrincipalName(), identity); } return this; @@ -307,8 +307,8 @@ public class JsonIdentityBackend extends AbstractIdentityBackend { @Override public BatchTrans updateIdentity(KrbIdentity identity) throws KrbException { - if (identity != null && - identities.containsKey(identity.getPrincipalName())) { + if (identity != null + && identities.containsKey(identity.getPrincipalName())) { identities.put(identity.getPrincipalName(), identity); } return this; http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3b5a4463/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java ---------------------------------------------------------------------- diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java index 7174edd..e3d7570 100644 --- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java +++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcNetwork.java @@ -73,6 +73,7 @@ public abstract class KdcNetwork { }).start(); } + //CHECKSTYLE:OFF private void run() { while (true) { synchronized (this) { @@ -85,7 +86,7 @@ public abstract class KdcNetwork { try { checkAndAccept(); } catch (SocketTimeoutException e) { //NOPMD - System.err.println(e); //NOOP as normal + //NOOP as normal } catch (IOException e) { throw new RuntimeException("Error occured while checking tcp connections", e); } @@ -94,14 +95,15 @@ public abstract class KdcNetwork { if (tpair.udpAddress != null) { try { checkUdpMessage(); - } catch (SocketTimeoutException e) { - System.err.println(e); //NOOP as normal + } catch (SocketTimeoutException e) { //NOPMD + //NOOP as normal } catch (IOException e) { throw new RuntimeException("Error occured while checking udp connections", e); } } } } + //CHECKSTYLE:ON public synchronized void stop() { isStopped = true;