diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayRequest.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayRequest.java index 1f532ced1f..14db26a537 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayRequest.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayRequest.java @@ -407,7 +407,7 @@ public class GatewayRequest { * The value of the node being created. * @return An XML node as a String in nodeValue format */ - private String createNode(String nodeName, String nodeValue) { + private static String createNode(String nodeName, String nodeValue) { return "<" + nodeName + ">" + nodeValue + ""; } } diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java index 83daf35321..69ed209926 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java @@ -207,7 +207,7 @@ public class PcChargeApi { } - private boolean checkIn(String name) { + private static boolean checkIn(String name) { for (String element : validOut) { if (name.equals(element)) { return false; @@ -216,7 +216,7 @@ public class PcChargeApi { return true; } - private boolean checkOut(String name) { + private static boolean checkOut(String name) { for (String element : validIn) { if (name.equals(element)) { return false; diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java index 7708dfc1ec..44c129a225 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java @@ -204,7 +204,7 @@ public class RitaApi { throw new IllegalStateException("Cannot send output object"); } - private boolean checkIn(String name) { + private static boolean checkIn(String name) { for (String element : validOut) { if (name.equals(element)) { return false; @@ -213,7 +213,7 @@ public class RitaApi { return true; } - private boolean checkOut(String name) { + private static boolean checkOut(String name) { for (String element : validIn) { if (name.equals(element)) { return false; diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java index dab0506df9..2a5864fbf6 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java @@ -796,7 +796,7 @@ public class CheckOutHelper { csi.clearAllTaxInfo(); continue; } - List> taxReturn = this.getTaxAdjustments(dispatcher, "calcTax", serviceContext); + List> taxReturn = getTaxAdjustments(dispatcher, "calcTax", serviceContext); if (Debug.verboseOn()) { Debug.logVerbose("ReturnList: " + taxReturn, module); @@ -908,7 +908,8 @@ public class CheckOutHelper { } // Calc the tax adjustments. - private List> getTaxAdjustments(LocalDispatcher dispatcher, String taxService, Map serviceContext) throws GeneralException { + private static List> getTaxAdjustments(LocalDispatcher dispatcher, String taxService, + Map serviceContext) throws GeneralException { Map serviceResult = null; try { diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java index 8ab4770f9b..a7830b2b52 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java @@ -213,7 +213,7 @@ public class PackingSession implements java.io.Serializable { this.runEvents(PackingEvent.EVENT_CODE_ADD); } - private BigDecimal numAvailableItems(GenericValue res) { + private static BigDecimal numAvailableItems(GenericValue res) { // In simple situations, the reserved quantity will match the quantity from the order item. // If there is a back order, quantity from order may exceed quantity currently reserved and on hand. // resQty should never exceed the quantity from the order item, because that quantity was the quantity reserved in the first place. diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java b/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java index 658bc1d134..3bae51eb04 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java @@ -91,7 +91,7 @@ public class ComponentContainer implements Container { * * @param componentsClassPath a list of classpaths for all components */ - private void loadClassPathForAllComponents(List componentsClassPath) { + private static void loadClassPathForAllComponents(List componentsClassPath) { List allComponentUrls = new ArrayList<>(); for(Classpath classPath : componentsClassPath) { try { @@ -256,7 +256,7 @@ public class ComponentContainer implements Container { * @param location directory location of the component * @return The component configuration */ - private ComponentConfig retrieveComponentConfig(String name, String location) { + private static ComponentConfig retrieveComponentConfig(String name, String location) { ComponentConfig config = null; try { config = ComponentConfig.getComponentConfig(name, location); @@ -331,7 +331,7 @@ public class ComponentContainer implements Container { * @return the constructed classpath * @throws IOException */ - private Classpath buildClasspathFromComponentConfig(ComponentConfig config) throws IOException { + private static Classpath buildClasspathFromComponentConfig(ComponentConfig config) throws IOException { Classpath classPath = new Classpath(); String configRoot = config.getRootLocation().replace('\\', '/'); configRoot = configRoot.endsWith("/") ? configRoot : configRoot + "/"; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java b/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java index 9d4c528320..0ba7734ffe 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java @@ -81,7 +81,8 @@ public class ContainerLoader { startLoadedContainers(); } - private Collection retrieveOfbizContainers(String configFile) throws StartupException { + private static Collection retrieveOfbizContainers(String configFile) + throws StartupException { try { return ContainerConfig.getConfigurations(configFile); } catch (ContainerException e) { @@ -89,7 +90,7 @@ public class ContainerLoader { } } - private List filterContainersHavingMatchingLoaders(List loaders, + private static List filterContainersHavingMatchingLoaders(List loaders, Collection containerConfigs) { return containerConfigs.stream() .filter(containerCfg -> @@ -99,7 +100,7 @@ public class ContainerLoader { .collect(Collectors.toList()); } - private List loadContainersFromConfigurations(List containerConfigs, + private static List loadContainersFromConfigurations(List containerConfigs, Config config, List ofbizCommands) throws StartupException { List loadContainers = new ArrayList<>(); @@ -112,8 +113,7 @@ public class ContainerLoader { return loadContainers; } - private Container loadContainer(String configFile, - ContainerConfig.Configuration containerCfg, + private static Container loadContainer(String configFile, ContainerConfig.Configuration containerCfg, List ofbizCommands) throws StartupException { // load the container class ClassLoader loader = Thread.currentThread().getContextClassLoader(); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java index e8007d20be..c43d119316 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java @@ -196,7 +196,7 @@ public class UtilCache implements Serializable, EvictionListener testMap = new HashMap<>(); testMap.put("date", new java.util.Date(1234567890)); testMap.put("usd", "USD"); diff --git a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java index 2ada087522..ebfb5bd20e 100644 --- a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java +++ b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java @@ -164,7 +164,7 @@ public class CatalinaContainer implements Container { return name; } - private Property retrieveTomcatEngineConfig(ContainerConfig.Configuration cc) throws ContainerException { + private static Property retrieveTomcatEngineConfig(ContainerConfig.Configuration cc) throws ContainerException { List engineProps = cc.getPropertiesWithValue("engine"); if (UtilValidate.isEmpty(engineProps)) { throw new ContainerException("Cannot load CatalinaContainer; no engines defined."); @@ -175,7 +175,7 @@ public class CatalinaContainer implements Container { return engineProps.get(0); } - private Tomcat prepareTomcatServer(ContainerConfig.Configuration cc, + private static Tomcat prepareTomcatServer(ContainerConfig.Configuration cc, ContainerConfig.Configuration.Property engineConfig) throws ContainerException { System.setProperty(Globals.CATALINA_HOME_PROP, System.getProperty("ofbiz.home") + "/" + @@ -205,7 +205,7 @@ public class CatalinaContainer implements Container { return tomcat; } - private Engine prepareTomcatEngine(Tomcat tomcat, Property engineConfig) { + private static Engine prepareTomcatEngine(Tomcat tomcat, Property engineConfig) { Engine engine = tomcat.getEngine(); engine.setName(engineConfig.name); @@ -218,7 +218,7 @@ public class CatalinaContainer implements Container { return engine; } - private Host prepareHost(Tomcat tomcat, List virtualHosts) { + private static Host prepareHost(Tomcat tomcat, List virtualHosts) { Host host; if (UtilValidate.isEmpty(virtualHosts)) { @@ -240,7 +240,7 @@ public class CatalinaContainer implements Container { return host; } - private Host prepareVirtualHost(Tomcat tomcat, List virtualHosts) { + private static Host prepareVirtualHost(Tomcat tomcat, List virtualHosts) { // assume that the first virtual-host will be the default; additional virtual-hosts will be aliases String hostName = virtualHosts.get(0); Host host; @@ -262,7 +262,7 @@ public class CatalinaContainer implements Container { return host; } - private Property prepareTomcatClustering(Host host, Property engineConfig) throws ContainerException { + private static Property prepareTomcatClustering(Host host, Property engineConfig) throws ContainerException { Property clusterProp = null; List clusterProps = engineConfig.getPropertiesWithValue("cluster"); @@ -291,7 +291,7 @@ public class CatalinaContainer implements Container { return clusterProp; } - private NioReceiver prepareChannelReceiver(Property clusterProp) throws ContainerException { + private static NioReceiver prepareChannelReceiver(Property clusterProp) throws ContainerException { NioReceiver listener = new NioReceiver(); String tla = ContainerConfig.getPropertyValue(clusterProp, "tcp-listen-host", "auto"); @@ -312,7 +312,7 @@ public class CatalinaContainer implements Container { return listener; } - private ReplicationTransmitter prepareChannelSender(Property clusterProp) throws ContainerException { + private static ReplicationTransmitter prepareChannelSender(Property clusterProp) throws ContainerException { ReplicationTransmitter trans = new ReplicationTransmitter(); try { MultiPointSender mps = (MultiPointSender)Class.forName(ContainerConfig.getPropertyValue(clusterProp, @@ -324,7 +324,7 @@ public class CatalinaContainer implements Container { return trans; } - private McastService prepareChannelMcastService(Property clusterProp) throws ContainerException { + private static McastService prepareChannelMcastService(Property clusterProp) throws ContainerException { McastService mcast = new McastService(); String mcb = ContainerConfig.getPropertyValue(clusterProp, "mcast-bind-addr", null); @@ -349,7 +349,7 @@ public class CatalinaContainer implements Container { return mcast; } - private ClusterManager prepareClusterManager(Property clusterProp) throws ContainerException { + private static ClusterManager prepareClusterManager(Property clusterProp) throws ContainerException { String mgrClassName = ContainerConfig.getPropertyValue(clusterProp, "manager-class", "org.apache.catalina.ha.session.DeltaManager"); try { return (ClusterManager)Class.forName(mgrClassName).getDeclaredConstructor().newInstance(); @@ -358,14 +358,14 @@ public class CatalinaContainer implements Container { } } - private ReplicationValve prepareClusterValve(Property clusterProp) { + private static ReplicationValve prepareClusterValve(Property clusterProp) { ReplicationValve clusterValve = new ReplicationValve(); String defaultValveFilter = ".*\\.gif;.*\\.js;.*\\.jpg;.*\\.htm;.*\\.html;.*\\.txt;.*\\.png;.*\\.css;.*\\.ico;.*\\.htc;"; clusterValve.setFilter(ContainerConfig.getPropertyValue(clusterProp, "rep-valve-filter", defaultValveFilter)); return clusterValve; } - private List prepareTomcatEngineValves(Property engineConfig) throws ContainerException { + private static List prepareTomcatEngineValves(Property engineConfig) throws ContainerException { List engineValves = new ArrayList<>(); // configure the CrossSubdomainSessionValve @@ -410,7 +410,7 @@ public class CatalinaContainer implements Container { return engineValves; } - private List prepareTomcatConnectors(Configuration configuration) throws ContainerException { + private static List prepareTomcatConnectors(Configuration configuration) throws ContainerException { List connectorProps = configuration.getPropertiesWithValue("connector"); if (UtilValidate.isEmpty(connectorProps)) { throw new ContainerException("Cannot load CatalinaContainer; no connectors defined!"); @@ -421,7 +421,7 @@ public class CatalinaContainer implements Container { .collect(Collectors.toList()); } - private Connector prepareConnector(Property connectorProp) { + private static Connector prepareConnector(Property connectorProp) { Connector connector = new Connector(ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1")); connector.setPort(ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset); if ("true".equals(ContainerConfig.getPropertyValue(connectorProp, "upgradeProtocol", "false"))) { @@ -445,7 +445,7 @@ public class CatalinaContainer implements Container { return connector; } - private void loadWebapps(Tomcat tomcat, ContainerConfig.Configuration configuration, Property clusterProp) { + private static void loadWebapps(Tomcat tomcat, ContainerConfig.Configuration configuration, Property clusterProp) { ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(new ThreadGroup(module), "catalina-startup", Runtime.getRuntime().availableProcessors(), 0, true); List> futures = new ArrayList<>(); @@ -473,7 +473,7 @@ public class CatalinaContainer implements Container { executor.shutdown(); } - private List getWebappMounts(ComponentConfig.WebappInfo webappInfo) { + private static List getWebappMounts(ComponentConfig.WebappInfo webappInfo) { List allAppsMounts = new ArrayList<>(); String engineName = webappInfo.server; String mount = webappInfo.getContextRoot(); @@ -486,7 +486,7 @@ public class CatalinaContainer implements Container { return allAppsMounts; } - private Callable createCallableContext(Tomcat tomcat, ComponentConfig.WebappInfo appInfo, + private static Callable createCallableContext(Tomcat tomcat, ComponentConfig.WebappInfo appInfo, Property clusterProp, ContainerConfig.Configuration configuration) { Debug.logInfo("Creating context [" + appInfo.name + "]", module); @@ -500,7 +500,7 @@ public class CatalinaContainer implements Container { }; } - private StandardContext prepareContext(Host host, ContainerConfig.Configuration configuration, + private static StandardContext prepareContext(Host host, ContainerConfig.Configuration configuration, ComponentConfig.WebappInfo appInfo, Property clusterProp) throws ContainerException { StandardContext context = new StandardContext(); @@ -560,7 +560,7 @@ public class CatalinaContainer implements Container { return context; } - private String getWebappRootLocation(ComponentConfig.WebappInfo appInfo) { + private static String getWebappRootLocation(ComponentConfig.WebappInfo appInfo) { String location = appInfo.componentConfig.getRootLocation() + appInfo.location; location = location.replace('\\', '/'); if (location.endsWith("/")) { @@ -569,7 +569,7 @@ public class CatalinaContainer implements Container { return location; } - private String getWebappMountPoint(ComponentConfig.WebappInfo appInfo) { + private static String getWebappMountPoint(ComponentConfig.WebappInfo appInfo) { String mount = appInfo.mountPoint; if (mount.endsWith("/*")) { mount = mount.substring(0, mount.length() - 2); @@ -577,7 +577,8 @@ public class CatalinaContainer implements Container { return mount; } - private boolean isContextDistributable(ContainerConfig.Configuration configuration, String location) throws ContainerException { + private static boolean isContextDistributable(ContainerConfig.Configuration configuration, String location) + throws ContainerException { String webXmlFilePath = new StringBuilder().append("file:///").append(location).append("/WEB-INF/web.xml").toString(); boolean appIsDistributable = ContainerConfig.getPropertyValue(configuration, "apps-distributable", true); try { diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/test/PerformFindTests.java b/framework/common/src/main/java/org/apache/ofbiz/common/test/PerformFindTests.java index e5005a8157..3d3b6bcab5 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/test/PerformFindTests.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/test/PerformFindTests.java @@ -42,7 +42,7 @@ public class PerformFindTests extends OFBizTestCase { super(name); } - private List getCompleteList(Map context) { + private static List getCompleteList(Map context) { List foundElements = new LinkedList<>(); try (EntityListIterator listIt = (EntityListIterator) context.get("listIt")) { if (listIt != null) { diff --git a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java index 722e8d1ded..3c4a2d0c6d 100644 --- a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java +++ b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/ModelDataFileReader.java @@ -66,7 +66,7 @@ public final class ModelDataFileReader { this.modelDataFiles = Collections.unmodifiableMap(createModelDataFiles()); } - private ModelDataFile createModelDataFile(Element dataFileElement) { + private static ModelDataFile createModelDataFile(Element dataFileElement) { ModelDataFile dataFile = new ModelDataFile(); String tempStr; @@ -163,7 +163,7 @@ public final class ModelDataFileReader { return result; } - private ModelField createModelField(Element fieldElement) { + private static ModelField createModelField(Element fieldElement) { ModelField field = new ModelField(); String tempStr; @@ -203,7 +203,7 @@ public final class ModelDataFileReader { return field; } - private ModelRecord createModelRecord(Element recordElement) { + private static ModelRecord createModelRecord(Element recordElement) { ModelRecord record = new ModelRecord(); String tempStr; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityFieldValue.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityFieldValue.java index ea2203b7f8..95e3c8a8d1 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityFieldValue.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityFieldValue.java @@ -173,7 +173,7 @@ public class EntityFieldValue extends EntityConditionValue { } } - private String getColName(Map tableAliases, ModelEntity modelEntity, String fieldName, + private static String getColName(Map tableAliases, ModelEntity modelEntity, String fieldName, boolean includeTableNamePrefix, Datasource datasourceInfo) { if (modelEntity == null) { return fieldName; @@ -182,7 +182,7 @@ public class EntityFieldValue extends EntityConditionValue { includeTableNamePrefix, datasourceInfo); } - private String getColName(Map tableAliases, ModelEntity modelEntity, ModelField modelField, + private static String getColName(Map tableAliases, ModelEntity modelEntity, ModelField modelField, String fieldName, boolean includeTableNamePrefix, Datasource datasourceInfo) { if (modelEntity == null || modelField == null) { return fieldName; @@ -209,7 +209,7 @@ public class EntityFieldValue extends EntityConditionValue { return colName; } - private String getColName(ModelField modelField, String fieldName) { + private static String getColName(ModelField modelField, String fieldName) { return (modelField == null) ? fieldName : modelField.getColValue(); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java index 183c2f839f..108c93f4e7 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericDAO.java @@ -92,7 +92,7 @@ public class GenericDAO { this.datasource = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); } - private void addFieldIfMissing(List fieldsToSave, String fieldName, ModelEntity modelEntity) { + private static void addFieldIfMissing(List fieldsToSave, String fieldName, ModelEntity modelEntity) { for (ModelField fieldToSave: fieldsToSave) { if (fieldName.equals(fieldToSave.getName())) { return; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java index e57360217f..a833c0229d 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java @@ -111,7 +111,8 @@ public class DatabaseUtil { return connection; } - private Connection getConnection(String driverName, String connectionUrl, Properties props, String userName, String password) throws SQLException { + private static Connection getConnection(String driverName, String connectionUrl, Properties props, String userName, + String password) throws SQLException { // first register the JDBC driver with the DriverManager if (driverName != null) { if (DriverManager.getDriver(driverName) == null) { @@ -1906,7 +1907,7 @@ public class DatabaseUtil { } } - private String makeTempFieldName(ModelField field) { + private static String makeTempFieldName(ModelField field) { String tempName = "tmp_" + field.getName(); if (tempName.length() > 30) { tempName = tempName.substring(0, 30); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java index 1b0798ed54..3a8a6e1a09 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java @@ -676,7 +676,7 @@ public class ModelEntity implements Comparable, Serializable { return getFieldNamesFromFieldVector(getNopksCopy()); } - private List getFieldNamesFromFieldVector(List modelFields) { + private static List getFieldNamesFromFieldVector(List modelFields) { List nameList = new ArrayList<>(modelFields.size()); for (ModelField field: modelFields) { nameList.add(field.getName()); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java index 5ba28d3442..a74a5e9b23 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityTestSuite.java @@ -925,7 +925,7 @@ public class EntityTestSuite extends EntityTestCase { /* * This creates an string id from a number */ - private String getTestId(String strTestBase, int iNum) { + private static String getTestId(String strTestBase, int iNum) { StringBuilder strBufTemp = new StringBuilder(strTestBase); if (iNum < 10000) { strBufTemp.append("0"); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java index fe5956231e..3ca9503930 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java @@ -388,7 +388,7 @@ public final class SimpleMethod extends MiniLangElement { addMessage(methodContext, messageListName, message); } - private void addMessage(MethodContext methodContext, String messageListName, String message) { + private static void addMessage(MethodContext methodContext, String messageListName, String message) { List messages = methodContext.getEnv(messageListName); if (messages == null) { messages = new LinkedList<>(); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/test/MiniLangTests.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/test/MiniLangTests.java index 46eeba79de..e7a38b42fe 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/test/MiniLangTests.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/test/MiniLangTests.java @@ -42,7 +42,7 @@ public class MiniLangTests extends OFBizTestCase { traceEnabled = "true".equals(UtilProperties.getPropertyValue("minilang", "unit.tests.trace.enabled")); } - private Map createContext() { + private static Map createContext() { return UtilMisc.toMap("locale", Locale.US, "timeZone", TimeZone.getTimeZone("GMT")); } @@ -55,7 +55,7 @@ public class MiniLangTests extends OFBizTestCase { return context; } - private SimpleMethod createSimpleMethod(String xmlString) throws Exception { + private static SimpleMethod createSimpleMethod(String xmlString) throws Exception { return new SimpleMethod(UtilXml.readXmlDocument(xmlString).getDocumentElement(), module); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelNotification.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelNotification.java index 0ceff365e7..ccbf0747e6 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelNotification.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelNotification.java @@ -128,7 +128,7 @@ public class ModelNotification { } } - private String getCommaSeparatedAddressList(NotificationGroup notificationGroup, String notifyType) { + private static String getCommaSeparatedAddressList(NotificationGroup notificationGroup, String notifyType) { if (notificationGroup != null) { List addr = getAddressesByType(notificationGroup, notifyType); if (UtilValidate.isNotEmpty(addr)) { @@ -138,7 +138,7 @@ public class ModelNotification { return null; } - private List getAddressesByType(NotificationGroup group, String type) { + private static List getAddressesByType(NotificationGroup group, String type) { List l = new ArrayList<>(); for (Notify n : group.getNotifyList()) { if (n.getType().equals(type)) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java index fda7e68b64..92181929be 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelService.java @@ -933,13 +933,13 @@ public class ModelService extends AbstractMap implements Seriali // internal map of strings if (UtilValidate.isNotEmpty(param.stringMapPrefix) && !source.containsKey(key)) { - Map paramMap = this.makePrefixMap(source, param); + Map paramMap = makePrefixMap(source, param); if (UtilValidate.isNotEmpty(paramMap)) { target.put(key, paramMap); } // internal list of strings } else if (UtilValidate.isNotEmpty(param.stringListSuffix) && !source.containsKey(key)) { - List paramList = this.makeSuffixList(source, param); + List paramList = makeSuffixList(source, param); if (UtilValidate.isNotEmpty(paramList)) { target.put(key, paramList); } @@ -968,7 +968,7 @@ public class ModelService extends AbstractMap implements Seriali return target; } - private Map makePrefixMap(Map source, ModelParam param) { + private static Map makePrefixMap(Map source, ModelParam param) { Map paramMap = new HashMap<>(); for (Map.Entry entry: source.entrySet()) { String key = entry.getKey(); @@ -980,7 +980,7 @@ public class ModelService extends AbstractMap implements Seriali return paramMap; } - private List makeSuffixList(Map source, ModelParam param) { + private static List makeSuffixList(Map source, ModelParam param) { List paramList = new LinkedList<>(); for (Map.Entry entry: source.entrySet()) { String key = entry.getKey(); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java index 68173242f5..45732aa1d5 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelServiceReader.java @@ -242,15 +242,15 @@ public class ModelServiceReader implements Serializable { // construct the context service.contextInfo = new HashMap<>(); - this.createNotification(serviceElement, service); - this.createPermission(serviceElement, service); - this.createPermGroups(serviceElement, service); - this.createGroupDefs(serviceElement, service); - this.createImplDefs(serviceElement, service); + createNotification(serviceElement, service); + createPermission(serviceElement, service); + createPermGroups(serviceElement, service); + createGroupDefs(serviceElement, service); + createImplDefs(serviceElement, service); this.createAutoAttrDefs(serviceElement, service); - this.createAttrDefs(serviceElement, service); - this.createOverrideDefs(serviceElement, service); - this.createDeprecated(serviceElement, service); + createAttrDefs(serviceElement, service); + createOverrideDefs(serviceElement, service); + createDeprecated(serviceElement, service); // Get metrics. Element metricsElement = UtilXml.firstChildElement(serviceElement, "metric"); if (metricsElement != null) { @@ -259,7 +259,7 @@ public class ModelServiceReader implements Serializable { return service; } - private String getCDATADef(Element baseElement, String tagName) { + private static String getCDATADef(Element baseElement, String tagName) { String value = ""; NodeList nl = baseElement.getElementsByTagName(tagName); @@ -277,7 +277,7 @@ public class ModelServiceReader implements Serializable { return value; } - private void createNotification(Element baseElement, ModelService model) { + private static void createNotification(Element baseElement, ModelService model) { List n = UtilXml.childElementList(baseElement, "notification"); // default notification groups ModelNotification nSuccess = new ModelNotification(); @@ -305,7 +305,7 @@ public class ModelServiceReader implements Serializable { } } - private void createPermission(Element baseElement, ModelService model) { + private static void createPermission(Element baseElement, ModelService model) { Element e = UtilXml.firstChildElement(baseElement, "permission-service"); if (e != null) { model.permissionServiceName = e.getAttribute("service-name"); @@ -315,7 +315,7 @@ public class ModelServiceReader implements Serializable { } } - private void createPermGroups(Element baseElement, ModelService model) { + private static void createPermGroups(Element baseElement, ModelService model) { for (Element element: UtilXml.childElementList(baseElement, "required-permissions")) { ModelPermGroup group = new ModelPermGroup(); group.joinType = element.getAttribute("join-type"); @@ -324,7 +324,7 @@ public class ModelServiceReader implements Serializable { } } - private void createGroupPermissions(Element baseElement, ModelPermGroup group, ModelService service) { + private static void createGroupPermissions(Element baseElement, ModelPermGroup group, ModelService service) { // create the simple permissions for (Element element: UtilXml.childElementList(baseElement, "check-permission")) { ModelPermission perm = new ModelPermission(); @@ -354,7 +354,7 @@ public class ModelServiceReader implements Serializable { } } - private void createGroupDefs(Element baseElement, ModelService service) { + private static void createGroupDefs(Element baseElement, ModelService service) { List group = UtilXml.childElementList(baseElement, "group"); if (UtilValidate.isNotEmpty(group)) { Element groupElement = group.get(0); @@ -367,7 +367,7 @@ public class ModelServiceReader implements Serializable { } } - private void createImplDefs(Element baseElement, ModelService service) { + private static void createImplDefs(Element baseElement, ModelService service) { for (Element implement: UtilXml.childElementList(baseElement, "implements")) { String serviceName = UtilXml.checkEmpty(implement.getAttribute("service")).intern(); boolean optional = UtilXml.checkBoolean(implement.getAttribute("optional"), false); @@ -454,7 +454,7 @@ public class ModelServiceReader implements Serializable { } } - private void createAttrDefs(Element baseElement, ModelService service) { + private static void createAttrDefs(Element baseElement, ModelService service) { // Add in the defined attributes (override the above defaults if specified) for (Element attribute: UtilXml.childElementList(baseElement, "attribute")) { ModelParam param = new ModelParam(); @@ -494,7 +494,7 @@ public class ModelServiceReader implements Serializable { } // set the validators - this.addValidators(attribute, param); + addValidators(attribute, param); service.addParam(param); } @@ -591,7 +591,7 @@ public class ModelServiceReader implements Serializable { service.addParam(def); } - private void createOverrideDefs(Element baseElement, ModelService service) { + private static void createOverrideDefs(Element baseElement, ModelService service) { for (Element overrideElement: UtilXml.childElementList(baseElement, "override")) { String name = UtilXml.checkEmpty(overrideElement.getAttribute("name")); ModelParam param = service.getParam(name); @@ -645,7 +645,7 @@ public class ModelServiceReader implements Serializable { } // override validators - this.addValidators(overrideElement, param); + addValidators(overrideElement, param); if (directToParams) { service.addParam(param); @@ -656,7 +656,7 @@ public class ModelServiceReader implements Serializable { } } - private void createDeprecated(Element baseElement, ModelService service) { + private static void createDeprecated(Element baseElement, ModelService service) { Element deprecated = UtilXml.firstChildElement(baseElement, "deprecated"); if (deprecated != null) { service.deprecatedUseInstead = deprecated.getAttribute("use-instead"); @@ -666,7 +666,7 @@ public class ModelServiceReader implements Serializable { } } - private void addValidators(Element attribute, ModelParam param) { + private static void addValidators(Element attribute, ModelParam param) { List validateElements = UtilXml.childElementList(attribute, "type-validate"); if (UtilValidate.isNotEmpty(validateElements)) { // always clear out old ones; never append @@ -691,7 +691,7 @@ public class ModelServiceReader implements Serializable { } } - private Document getDocument(URL url) { + private static Document getDocument(URL url) { if (url == null) { return null; } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java index 34582b2250..0dbd426008 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ServiceDispatcher.java @@ -294,7 +294,7 @@ public final class ServiceDispatcher { context.putAll(params); } // check the locale - Locale locale = this.checkLocale(context); + Locale locale = checkLocale(context); // set up the running service log rs = this.logService(localName, modelService, GenericEngine.SYNC_MODE); @@ -671,7 +671,7 @@ public final class ServiceDispatcher { this.logService(localName, service, GenericEngine.ASYNC_MODE); // check the locale - Locale locale = this.checkLocale(context); + Locale locale = checkLocale(context); // setup the engine and context DispatchContext ctx = localContext.get(localName); @@ -995,7 +995,7 @@ public final class ServiceDispatcher { } // checks the locale object in the context - private Locale checkLocale(Map context) { + private static Locale checkLocale(Map context) { Object locale = context.get("locale"); Locale newLocale = null; diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java index 025bea1f00..5661988056 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceInfo.java @@ -270,7 +270,7 @@ public class RecurrenceInfo { return checkDateList(rDateList, nextTime, fromTime); } - private long checkDateList(List dateList, long time, long fromTime) { + private static long checkDateList(List dateList, long time, long fromTime) { long nextTime = time; if (UtilValidate.isNotEmpty(dateList)) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java index 89b113b407..74466c50ad 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/RecurrenceRule.java @@ -140,7 +140,7 @@ public class RecurrenceRule { } // Checks for a valid frequency property. - private boolean checkFreq(String freq) { + private static boolean checkFreq(String freq) { if (freq == null) { return false; } @@ -708,7 +708,7 @@ public class RecurrenceRule { } // Tests a string for the contents of a number at the beginning - private boolean hasNumber(String str) { + private static boolean hasNumber(String str) { String list[] = {"+", "-", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}; List numberList = Arrays.asList(list); String firstChar = str.substring(0, 1); @@ -720,7 +720,7 @@ public class RecurrenceRule { } // Gets the numeric value of the number at the beginning of the string - private int getDailyNumber(String str) { + private static int getDailyNumber(String str) { int number = 0; StringBuilder numberBuf = new StringBuilder(); @@ -745,7 +745,7 @@ public class RecurrenceRule { } // Gets the string part of the combined number+string - private String getDailyString(String str) { + private static String getDailyString(String str) { StringBuilder sBuf = new StringBuilder(); for (int i = 0; i < str.length(); i++) { @@ -759,7 +759,7 @@ public class RecurrenceRule { } // Returns the Calendar day of the rule day string - private int getCalendarDay(String day) { + private static int getCalendarDay(String day) { if (day != null) { day = day.trim(); if ("MO".equalsIgnoreCase(day)) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java b/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java index 95b343206c..a6846607f7 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/engine/XMLRPCClientEngine.java @@ -75,7 +75,8 @@ public class XMLRPCClientEngine extends GenericAsyncEngine { /* * Invoke the remote XMLRPC SERVICE : This engine convert all value in IN mode to one struct. */ - private Map serviceInvoker(ModelService modelService, Map context) throws GenericServiceException { + private static Map serviceInvoker(ModelService modelService, Map context) + throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) { throw new GenericServiceException("Cannot locate service to invoke"); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobPoller.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobPoller.java index bbbce5f4a0..a1da5b0d0b 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobPoller.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobPoller.java @@ -195,7 +195,7 @@ public final class JobPoller implements ServiceConfigListener { } } - private boolean pollEnabled() { + private static boolean pollEnabled() { try { return ServiceConfigUtil.getServiceEngine().getThreadPool().getPollEnabled(); } catch (GenericConfigException e) { diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/AdminServer.java b/framework/start/src/main/java/org/apache/ofbiz/base/start/AdminServer.java index d045237e9a..7eb7f4e479 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/AdminServer.java +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/AdminServer.java @@ -122,7 +122,7 @@ final class AdminServer extends Thread { && !request.substring(request.indexOf(':') + 1).isEmpty(); } - private String prepareResponseToClient(OfbizSocketCommand control, AtomicReference serverState) { + private static String prepareResponseToClient(OfbizSocketCommand control, AtomicReference serverState) { String response = null; switch(control) { case SHUTDOWN: diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/Classpath.java b/framework/start/src/main/java/org/apache/ofbiz/base/start/Classpath.java index db0eb6da2e..188913ba6b 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/Classpath.java +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/Classpath.java @@ -124,7 +124,7 @@ public final class Classpath { } } - private void appendPath(StringBuilder cp, String path) { + private static void appendPath(StringBuilder cp, String path) { if (path.indexOf(' ') >= 0) { cp.append('\"'); cp.append(path); diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/Config.java b/framework/start/src/main/java/org/apache/ofbiz/base/start/Config.java index 7fc80c1bd3..47ac95b985 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/Config.java +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/Config.java @@ -76,16 +76,16 @@ public final class Config { TimeZone.setDefault(getDefaultTimeZone(props)); } - private String getProperty(Properties props, String key, String defaultValue) { + private static String getProperty(Properties props, String key, String defaultValue) { return Optional.ofNullable(System.getProperty(key)) .orElse(props.getProperty(key, defaultValue)); } - private String getOfbizHome(String homeProp) { + private static String getOfbizHome(String homeProp) { return homeProp.equals(".") ? System.getProperty("user.dir").replace('\\', '/') : homeProp; } - private String getAbsolutePath(Properties props, String key, String defaultValue, String ofbizHome) { + private static String getAbsolutePath(Properties props, String key, String defaultValue, String ofbizHome) { return getProperty(props, key, ofbizHome + "/" + props.getProperty(key, defaultValue)); } @@ -104,7 +104,7 @@ public final class Config { return props; } - private String determineOfbizPropertiesFileName(List ofbizCommands) { + private static String determineOfbizPropertiesFileName(List ofbizCommands) { if(ofbizCommands.stream().anyMatch( option -> option.getName().equals(StartupCommandUtil.StartupOption.LOAD_DATA.getName()))) { return "load-data.properties"; @@ -116,7 +116,7 @@ public final class Config { } } - private int getPortOffsetValue(List ofbizCommands, String defaultOffset) throws StartupException { + private static int getPortOffsetValue(List ofbizCommands, String defaultOffset) throws StartupException { String extractedPortOffset = ofbizCommands.stream() .filter(command -> command.getName().equals(StartupCommandUtil.StartupOption.PORTOFFSET.getName())) .findFirst() @@ -129,7 +129,7 @@ public final class Config { } } - private int getAdminPort(Properties props, int defaultAdminPort, int portOffsetValue) { + private static int getAdminPort(Properties props, int defaultAdminPort, int portOffsetValue) { String adminPortStr = getProperty(props, "ofbiz.admin.port", String.valueOf(defaultAdminPort)); try { return Integer.parseInt(adminPortStr) + portOffsetValue; @@ -139,7 +139,7 @@ public final class Config { } } - private InetAddress getAdminAddress(String serverHost) throws StartupException { + private static InetAddress getAdminAddress(String serverHost) throws StartupException { try { return InetAddress.getByName(serverHost); } catch (UnknownHostException e) { @@ -147,7 +147,7 @@ public final class Config { } } - private Locale getDefaultLocale(Properties props, String defaultLocale) { + private static Locale getDefaultLocale(Properties props, String defaultLocale) { String localeString = getProperty(props, "ofbiz.locale.default", defaultLocale); String locales[] = localeString.split("_"); Locale locale = null; @@ -168,7 +168,7 @@ public final class Config { return locale; } - private TimeZone getDefaultTimeZone(Properties props) { + private static TimeZone getDefaultTimeZone(Properties props) { String defaultTimezone = getProperty(props, "ofbiz.timeZone.default", TimeZone.getDefault().getID()); return TimeZone.getTimeZone(defaultTimezone); } diff --git a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/TestRunContainer.java b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/TestRunContainer.java index 008330a42a..b193b2b714 100644 --- a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/TestRunContainer.java +++ b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/TestRunContainer.java @@ -112,7 +112,7 @@ public class TestRunContainer implements Container { return name; } - private void setLoggerLevel(String logLevel) { + private static void setLoggerLevel(String logLevel) { if (logLevel != null) { int selectedLogLevel = Debug.getLevelFromString(logLevel); @@ -123,7 +123,7 @@ public class TestRunContainer implements Container { } } - private JunitSuiteWrapper prepareJunitSuiteWrapper(Map testProps) throws ContainerException { + private static JunitSuiteWrapper prepareJunitSuiteWrapper(Map testProps) throws ContainerException { String component = testProps.get("component"); String suiteName = testProps.get("suitename"); String testCase = testProps.get("case"); @@ -144,7 +144,7 @@ public class TestRunContainer implements Container { } } - private void logTestSuiteResults(TestSuite suite, TestResult results) { + private static void logTestSuiteResults(TestSuite suite, TestResult results) { Debug.logInfo("[JUNIT] Results for test suite: " + suite.getName(), module); Debug.logInfo("[JUNIT] Pass: " + results.wasSuccessful() + " | # Tests: " + results.runCount() + " | # Failed: " + results.failureCount() + " # Errors: " + results.errorCount(), module); @@ -159,7 +159,7 @@ public class TestRunContainer implements Container { } } - private void logErrorsOrFailures(Enumeration errorsOrFailures) { + private static void logErrorsOrFailures(Enumeration errorsOrFailures) { if (!errorsOrFailures.hasMoreElements()) { Debug.logInfo("None", module); } else { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlEventListener.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlEventListener.java index ed48de42e9..22fd6323a3 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlEventListener.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlEventListener.java @@ -202,7 +202,7 @@ public class ControlEventListener implements HttpSessionListener { totalPassiveSessions--; } - private String getUserLoginSession(HttpSession session) { + private static String getUserLoginSession(HttpSession session) { Map userLoginSession = UtilGenerics.cast(session.getAttribute("userLoginSession")); String sessionData = null; diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java index a6f5e5a59b..8b4ef50688 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java @@ -847,7 +847,7 @@ public class RequestHandler { return nextPage; } - private void callRedirect(String url, HttpServletResponse resp, HttpServletRequest req, String statusCodeString) throws RequestHandlerException { + private static void callRedirect(String url, HttpServletResponse resp, HttpServletRequest req, String statusCodeString) throws RequestHandlerException { if (Debug.infoOn()) Debug.logInfo("Sending redirect to: [" + url + "]. " + showSessionId(req), module); // set the attributes in the session so we can access it. Enumeration attributeNameEnum = UtilGenerics.cast(req.getAttributeNames()); @@ -1070,7 +1070,7 @@ public class RequestHandler { } } - private void addNameValuePairToQueryString(StringBuilder queryString, String name, String value) { + private static void addNameValuePairToQueryString(StringBuilder queryString, String name, String value) { if (UtilValidate.isNotEmpty(value)) { if (queryString.length() > 1) { queryString.append("&"); @@ -1296,7 +1296,7 @@ public class RequestHandler { } } - private String showSessionId(HttpServletRequest request) { + private static String showSessionId(HttpServletRequest request) { Delegator delegator = (Delegator) request.getAttribute("delegator"); boolean showSessionIdInLog = EntityUtilProperties.propertyValueEqualsIgnoreCase("requestHandler", "show-sessionId-in-log", "Y", delegator); if (showSessionIdInLog) { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java index e3638f584c..3a99899c11 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/SOAPEventHandler.java @@ -84,7 +84,7 @@ public class SOAPEventHandler implements EventHandler { if (wsdlReq != null) { String serviceName = RequestHandler.getOverrideViewUri(request.getPathInfo()); DispatchContext dctx = dispatcher.getDispatchContext(); - String locationUri = this.getLocationURI(request); + String locationUri = getLocationURI(request); if (serviceName != null) { Document wsdl = null; @@ -211,7 +211,7 @@ public class SOAPEventHandler implements EventHandler { return null; } - private void validateSOAPBody(SOAPBody reqBody) throws EventHandlerException { + private static void validateSOAPBody(SOAPBody reqBody) throws EventHandlerException { // ensure the SOAPBody contains only one service call request Integer numServiceCallRequests = 0; Iterator serviceIter = UtilGenerics.cast(reqBody.getChildElements()); @@ -224,7 +224,8 @@ public class SOAPEventHandler implements EventHandler { } } - private void createAndSendSOAPResponse(Map serviceResults, String serviceName, HttpServletResponse response) throws EventHandlerException { + private static void createAndSendSOAPResponse(Map serviceResults, String serviceName, + HttpServletResponse response) throws EventHandlerException { try { // setup the response if (Debug.verboseOn()) Debug.logVerbose("[EventHandler] : Setting up response message", module); @@ -266,15 +267,18 @@ public class SOAPEventHandler implements EventHandler { } } - private void sendError(HttpServletResponse res, String errorMessage, String serviceName) throws EventHandlerException { + private static void sendError(HttpServletResponse res, String errorMessage, String serviceName) + throws EventHandlerException { // setup the response sendError(res, ServiceUtil.returnError(errorMessage), serviceName); } - private void sendError(HttpServletResponse res, List errorMessages, String serviceName) throws EventHandlerException { + private static void sendError(HttpServletResponse res, List errorMessages, String serviceName) + throws EventHandlerException { sendError(res, ServiceUtil.returnError(errorMessages.toString()), serviceName); } - private void sendError(HttpServletResponse res, Object object, String serviceName) throws EventHandlerException { + private static void sendError(HttpServletResponse res, Object object, String serviceName) + throws EventHandlerException { try { // setup the response res.setContentType("text/xml"); @@ -314,7 +318,7 @@ public class SOAPEventHandler implements EventHandler { } } - private String getLocationURI(HttpServletRequest request) { + private static String getLocationURI(HttpServletRequest request) { StringBuilder uri = new StringBuilder(); uri.append(request.getScheme()); uri.append("://"); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java index 637adb3c00..7556ee4ccf 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelForm.java @@ -838,7 +838,7 @@ public abstract class ModelForm extends ModelWidget { } } - private void addUpdateField(ModelFormFieldBuilder builder, Set useWhenFields, + private static void addUpdateField(ModelFormFieldBuilder builder, Set useWhenFields, List fieldBuilderList, Map fieldBuilderMap) { if (!builder.getUseWhen().isEmpty() || useWhenFields.contains(builder.getName())) { useWhenFields.add(builder.getName()); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenu.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenu.java index e9b1122248..6ac7be7adc 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenu.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenu.java @@ -327,7 +327,7 @@ public class ModelMenu extends ModelWidget { * add/override modelMenuItem using the menuItemList and menuItemMap * */ - private void addUpdateMenuItem(ModelMenuItem modelMenuItem, List menuItemList, + private static void addUpdateMenuItem(ModelMenuItem modelMenuItem, List menuItemList, Map menuItemMap) { ModelMenuItem existingMenuItem = menuItemMap.get(modelMenuItem.getName()); if (existingMenuItem != null) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java index 44b29458a2..7048648a64 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java @@ -273,7 +273,7 @@ public class ModelMenuItem extends ModelWidget { visitor.visit(this); } - private void addUpdateMenuItem(ModelMenuItem modelMenuItem, List menuItemList, + private static void addUpdateMenuItem(ModelMenuItem modelMenuItem, List menuItemList, Map menuItemMap) { ModelMenuItem existingMenuItem = menuItemMap.get(modelMenuItem.getName()); if (existingMenuItem != null) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java index 832d5c285b..b9e93e2112 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTheme.java @@ -265,7 +265,7 @@ public class ModelTheme implements Serializable { * @param initWidgetPropertiesMap * @param widgetProperties */ - private void addWidgetProperties(Map initWidgetPropertiesMap, Element widgetProperties) { + private static void addWidgetProperties(Map initWidgetPropertiesMap, Element widgetProperties) { for (Element childElement : UtilXml.childElementList(widgetProperties)) { switch (childElement.getNodeName()) { case "default-view-size": diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java index f71cdc7b0d..d4bb463ec3 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java @@ -491,8 +491,8 @@ public class FormRenderer { return maxNumOfColumns; } - private void renderHiddenIgnoredFields(Appendable writer, Map context, FormStringRenderer formStringRenderer, - List fieldList) throws IOException { + private static void renderHiddenIgnoredFields(Appendable writer, Map context, + FormStringRenderer formStringRenderer, List fieldList) throws IOException { for (ModelFormField modelFormField : fieldList) { FieldInfo fieldInfo = modelFormField.getFieldInfo(); @@ -591,7 +591,7 @@ public class FormRenderer { } // do all of the hidden fields... - this.renderHiddenIgnoredFields(writer, localContext, formStringRenderer, hiddenIgnoredFieldList); + renderHiddenIgnoredFields(writer, localContext, formStringRenderer, hiddenIgnoredFieldList); Iterator innerFormFieldIter = innerFormFields.iterator(); while (innerFormFieldIter.hasNext()) { @@ -636,7 +636,7 @@ public class FormRenderer { } } else { // do all of the hidden fields... - this.renderHiddenIgnoredFields(writer, localContext, formStringRenderer, hiddenIgnoredFieldList); + renderHiddenIgnoredFields(writer, localContext, formStringRenderer, hiddenIgnoredFieldList); Iterator mainFieldIter = mainFieldList.iterator(); while (mainFieldIter.hasNext()) { @@ -983,7 +983,7 @@ public class FormRenderer { // render all hidden & ignored fields List hiddenIgnoredFieldList = getHiddenIgnoredFields(context, alreadyRendered, tempFieldList, -1); - this.renderHiddenIgnoredFields(writer, context, formStringRenderer, hiddenIgnoredFieldList); + renderHiddenIgnoredFields(writer, context, formStringRenderer, hiddenIgnoredFieldList); // render formatting wrapper open // This should be covered by fieldGroup.renderStartString diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/fo/FoFormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/fo/FoFormRenderer.java index 9c4bfeb814..19b859f536 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/fo/FoFormRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/fo/FoFormRenderer.java @@ -77,7 +77,7 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend this.response = response; } - private void makeBlockString(Appendable writer, String widgetStyle, String text) throws IOException { + private static void makeBlockString(Appendable writer, String widgetStyle, String text) throws IOException { writer.append(" context, DisplayField displayField) throws IOException { ModelFormField modelFormField = displayField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), displayField.getDescription(context)); + makeBlockString(writer, modelFormField.getWidgetStyle(), displayField.getDescription(context)); appendWhitespace(writer); } @Override public void renderHyperlinkField(Appendable writer, Map context, HyperlinkField hyperlinkField) throws IOException { ModelFormField modelFormField = hyperlinkField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), hyperlinkField.getDescription(context)); + makeBlockString(writer, modelFormField.getWidgetStyle(), hyperlinkField.getDescription(context)); appendWhitespace(writer); } @@ -110,21 +110,21 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend @Override public void renderTextField(Appendable writer, Map context, TextField textField) throws IOException { ModelFormField modelFormField = textField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderTextareaField(Appendable writer, Map context, TextareaField textareaField) throws IOException { ModelFormField modelFormField = textareaField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textareaField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textareaField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderDateTimeField(Appendable writer, Map context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateTimeField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateTimeField.getDefaultValue(context))); appendWhitespace(writer); } @@ -137,9 +137,9 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend if (UtilValidate.isNotEmpty(currentValue) && "first-in-list".equals(dropDownField.getCurrent())) { String explicitDescription = dropDownField.getCurrentDescription(context); if (UtilValidate.isNotEmpty(explicitDescription)) { - this.makeBlockString(writer, modelFormField.getWidgetStyle(), explicitDescription); + makeBlockString(writer, modelFormField.getWidgetStyle(), explicitDescription); } else { - this.makeBlockString(writer, modelFormField.getWidgetStyle(), FieldInfoWithOptions.getDescriptionForOptionKey(currentValue, allOptionValues)); + makeBlockString(writer, modelFormField.getWidgetStyle(), FieldInfoWithOptions.getDescriptionForOptionKey(currentValue, allOptionValues)); } } else { boolean optionSelected = false; @@ -147,13 +147,13 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend String noCurrentSelectedKey = dropDownField.getNoCurrentSelectedKey(context); if ((UtilValidate.isNotEmpty(currentValue) && currentValue.equals(optionValue.getKey()) && "selected".equals(dropDownField.getCurrent())) || (UtilValidate.isEmpty(currentValue) && noCurrentSelectedKey != null && noCurrentSelectedKey.equals(optionValue.getKey()))) { - this.makeBlockString(writer, modelFormField.getWidgetStyle(), optionValue.getDescription()); + makeBlockString(writer, modelFormField.getWidgetStyle(), optionValue.getDescription()); optionSelected = true; break; } } if (!optionSelected) { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } } appendWhitespace(writer); @@ -161,22 +161,22 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend @Override public void renderCheckField(Appendable writer, Map context, CheckField checkField) throws IOException { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override public void renderRadioField(Appendable writer, Map context, RadioField radioField) throws IOException { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override public void renderSubmitField(Appendable writer, Map context, SubmitField submitField) throws IOException { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override public void renderResetField(Appendable writer, Map context, ResetField resetField) throws IOException { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override @@ -427,28 +427,28 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend @Override public void renderTextFindField(Appendable writer, Map context, TextFindField textFindField) throws IOException { ModelFormField modelFormField = textFindField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textFindField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textFindField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderRangeFindField(Appendable writer, Map context, RangeFindField rangeFindField) throws IOException { ModelFormField modelFormField = rangeFindField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, rangeFindField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, rangeFindField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderDateFindField(Appendable writer, Map context, DateFindField dateFindField) throws IOException { ModelFormField modelFormField = dateFindField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateFindField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, dateFindField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderLookupField(Appendable writer, Map context, LookupField lookupField) throws IOException { ModelFormField modelFormField = lookupField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, lookupField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, lookupField.getDefaultValue(context))); appendWhitespace(writer); } @@ -458,19 +458,19 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend @Override public void renderFileField(Appendable writer, Map context, FileField textField) throws IOException { ModelFormField modelFormField = textField.getModelFormField(); - this.makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context))); + makeBlockString(writer, modelFormField.getWidgetStyle(), modelFormField.getEntry(context, textField.getDefaultValue(context))); appendWhitespace(writer); } @Override public void renderPasswordField(Appendable writer, Map context, PasswordField passwordField) throws IOException { - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override public void renderImageField(Appendable writer, Map context, ImageField imageField) throws IOException { // TODO - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } @Override @@ -486,7 +486,7 @@ public class FoFormRenderer extends HtmlWidgetRenderer implements FormStringRend @Override public void renderBanner(Appendable writer, Map context, ModelForm.Banner banner) throws IOException { // TODO - this.makeBlockString(writer, null, ""); + makeBlockString(writer, null, ""); } public void renderHyperlinkTitle(Appendable writer, Map context, ModelFormField modelFormField, String titleText) throws IOException { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java index 089f167aed..78b13af83b 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java @@ -145,7 +145,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { return environment; } - private boolean isDisableIfEmpty(ModelMenuItem menuItem, Map context) { + private static boolean isDisableIfEmpty(ModelMenuItem menuItem, Map context) { boolean disabled = false; String disableIfEmpty = menuItem.getDisableIfEmpty(); if (UtilValidate.isNotEmpty(disableIfEmpty)) { @@ -161,7 +161,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { return disabled; } - private boolean isHideIfSelected(ModelMenuItem menuItem, Map context) { + private static boolean isHideIfSelected(ModelMenuItem menuItem, Map context) { ModelMenu menu = menuItem.getModelMenu(); String currentMenuItemName = menu.getSelectedMenuItemContextFieldName(context); String currentItemName = menuItem.getName(); @@ -313,7 +313,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { } style += selectedStyle ; } - if (this.isDisableIfEmpty(menuItem, context)) { + if (isDisableIfEmpty(menuItem, context)) { style = menuItem.getDisabledTitleStyle(); } if (style == null) {