Buggy code:
public class GeoSparqlDaoImpl extends CommonDaoImpl implements Map4rdfDao { private static final Logger LOG = Logger . getLogger ( GeoSparqlDaoImpl . class ) ; private final String geoSparqlEndpoint ; @ Inject public GeoSparqlDaoImpl ( @ Named ( ParameterNames . ENDPOINT_URL ) String endpointUri , @ Named ( ParameterNames . ENDPOINT_URL_GEOSPARQL ) String geoSparqlEndpoointUrl , String defaultProjection ) { } @ Override public List < GeoResource > getGeoResources ( BoundingBox boundingBox , Set < FacetConstraint > constraints , int max ) throws DaoException { } @ Override public List < GeoResource > getGeoResources ( BoundingBox boundingBox , Set < FacetConstraint > constraints ) throws DaoException { } private List < GeoResource > getGeoResources ( BoundingBox boundingBox , Set < FacetConstraint > constraints , Integer max ) throws DaoException { HashMap < String , GeoResource > result = new HashMap < String , GeoResource > ( ) ; QueryExecution execution = null ; if ( ( ( geoSparqlEndpoint ) == null ) || ( geoSparqlEndpoint . isEmpty ( ) ) ) { execution = QueryExecutionFactory . sparqlService ( endpointUri , createGetResourcesQuery ( boundingBox , constraints , max ) ) ; } else if ( ( ( this . endpointUri ) == null ) || ( this . endpointUri . isEmpty ( ) ) ) { execution = QueryExecutionFactory . sparqlService ( geoSparqlEndpoint , createGetALLGeoSparqlResourcesQuery ( boundingBox , constraints , max ) ) ; } else { <START_BUG> execution = QueryExecutionFactory . sparqlService ( endpointUri , createGetGeoSparqlResourcesQuery ( boundingBox , constraints , max ) ) ; <END_BUG> } try { ResultSet queryResult = execution . execSelect ( ) ; while ( queryResult . hasNext ( ) ) { QuerySolution solution = queryResult . next ( ) ; try { String uri = solution . getResource ( "r" ) . getURI ( ) ; String geoUri = solution . getResource ( "geosparqlwkt" ) . getURI ( ) ; String wkt = solution . getLiteral ( "wkt" ) . getString ( ) ; if ( wkt . toLowerCase ( ) . contains ( "crs84" ) ) { GeoResource resource = result . get ( uri ) ; if ( resource == null ) { List < Geometry > geometries = GeoUtils . getWKTGeometries ( geoUri , "" , wkt , "EPSG:4326" ) ; if ( ! ( geometries . isEmpty ( ) ) ) { resource = new GeoResource ( uri , geometries . get ( 0 ) ) ; for ( int i = 1 ; i < ( geometries . size ( ) ) ; i ++ ) { resource . addGeometry ( geometries . get ( i ) ) ; } result . put ( uri , resource ) ; } } else if ( ! ( resource . hasGeometry ( geoUri ) ) ) { List < Geometry > geometries = GeoUtils . getWKTGeometries ( geoUri , "" , wkt , "EPSG:4326" ) ; if ( ! ( geometries . isEmpty ( ) ) ) { for ( int i = 0 ; i < ( geometries . size ( ) ) ; i ++ ) { resource . addGeometry ( geometries . get ( i ) ) ; } } } getOtherInfo ( uri , resource , solution ) ; if ( ( solution . contains ( "facetID" ) ) && ( solution . contains ( "facetValueID" ) ) ) { String facetID = solution . getResource ( "facetID" ) . getURI ( ) ; String facetValueID = solution . getResource ( "facetValueID" ) . getURI ( ) ; resource . setFacetConstraint ( new FacetConstraint ( facetID , facetValueID ) ) ; } } } catch ( NumberFormatException e ) { GeoSparqlDaoImpl . LOG . warn ( ( "Invalid<seq2seq4repair_space>Latitud<seq2seq4repair_space>or<seq2seq4repair_space>Longitud<seq2seq4repair_space>value:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } catch ( Exception e ) { GeoSparqlDaoImpl . LOG . error ( e ) ; } } return new ArrayList < GeoResource > ( result . values ( ) ) ; } catch ( Exception e ) { GeoSparqlDaoImpl . LOG . error ( e ) ; throw new DaoException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>SPARQL<seq2seq4repair_space>query" , e ) ; } finally { execution . close ( ) ; } } @ Override public GeoResource getGeoResource ( String uri ) throws DaoException { } @ Override public List < GeoResourceOverlay > getGeoResourceOverlays ( StatisticDefinition statisticDefinition , BoundingBox boundingBox , Set < FacetConstraint > constraints ) throws DaoException { } @ Override public List < Facet > getFacets ( String predicateUri , BoundingBox boundingBox ) throws DaoException { } @ Override public List < Year > getYears ( String datasetUri ) throws DaoException { } @ Override public List < Resource > getStatisticDatasets ( ) throws DaoException { } @ Override public List < GeoResource > getNextPoints ( BoundingBox boundingBox , int max ) throws DaoException { } private void getOtherInfo ( String resourceUri , GeoResource resource , QuerySolution solution ) throws DaoException { } private String createGetGeoSparqlResourcesQuery ( BoundingBox boundingBox , Set < FacetConstraint > constraints , Integer limit ) { } private String createGetALLGeoSparqlResourcesQuery ( BoundingBox boundingBox , Set < FacetConstraint > constraints , Integer limit ) { } private String createGetResourceOtherInfo ( String resourceUri ) { } private String createGetResourcesQuery ( BoundingBox boundingBox , Set < FacetConstraint > constraints , Integer limit ) { } private String createGetResourceQuery ( String uri ) { } private StringBuilder addGeoSparqlBoundingBoxFilter ( StringBuilder originalQuery , BoundingBox boundingBox ) { } }

Fix:
execution = QueryExecutionFactory . sparqlService ( geoSparqlEndpoint , createGetGeoSparqlResourcesQuery ( boundingBox , constraints , max ) ) ;