From 672afafb8c9bbdc28fc119cc45bd0697fea323f9 Mon Sep 17 00:00:00 2001 From: rdeniel Date: Thu, 3 Feb 2022 17:09:03 +0100 Subject: [PATCH 1/2] LEAFLET-5 update global pom to 5.2.1 and Lutece core to 7.0.4+ --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 629d40d..7b6355f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ lutece-global-pom fr.paris.lutece.tools - 3.0.5 + 5.2.1 4.0.0 @@ -26,7 +26,7 @@ fr.paris.lutece lutece-core - [5.0.0,) + [7.0.4,) lutece-core From a89318e742efeafdb12f962c914343516a7815d6 Mon Sep 17 00:00:00 2001 From: rdeniel Date: Thu, 3 Feb 2022 17:10:17 +0100 Subject: [PATCH 2/2] LEAFLET-6 fix some Sonar feedbacks --- .../lutece/plugins/leaflet/business/GeolocItem.java | 10 ++++------ .../lutece/plugins/leaflet/service/IconService.java | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/java/fr/paris/lutece/plugins/leaflet/business/GeolocItem.java b/src/java/fr/paris/lutece/plugins/leaflet/business/GeolocItem.java index 75d662a..fa84b62 100644 --- a/src/java/fr/paris/lutece/plugins/leaflet/business/GeolocItem.java +++ b/src/java/fr/paris/lutece/plugins/leaflet/business/GeolocItem.java @@ -35,12 +35,10 @@ import fr.paris.lutece.util.xml.XmlUtil; -import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; @@ -96,7 +94,7 @@ public class GeolocItem @JsonProperty( PATH_GEOMETRY ) public void setGeometry( Map geometry ) { - _lonlat = (List) geometry.get( PATH_GEOMETRY_COORDINATES ); + _lonlat = ( List ) geometry.get( PATH_GEOMETRY_COORDINATES ); } /** @@ -131,7 +129,7 @@ public String getType( ) @JsonProperty( PATH_PROPERTIES ) public Map getProperties( ) { - HashMap properties = new HashMap( ); + HashMap properties = new HashMap<>( ); if ( _address != null ) { @@ -159,7 +157,7 @@ public Map getProperties( ) @JsonProperty( PATH_GEOMETRY ) public Map getGeometry( ) { - HashMap geometry = new HashMap( ); + HashMap geometry = new HashMap<>( ); geometry.put( PATH_GEOMETRY_TYPE, VALUE_GEOMETRY_TYPE ); geometry.put( PATH_GEOMETRY_COORDINATES, _lonlat ); @@ -292,7 +290,7 @@ public String toXML( ) * @return The geolocItem object */ public static GeolocItem fromJSON( String strJson ) - throws JsonParseException, JsonMappingException, IOException + throws IOException { return _objectMapper.readValue( strJson, GeolocItem.class ); } diff --git a/src/java/fr/paris/lutece/plugins/leaflet/service/IconService.java b/src/java/fr/paris/lutece/plugins/leaflet/service/IconService.java index e91afc3..609fd38 100644 --- a/src/java/fr/paris/lutece/plugins/leaflet/service/IconService.java +++ b/src/java/fr/paris/lutece/plugins/leaflet/service/IconService.java @@ -69,7 +69,7 @@ private IconService( ) public static Collection getList( ) { ReferenceList referenceList = DatastoreService.getDataByPrefix( DATASTORE_ICONS_PREFIX ); - HashSet hashSet = new HashSet( ); + HashSet hashSet = new HashSet<>( ); for ( ReferenceItem referenceItem : referenceList ) { @@ -78,9 +78,7 @@ public static Collection getList( ) hashSet.add( code ); } - ArrayList result = new ArrayList( hashSet ); - - return result; + return new ArrayList<>( hashSet ); } /**