Return-Path: X-Original-To: apmail-curator-user-archive@minotaur.apache.org Delivered-To: apmail-curator-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C453B10AF2 for ; Mon, 10 Mar 2014 21:16:17 +0000 (UTC) Received: (qmail 5612 invoked by uid 500); 10 Mar 2014 21:16:16 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 5569 invoked by uid 500); 10 Mar 2014 21:16:16 -0000 Mailing-List: contact user-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.apache.org Delivered-To: mailing list user@curator.apache.org Received: (qmail 5559 invoked by uid 99); 10 Mar 2014 21:16:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 21:16:15 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [198.203.175.175] (HELO mail6.uhc.com) (198.203.175.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 21:16:08 +0000 X-IronPort-AV: E=Sophos;i="4.97,626,1389765600"; d="scan'208,217";a="656334182" Received: from irmply48.uhc.com (HELO mail5.uhc.com) ([10.114.170.75]) by mail8.uhc.com with ESMTP; 10 Mar 2014 16:15:46 -0500 X-IronPort-AV: E=Sophos;i="4.97,626,1389765600"; d="scan'208,217";a="662272335" X-CONF-FOOTER: True Received: from apsep0935.ms.ds.uhc.com ([10.123.233.191]) by mail5.uhc.com with ESMTP; 10 Mar 2014 16:15:46 -0500 Received: from apswp0428.ms.ds.uhc.com ([fe80::7cb7:a560:d0b0:bc2d]) by apsep0935.ms.ds.uhc.com ([fe80::b97d:d4c7:11d:c23e%10]) with mapi id 14.03.0169.001; Mon, 10 Mar 2014 16:15:46 -0500 From: "Lavoie, John L" To: "user@curator.apache.org" Subject: Raising of raw Exceptions (HP Fortify SCA issues) Thread-Topic: Raising of raw Exceptions (HP Fortify SCA issues) Thread-Index: Ac88pLL/+qJCeVVHT8KdMm8SQxmTMQ== Date: Mon, 10 Mar 2014 21:15:45 +0000 Message-ID: <0C075FF7C527504E8058F4102A4BAFC5191F64@APSWP0428.ms.ds.uhc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.112.10.26] Content-Type: multipart/alternative; boundary="_000_0C075FF7C527504E8058F4102A4BAFC5191F64APSWP0428msdsuhcc_" MIME-Version: 1.0 X-IP-VFilter-R: R X-Virus-Checked: Checked by ClamAV on apache.org --_000_0C075FF7C527504E8058F4102A4BAFC5191F64APSWP0428msdsuhcc_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable We have recently started including references to Curator in our code. We r= un all of our own code through Fortify SCA for static analysis. Fortify is= not happy that our calls to Curator raise exceptions of the type Exception= and is complaining about "Overly broad Catch". Is there a reason Curator= needs to throw such broad exceptions as opposed to the underlying exceptio= n that was really raised? As an example, here is a utility method I've created, which Fortify doesn't= like. public PathChildrenCache getCacheForPath(String requestedPath) { PathChildrenCache cache =3D new PathChildrenCache(client, requested= Path, true); try { cache.start(StartMode.BUILD_INITIAL_CACHE); } catch (Exception e) { LOG.error(e); // reraise goes here } return cache; } John This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. --_000_0C075FF7C527504E8058F4102A4BAFC5191F64APSWP0428msdsuhcc_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

We have recently started including references to Cur= ator in our code.  We run all of our own code through Fortify SCA for = static analysis.  Fortify is not happy that our calls to Curator raise= exceptions of the type Exception and is complaining about “Overly broad Catch”.   Is there a reason Cura= tor needs to throw such broad exceptions as opposed to the underlying excep= tion that was really raised?

 

As an example, here is a utility method I’ve c= reated, which Fortify doesn’t like.

    public PathChildrenCache getCacheForPath(String requestedPath) {

     &= nbsp;  PathChildrenCache cache =3D new PathChildrenCache(client, requestedPath, true);

     &= nbsp;  try {

     &= nbsp;      cache.start(StartMode.BUILD_INITIAL_CAC= HE);

     &= nbsp;  } catch (Exception e) {

     &= nbsp;      LOG.error(e);

     &= nbsp;        // reraise goes here=

     &= nbsp;  }<= o:p>

     &= nbsp;  return cache;

    }

 

John


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended<= br> recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

<= /body> --_000_0C075FF7C527504E8058F4102A4BAFC5191F64APSWP0428msdsuhcc_--