Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6278ED57F for ; Sat, 22 Sep 2012 19:22:10 +0000 (UTC) Received: (qmail 10165 invoked by uid 500); 22 Sep 2012 19:22:08 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 10065 invoked by uid 500); 22 Sep 2012 19:22:08 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 9817 invoked by uid 99); 22 Sep 2012 19:22:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Sep 2012 19:22:07 +0000 Date: Sun, 23 Sep 2012 06:22:07 +1100 (NCT) From: "David Smiley (JIRA)" To: dev@lucene.apache.org Message-ID: <420149995.112465.1348341727902.JavaMail.jiratomcat@arcas> In-Reply-To: <557631041.107585.1348235347777.JavaMail.jiratomcat@arcas> Subject: [jira] [Resolved] (LUCENE-4413) Better use of exceptions in spatial MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Smiley resolved LUCENE-4413. ---------------------------------- Resolution: Fixed Fix Version/s: 4.0 Assignee: David Smiley Woops; forgot to attach the the patch. Here's the ViewVC URL to the commit: http://svn.apache.org/viewvc?view=revision&revision=1388872 Committed to trunk, 4x, and 4.0 branches > Better use of exceptions in spatial > ----------------------------------- > > Key: LUCENE-4413 > URL: https://issues.apache.org/jira/browse/LUCENE-4413 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spatial > Reporter: David Smiley > Assignee: David Smiley > Priority: Minor > Fix For: 4.0 > > > Spatial4j's InvalidShapeException is supposed to be for shape strings that won't parse or invalid coordinates. TwoDoublesStrategy is using it incorrectly to indicate the strategy doesn't support the shape. > Perhaps UnsupportedOperationException is more fitting. I kind of prefer it just slightly over IllegalArgumentException because I think of it here as the strategy not supporting that shape. > The biggest point here is consistency across the strategies. > FYI for context there's also UnsupportedSpatialOperation, an Exception that doesn't follow the naming convention but I'm ok with that. Its c'tor mandates its association with an instance of SpatialOperation. So if a strategy doesn't support an operation then it's got a special exception just for that, but not also true for shape? Seems lopsided to me. I think my preference is for this exception to be UnsupportedSpatialArgument that isn't locked to either the shape or operation. > The attached patch doesn't go as far as UnsupportedSpatialArgument but it at least bring consistent behavior. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org