Skip to content

Commit

Permalink
HSEARCH-923 Fix style and add license
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelbernard authored and Sanne committed Jun 21, 2012
1 parent 797c769 commit 73233eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
@@ -1,3 +1,23 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* JBoss, Home of Professional Open Source
* Copyright 2012 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.hibernate.search.annotations;

import org.hibernate.search.spatial.SpatialFieldBridge;
Expand Down
Expand Up @@ -61,7 +61,7 @@ public static Query buildSpatialQuery(double latitude, double longitude, double
* @param latitude WGS84 latitude of the center of the search
* @param longitude WGS84 longitude of the center of the search
* @param radius distance max to center in km
* *
*
* @return Lucene Query to be used in a search
*
* @see Query
Expand Down
Expand Up @@ -190,15 +190,15 @@ public static Query buildSimpleSpatialQuery(Point center, double radius) {
);

Query longQuery= null;
if( boundingBox.getLowerLeft().getLongitude() <= boundingBox.getUpperRight().getLongitude()) {
longQuery= NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", boundingBox.getLowerLeft().getLongitude(),
if ( boundingBox.getLowerLeft().getLongitude() <= boundingBox.getUpperRight().getLongitude() ) {
longQuery = NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", boundingBox.getLowerLeft().getLongitude(),
boundingBox.getUpperRight().getLongitude(), true, true);
}
else {
longQuery= new BooleanQuery();
((BooleanQuery)longQuery).add( NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", boundingBox.getLowerLeft().getLongitude(),
( (BooleanQuery) longQuery).add( NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", boundingBox.getLowerLeft().getLongitude(),
180.0, true, true), BooleanClause.Occur.SHOULD);
((BooleanQuery)longQuery).add( NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", -180.0,
( (BooleanQuery) longQuery).add( NumericRangeQuery.newDoubleRange( "longitude_hibernate_search_spatial", -180.0,
boundingBox.getUpperRight().getLongitude(), true, true), BooleanClause.Occur.SHOULD);
}

Expand Down

0 comments on commit 73233eb

Please sign in to comment.