From 9e9e1907d2c4dd613d2ab1d4e9a914013523a153 Mon Sep 17 00:00:00 2001 From: Lyn Elisa Goltz Date: Wed, 5 Jun 2024 18:37:16 +0200 Subject: [PATCH] #1654 - fixed imports, added isDebugEnabled --- .../client/core/debug/DebugPhaseListener.java | 16 +++++----- .../connection/sql/ConnectionTester.java | 8 ++--- .../datastore/feature/MappingWizardSQL.java | 31 ++++++++++--------- .../org/deegree/console/proxy/ProxyBean.java | 6 ++-- .../wps/ProcessExecutionsBean.java | 8 ++--- .../console/webservices/wps/WPSBean.java | 8 ++--- .../workspace/CreateWorkspaceBean.java | 6 ++-- 7 files changed, 43 insertions(+), 40 deletions(-) diff --git a/deegree-client/deegree-jsf-core/src/main/java/org/deegree/client/core/debug/DebugPhaseListener.java b/deegree-client/deegree-jsf-core/src/main/java/org/deegree/client/core/debug/DebugPhaseListener.java index fd5f1a7ab7..3b0024eeb6 100644 --- a/deegree-client/deegree-jsf-core/src/main/java/org/deegree/client/core/debug/DebugPhaseListener.java +++ b/deegree-client/deegree-jsf-core/src/main/java/org/deegree/client/core/debug/DebugPhaseListener.java @@ -35,6 +35,8 @@ package org.deegree.client.core.debug; +import static org.slf4j.LoggerFactory.getLogger; + import jakarta.faces.event.PhaseEvent; import jakarta.faces.event.PhaseId; import jakarta.faces.event.PhaseListener; @@ -43,8 +45,6 @@ import java.util.Map; import java.util.Map.Entry; -import static org.slf4j.LoggerFactory.getLogger; - /** * TODO add class documentation here * @@ -62,11 +62,13 @@ public void afterPhase(PhaseEvent event) { public void beforePhase(PhaseEvent event) { LOG.debug("Before phase: {}", event.getPhaseId()); - Map sessionMap = event.getFacesContext().getExternalContext().getSessionMap(); - for (Entry beanEntry : sessionMap.entrySet()) { - String beanName = beanEntry.getKey(); - Object bean = beanEntry.getValue(); - LOG.debug(" - {}: {}", beanName, bean); + if (LOG.isDebugEnabled()) { + Map sessionMap = event.getFacesContext().getExternalContext().getSessionMap(); + for (Entry beanEntry : sessionMap.entrySet()) { + String beanName = beanEntry.getKey(); + Object bean = beanEntry.getValue(); + LOG.debug(" - {}: {}", beanName, bean); + } } } diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/connection/sql/ConnectionTester.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/connection/sql/ConnectionTester.java index 71206e5466..01ee0bceb4 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/connection/sql/ConnectionTester.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/connection/sql/ConnectionTester.java @@ -34,6 +34,10 @@ ----------------------------------------------------------------------------*/ package org.deegree.console.connection.sql; +import static jakarta.faces.application.FacesMessage.SEVERITY_ERROR; +import static jakarta.faces.application.FacesMessage.SEVERITY_INFO; +import static org.deegree.client.core.utils.ActionParams.getParam1; + import jakarta.enterprise.context.SessionScoped; import jakarta.faces.application.FacesMessage; import jakarta.faces.context.ExternalContext; @@ -46,10 +50,6 @@ import java.io.Serializable; -import static jakarta.faces.application.FacesMessage.SEVERITY_ERROR; -import static jakarta.faces.application.FacesMessage.SEVERITY_INFO; -import static org.deegree.client.core.utils.ActionParams.getParam1; - /** * JSF Bean for testing the availability of connections offered by * {@link ConnectionProvider}s. diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/datastore/feature/MappingWizardSQL.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/datastore/feature/MappingWizardSQL.java index 77fa969986..dc0939bd09 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/datastore/feature/MappingWizardSQL.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/datastore/feature/MappingWizardSQL.java @@ -33,11 +33,27 @@ e-mail: info@deegree.org ----------------------------------------------------------------------------*/ package org.deegree.console.datastore.feature; +import static jakarta.faces.application.FacesMessage.SEVERITY_ERROR; +import static org.apache.commons.io.FileUtils.readFileToByteArray; +import static org.deegree.feature.types.property.GeometryPropertyType.CoordinateDimension.DIM_2; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; import jakarta.enterprise.context.SessionScoped; import jakarta.faces.application.FacesMessage; import jakarta.faces.context.ExternalContext; import jakarta.faces.context.FacesContext; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; + import jakarta.inject.Named; import org.apache.commons.io.IOUtils; import org.deegree.client.core.utils.SQLExecution; @@ -74,22 +90,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; import java.io.Serializable; -import java.lang.reflect.InvocationTargetException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; - -import static jakarta.faces.application.FacesMessage.SEVERITY_ERROR; -import static org.apache.commons.io.FileUtils.readFileToByteArray; -import static org.deegree.feature.types.property.GeometryPropertyType.CoordinateDimension.DIM_2; /** * JSF bean that helps with creating configurations for the {@link SQLFeatureStore}. diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/proxy/ProxyBean.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/proxy/ProxyBean.java index 4fecb76161..0b697182ed 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/proxy/ProxyBean.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/proxy/ProxyBean.java @@ -27,13 +27,13 @@ ----------------------------------------------------------------------------*/ package org.deegree.console.proxy; +import java.io.IOException; +import java.io.Serializable; + import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; import org.deegree.commons.proxy.ProxySettings; -import java.io.IOException; -import java.io.Serializable; - /** * @author Andreas Schmitz */ diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/ProcessExecutionsBean.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/ProcessExecutionsBean.java index 4cfbd46a29..90b753b1a2 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/ProcessExecutionsBean.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/ProcessExecutionsBean.java @@ -34,15 +34,15 @@ ----------------------------------------------------------------------------*/ package org.deegree.console.webservices.wps; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; import org.deegree.services.controller.OGCFrontController; import org.deegree.services.wps.WPService; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - /** * JSF-Bean for the processes execution info page. * diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/WPSBean.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/WPSBean.java index eea9c2f4ac..6a22b6caac 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/WPSBean.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/webservices/wps/WPSBean.java @@ -34,16 +34,16 @@ ----------------------------------------------------------------------------*/ package org.deegree.console.webservices.wps; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; import org.deegree.services.controller.OGCFrontController; import org.deegree.services.wps.WPSProcess; import org.deegree.services.wps.WPService; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - /** * JSF-Bean for the WPS main info page. * diff --git a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/workspace/CreateWorkspaceBean.java b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/workspace/CreateWorkspaceBean.java index 5dddb60748..9d58b215f7 100644 --- a/deegree-services/deegree-webservices/src/main/java/org/deegree/console/workspace/CreateWorkspaceBean.java +++ b/deegree-services/deegree-webservices/src/main/java/org/deegree/console/workspace/CreateWorkspaceBean.java @@ -27,14 +27,14 @@ ----------------------------------------------------------------------------*/ package org.deegree.console.workspace; +import java.io.File; +import java.io.Serializable; + import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; import org.deegree.commons.config.DeegreeWorkspace; import org.deegree.console.JsfUtils; -import java.io.File; -import java.io.Serializable; - /** * JSF backing bean for creating a new workspace folder. *