This is an automated email from the ASF dual-hosted git repository.
surajk pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git The following commit(s) were added to refs/heads/trunk by this push: new 4f53828 Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors in framework component. (OFBIZ-11805) Thanks Jacques Le Roux and Ritesh Kumar for review. new bbfb390 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 4f53828 is described below commit 4f53828beaaeaaf5a15111b884b5bd8c8052a031 Author: Suraj Khurana <[hidden email]> AuthorDate: Mon Jul 6 15:29:58 2020 +0530 Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors in framework component. (OFBIZ-11805) Thanks Jacques Le Roux and Ritesh Kumar for review. --- .../apache/ofbiz/base/concurrent/ExecutionPool.java | 2 +- .../ofbiz/base/container/AdminServerContainer.java | 4 ++-- .../java/org/apache/ofbiz/base/util/GroovyUtil.java | 2 +- .../java/org/apache/ofbiz/base/util/UtilHttp.java | 2 +- .../java/org/apache/ofbiz/base/util/UtilMisc.java | 2 +- .../org/apache/ofbiz/base/util/UtilProperties.java | 2 +- .../org/apache/ofbiz/base/util/UtilValidate.java | 2 +- .../util/collections/ResourceBundleMapWrapper.java | 4 ++-- .../ofbiz/catalina/container/CatalinaContainer.java | 4 ++-- .../java/org/apache/ofbiz/common/FindServices.java | 6 +++--- .../org/apache/ofbiz/common/UrlServletHelper.java | 8 ++++---- .../apache/ofbiz/common/email/EmailServices.java | 2 +- .../apache/ofbiz/common/image/ImageTransform.java | 2 +- .../apache/ofbiz/entity/model/ModelViewEntity.java | 10 +++++----- .../ofbiz/entityext/eca/EntityEcaCondition.java | 4 ++-- .../apache/ofbiz/entityext/eca/EntityEcaRule.java | 6 +++--- .../synchronization/EntitySyncContext.java | 2 +- .../ofbiz/minilang/method/envops/CreateObject.java | 2 +- .../org/apache/ofbiz/service/job/JobManager.java | 12 ++++++------ .../java/org/apache/ofbiz/base/start/Config.java | 4 ++-- .../java/org/apache/ofbiz/base/start/Start.java | 2 +- .../apache/ofbiz/base/start/StartupCommandUtil.java | 21 ++++++++++----------- .../apache/ofbiz/webapp/control/ContextFilter.java | 6 +++--- .../org/apache/ofbiz/webapp/control/JWTManager.java | 10 +++++----- .../apache/ofbiz/webapp/control/LoginWorker.java | 2 +- .../apache/ofbiz/webapp/control/RequestHandler.java | 2 +- .../apache/ofbiz/webapp/event/SOAPEventHandler.java | 2 +- .../ofbiz/webapp/ftl/OfbizContentTransform.java | 4 ++-- .../webtools/labelmanager/LabelManagerFactory.java | 2 +- .../java/org/apache/ofbiz/widget/WidgetWorker.java | 2 +- .../org/apache/ofbiz/widget/model/ModelForm.java | 6 +++--- .../apache/ofbiz/widget/model/ModelFormField.java | 8 ++++---- .../ofbiz/widget/model/ModelScreenCondition.java | 2 +- .../apache/ofbiz/widget/renderer/FormRenderer.java | 4 ++-- .../org/apache/ofbiz/widget/renderer/Paginator.java | 4 ++-- 35 files changed, 79 insertions(+), 80 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/concurrent/ExecutionPool.java b/framework/base/src/main/java/org/apache/ofbiz/base/concurrent/ExecutionPool.java index 5559fe3..27192cd 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/concurrent/ExecutionPool.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/concurrent/ExecutionPool.java @@ -159,7 +159,7 @@ public final class ExecutionPool { @Override public final boolean equals(Object other) { - if(other instanceof Pulse) { + if (other instanceof Pulse) { return timeDiff((Pulse) other) == 0; } return false; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/container/AdminServerContainer.java b/framework/base/src/main/java/org/apache/ofbiz/base/container/AdminServerContainer.java index 3f6e3f2..bf41f23 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/container/AdminServerContainer.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/container/AdminServerContainer.java @@ -115,7 +115,7 @@ public final class AdminServerContainer implements Container { writer.println(serverResponse); // if the client request is shutdown, execute shutdown sequence - if(clientCommand.equals(OfbizSocketCommand.SHUTDOWN)) { + if (clientCommand.equals(OfbizSocketCommand.SHUTDOWN)) { writer.flush(); Start.getInstance().stop(); } @@ -123,7 +123,7 @@ public final class AdminServerContainer implements Container { } private OfbizSocketCommand determineClientCommand(String request) { - if(!isValidRequest(request)) { + if (!isValidRequest(request)) { return OfbizSocketCommand.FAIL; } return OfbizSocketCommand.valueOf(request.substring(request.indexOf(':') + 1)); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java index b9cefd5..56b58b4 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/GroovyUtil.java @@ -117,7 +117,7 @@ public final class GroovyUtil { //analyse expression to find variables by split non alpha, ignoring "_" to allow my_variable usage String [] variables = expression.split("[\\P{Alpha}&&[^_]]+"); for (String variable: variables) { - if(!vars.containsKey(variable)) { + if (!vars.containsKey(variable)) { vars.put(variable, null); } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java index 1365884..c506219 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java @@ -1139,7 +1139,7 @@ public final class UtilHttp { } // Default to sameorigin if (UtilValidate.isNotEmpty(xFrameOption)) { - if(!"none".equals(xFrameOption)) { + if (!"none".equals(xFrameOption)) { resp.addHeader("x-frame-options", xFrameOption); } } else { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java index 948e1dd..3588be4 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java @@ -355,7 +355,7 @@ public final class UtilMisc { */ @SafeVarargs public static <T> List<T> toList(T... data) { - if(data == null){ + if (data == null){ return null; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java index 1e320e4..b092ff0 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java @@ -954,7 +954,7 @@ public final class UtilProperties implements Serializable { // Support old way of specifying xml:lang value. // Old way: en_AU, new way: en-AU Element value = UtilXml.firstChildElement(property, "value", "xml:lang", correctedLocaleString); - if( value == null ) { + if ( value == null ) { value = UtilXml.firstChildElement(property, "value", "xml:lang", localeString); } if (value != null) { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java index 1069c4c..5c1f309 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java @@ -1082,7 +1082,7 @@ public final class UtilValidate { String first4digs = cc.substring(0, 4); String first2digs = cc.substring(0, 2); - if(((Integer.compare(cc.length(), 16) == 0) && "35".equals(first2digs)) || ((Integer.compare(cc.length(), 15) == 0) && ("2131".equals(first4digs) || "1800".equals(first4digs)))) { + if (((Integer.compare(cc.length(), 16) == 0) && "35".equals(first2digs)) || ((Integer.compare(cc.length(), 15) == 0) && ("2131".equals(first4digs) || "1800".equals(first4digs)))) { return isCreditCard(cc); } return false; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java index df74c0e..a209e17 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ResourceBundleMapWrapper.java @@ -203,7 +203,7 @@ public class ResourceBundleMapWrapper implements Map<String, Object>, Serializab @Override public int size() { - if(isMapInitialized) { + if (isMapInitialized) { // this is an approximate size, won't include elements from parent bundles return topLevelMap.size() -1; } @@ -248,7 +248,7 @@ public class ResourceBundleMapWrapper implements Map<String, Object>, Serializab @Override public Object get(Object arg0) { Object value = null; - if(isMapInitialized) { + if (isMapInitialized) { value = this.topLevelMap.get(arg0); } 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 d647af2..fafa9b8 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 @@ -216,7 +216,7 @@ public class CatalinaContainer implements Container { if (UtilValidate.isEmpty(virtualHosts)) { host = (Host) tomcat.getEngine().findChild(tomcat.getEngine().getDefaultHost()); - if(host == null) { + if (host == null) { host = tomcat.getHost(); } } else { @@ -459,7 +459,7 @@ public class CatalinaContainer implements Container { webResourceInfos.forEach(appInfo -> webappsMounts.addAll(getWebappMounts(appInfo))); for (ComponentConfig.WebappInfo appInfo: webResourceInfos) { - if(webappsMounts.removeAll(getWebappMounts(appInfo))) { + if (webappsMounts.removeAll(getWebappMounts(appInfo))) { // webapp is not yet loaded if (!appInfo.location.isEmpty()) { futures.add(executor.submit(createCallableContext(tomcat, appInfo, clusterProp, configuration))); diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java index cd6a404..8efc0bf 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java @@ -290,7 +290,7 @@ public class FindServices { } if (UtilValidate.isNotEmpty(currentGroup)){ List<EntityCondition> groupedConditions = new LinkedList<>(); - if(savedGroups.get(currentGroup) != null) { + if (savedGroups.get(currentGroup) != null) { groupedConditions.addAll(savedGroups.get(currentGroup)); } groupedConditions.add(createSingleCondition(modelField, operation, fieldValue, ignoreCase, delegator, context)); @@ -474,7 +474,7 @@ public class FindServices { } context.put("viewIndex", viewIndex); - Map<String, Object> result = performFind(dctx,context); + Map<String, Object> result = performFind(dctx, context); int start = viewIndex * viewSize; List<GenericValue> list = null; @@ -795,7 +795,7 @@ public class FindServices { public static Map<String, Object> performFindItem(DispatchContext dctx, Map<String, Object> context) { context.put("viewSize", 1); context.put("viewIndex", 0); - Map<String, Object> result = org.apache.ofbiz.common.FindServices.performFind(dctx,context); + Map<String, Object> result = org.apache.ofbiz.common.FindServices.performFind(dctx, context); List<GenericValue> list = null; GenericValue item= null; diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/UrlServletHelper.java b/framework/common/src/main/java/org/apache/ofbiz/common/UrlServletHelper.java index ee09e20..62a0921 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/UrlServletHelper.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/UrlServletHelper.java @@ -133,19 +133,19 @@ public final class UrlServletHelper { } //Set query string parameters to url - if(UtilValidate.isNotEmpty(viewIndex)){ + if (UtilValidate.isNotEmpty(viewIndex)){ urlBuilder.append("/~VIEW_INDEX=" + viewIndex); request.setAttribute("VIEW_INDEX", viewIndex); } - if(UtilValidate.isNotEmpty(viewSize)){ + if (UtilValidate.isNotEmpty(viewSize)){ urlBuilder.append("/~VIEW_SIZE=" + viewSize); request.setAttribute("VIEW_SIZE", viewSize); } - if(UtilValidate.isNotEmpty(viewSort)){ + if (UtilValidate.isNotEmpty(viewSort)){ urlBuilder.append("/~VIEW_SORT=" + viewSort); request.setAttribute("VIEW_SORT", viewSort); } - if(UtilValidate.isNotEmpty(searchString)){ + if (UtilValidate.isNotEmpty(searchString)){ urlBuilder.append("/~SEARCH_STRING=" + searchString); request.setAttribute("SEARCH_STRING", searchString); } diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java index a19ca3f..8ea8faf 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java @@ -545,7 +545,7 @@ public class EmailServices { try (Writer writer = new StringWriter(); ByteArrayOutputStream baos = new ByteArrayOutputStream()) { // substitute the freemarker variables... ScreenStringRenderer foScreenStringRenderer = null; - if(MimeConstants.MIME_PLAIN_TEXT.equals(attachmentType)){ + if (MimeConstants.MIME_PLAIN_TEXT.equals(attachmentType)){ foScreenStringRenderer = new MacroScreenRenderer(visualTheme.getModelTheme(), "screentext"); }else{ foScreenStringRenderer = new MacroScreenRenderer(visualTheme.getModelTheme(), "screenfop"); diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java b/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java index 931a11b..5b0ba4c 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java @@ -283,7 +283,7 @@ public class ImageTransform { public static BufferedImage toBufferedImage(Image image, int bufImgType) { /** Check if the image isn't already a BufferedImage instance */ - if( image instanceof BufferedImage ) { + if ( image instanceof BufferedImage ) { return( (BufferedImage)image ); } /** Full image loading */ diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java index 76bb81a..95249b9 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java @@ -1064,7 +1064,7 @@ public class ModelViewEntity extends ModelEntity { */ @Override public void makeAliasColName(StringBuilder colNameBuffer, StringBuilder fieldTypeBuffer, ModelViewEntity modelViewEntity, ModelReader modelReader) { - if(UtilValidate.isEmpty(entityAlias) + if (UtilValidate.isEmpty(entityAlias) && UtilValidate.isEmpty(field) && UtilValidate.isNotEmpty(value)){ colNameBuffer.append(value); @@ -1305,7 +1305,7 @@ public class ModelViewEntity extends ModelEntity { public EntityCondition getWhereCondition(ModelFieldTypeReader modelFieldTypeReader, List<String> entityAliasStack) { List<EntityCondition> conditionList = new LinkedList<>(); - if(this.filterByDate) { + if (this.filterByDate) { conditionList.add(EntityUtil.getFilterByDateExpr()); } if (this.whereCondition != null) { @@ -1444,7 +1444,7 @@ public class ModelViewEntity extends ModelEntity { } } - if(this.viewEntityCondition.filterByDate) { + if (this.viewEntityCondition.filterByDate) { List<EntityCondition> conditionList = new LinkedList<>(); conditionList.add(entityCondition); conditionList.add(EntityUtil.getFilterByDateExpr()); @@ -1512,11 +1512,11 @@ public class ModelViewEntity extends ModelEntity { } } - if(this.viewEntityCondition.filterByDate) { + if (this.viewEntityCondition.filterByDate) { entityConditionList.add(EntityUtil.getFilterByDateExpr()); } - if(this.viewEntityCondition.filterByDate) { + if (this.viewEntityCondition.filterByDate) { entityConditionList.add(EntityUtil.getFilterByDateExpr()); } diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java index 10cddec..f210c2a 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaCondition.java @@ -184,10 +184,10 @@ public final class EntityEcaCondition implements java.io.Serializable { protected List<String> getFieldNames() { List<String> fieldNameList = new ArrayList<>(); - if( UtilValidate.isNotEmpty(lhsValueName) ) { + if ( UtilValidate.isNotEmpty(lhsValueName) ) { fieldNameList.add(lhsValueName); } - if(!constant && UtilValidate.isNotEmpty(rhsValueName)) { + if (!constant && UtilValidate.isNotEmpty(rhsValueName)) { fieldNameList.add(rhsValueName); } return fieldNameList; diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java index 16a185b..e73ec10 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java @@ -133,15 +133,15 @@ public final class EntityEcaRule implements java.io.Serializable { // Are fields tested in a condition missing? If so, we need to load them List<String> fieldsToLoad = new ArrayList<>(); for( String conditionFieldName : conditionFieldNames) { - if( value.get(conditionFieldName) == null) { + if ( value.get(conditionFieldName) == null) { fieldsToLoad.add(conditionFieldName); } } - if(!fieldsToLoad.isEmpty()) { + if (!fieldsToLoad.isEmpty()) { Delegator delegator = dctx.getDelegator(); GenericValue oldValue = EntityQuery.use(delegator).from(entityName).where(value.getPrimaryKey()).queryOne(); - if(UtilValidate.isNotEmpty(oldValue)) { + if (UtilValidate.isNotEmpty(oldValue)) { for (String fieldName : fieldsToLoad) { value.put(fieldName, oldValue.get(fieldName)); } diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java index 4539807..7de955d 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncContext.java @@ -775,7 +775,7 @@ public class EntitySyncContext { Map<String, Object> updateEsRunResult = dispatcher.runSync("updateEntitySync", UtilMisc.toMap("entitySyncId", entitySyncId, "lastSuccessfulSynchTime", this.currentRunEndTime, "userLogin", userLogin),60,true); GenericValue entitySyncHistory = EntityQuery.use(delegator).from("EntitySyncHistory").where("startDate",startDate, "entitySyncId", entitySyncId).queryOne(); - if(entitySyncHistory != null) { + if (entitySyncHistory != null) { // store result of service call on history with results so far, should run in own tx ModelService model = dispatcher.getDispatchContext().getModelService("updateEntitySyncHistory"); Map<String, Object> updateHistoryMap = model.makeValid(entitySyncHistory, ModelService.IN_PARAM); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CreateObject.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CreateObject.java index 532795c..1388dc3 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CreateObject.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CreateObject.java @@ -112,7 +112,7 @@ public final class CreateObject extends MethodOperation { } try { Constructor<?> constructor = targetClass.getConstructor(parameterTypes); - fieldFma.put(methodContext.getEnvMap(),constructor.newInstance(args)); + fieldFma.put(methodContext.getEnvMap(), constructor.newInstance(args)); } catch (Exception e) { throw new MiniLangRuntimeException(e, this); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java index d563c97..3404601 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/JobManager.java @@ -381,7 +381,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param count @@ -401,7 +401,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param count @@ -423,7 +423,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param endTime @@ -445,7 +445,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param count @@ -488,7 +488,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param count @@ -528,7 +528,7 @@ public final class JobManager { *@param startTime * The time in milliseconds the service should run *@param frequency - * The frequency of the recurrence (HOURLY,DAILY,MONTHLY,etc) + * The frequency of the recurrence (HOURLY,DAILY,MONTHLY etc) *@param interval * The interval of the frequency recurrence *@param count 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 b807b06..38e344e 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 @@ -107,10 +107,10 @@ public final class Config { } private static String determineOfbizPropertiesFileName(List<StartupCommand> ofbizCommands) { - if(ofbizCommands.stream().anyMatch( + if (ofbizCommands.stream().anyMatch( option -> option.getName().equals(StartupCommandUtil.StartupOption.LOAD_DATA.getName()))) { return "load-data.properties"; - } else if(ofbizCommands.stream().anyMatch( + } else if (ofbizCommands.stream().anyMatch( option -> option.getName().equals(StartupCommandUtil.StartupOption.TEST.getName()))) { return "test.properties"; } else { diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java b/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java index db7a6fc..40d19dd 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java @@ -72,7 +72,7 @@ public final class Start { } CommandType commandType = CommandType.valueOf(ofbizCommands); - if(!commandType.equals(CommandType.HELP)) { + if (!commandType.equals(CommandType.HELP)) { instance.config = StartupControlPanel.init(ofbizCommands); } switch (commandType) { diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupCommandUtil.java b/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupCommandUtil.java index 19d8aba..2e2cca1 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupCommandUtil.java +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupCommandUtil.java @@ -118,7 +118,7 @@ public final class StartupCommandUtil { + System.lineSeparator() + "-l repair-columns" + System.lineSeparator() - + "-l continue-on-failure" ) + + "-l continue-on-failure") .numberOfArgs(2) .valueSeparator('=') .optionalArg(true) @@ -194,12 +194,11 @@ public final class StartupCommandUtil { static final void highlightAndPrintErrorMessage(String errorMessage) { System.err.println( - "===============================================================================" - + System.lineSeparator() - + errorMessage - + System.lineSeparator() - + "===============================================================================" - ); + "===============================================================================" + + System.lineSeparator() + + errorMessage + + System.lineSeparator() + + "==============================================================================="); } private static final Options getOfbizStartupOptions() { @@ -226,7 +225,7 @@ public final class StartupCommandUtil { .collect(Collectors.toList()); } - private static final Map<String,String> populateMapFromProperties(final Properties properties) { + private static final Map<String, String> populateMapFromProperties(final Properties properties) { return properties.entrySet().stream().collect(Collectors.toMap( entry -> String.valueOf(entry.getKey()), entry -> String.valueOf(entry.getValue()))); @@ -234,15 +233,15 @@ public final class StartupCommandUtil { private static final void validateAllCommandArguments(CommandLine commandLine) throws StartupException { // Make sure no extra options are passed - if(!commandLine.getArgList().isEmpty()) { + if (!commandLine.getArgList().isEmpty()) { throw new StartupException("unrecognized options / properties: " + commandLine.getArgList()); } // PORTOFFSET validation - if(commandLine.hasOption(StartupOption.PORTOFFSET.getName())) { + if (commandLine.hasOption(StartupOption.PORTOFFSET.getName())) { Properties optionProperties = commandLine.getOptionProperties(StartupOption.PORTOFFSET.getName()); try { int portOffset = Integer.parseInt(optionProperties.keySet().iterator().next().toString()); - if(portOffset < 0) { + if (portOffset < 0) { throw new StartupException("you can only pass positive integers to the option --" + StartupOption.PORTOFFSET.getName()); } } catch (NumberFormatException e) { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java index 027a1ba..50303cf 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java @@ -127,14 +127,14 @@ public class ContextFilter implements Filter { Delegator baseDelegator = DelegatorFactory.getDelegator(delegator.getDelegatorBaseName()); GenericValue tenantDomainName = EntityQuery.use(baseDelegator).from("TenantDomainName").where("domainName", serverName).queryOne(); String tenantId = null; - if(UtilValidate.isNotEmpty(tenantDomainName)) { + if (UtilValidate.isNotEmpty(tenantDomainName)) { tenantId = tenantDomainName.getString("tenantId"); } - if(UtilValidate.isEmpty(tenantId)) { + if (UtilValidate.isEmpty(tenantId)) { tenantId = (String) httpRequest.getAttribute("userTenantId"); } - if(UtilValidate.isEmpty(tenantId)) { + if (UtilValidate.isEmpty(tenantId)) { tenantId = httpRequest.getParameter("userTenantId"); } if (UtilValidate.isNotEmpty(tenantId)) { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java index e711421..70c23e3 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java @@ -84,8 +84,8 @@ public class JWTManager { public static String checkJWTLogin(HttpServletRequest request, HttpServletResponse response) { Delegator delegator = (Delegator) request.getAttribute("delegator"); - if(!"true".equals(EntityUtilProperties.getPropertyValue("security", "security.internal.sso.enabled", "false", delegator))) { - if(Debug.verboseOn()) { + if (!"true".equals(EntityUtilProperties.getPropertyValue("security", "security.internal.sso.enabled", "false", delegator))) { + if (Debug.verboseOn()) { Debug.logVerbose("Internal single sign on is disabled.", MODULE); } return "success"; @@ -107,7 +107,7 @@ public class JWTManager { // get userLoginId from the token and retrieve the corresponding userLogin from the database GenericValue userLogin = getUserlogin(delegator, claims); - if(UtilValidate.isNotEmpty(userLogin)) { + if (UtilValidate.isNotEmpty(userLogin)) { // check userLogin base permission and if it is enabled request.getSession().setAttribute("userLogin", userLogin); userLogin = LoginWorker.checkLogout(request, response); @@ -220,7 +220,7 @@ public class JWTManager { String headerAuthValue = request.getHeader(HttpHeaders.AUTHORIZATION); String bearerPrefix = "Bearer "; - if(UtilValidate.isEmpty(headerAuthValue) || !headerAuthValue.startsWith(bearerPrefix)) { + if (UtilValidate.isEmpty(headerAuthValue) || !headerAuthValue.startsWith(bearerPrefix)) { return null; } @@ -377,7 +377,7 @@ public class JWTManager { private static GenericValue getUserlogin(Delegator delegator, Map<String, Object> jwtMap) { String userLoginId = (String) jwtMap.get("userLoginId"); - if(UtilValidate.isEmpty(userLoginId)) { + if (UtilValidate.isEmpty(userLoginId)) { Debug.logWarning("No userLoginId found in the JWT token.", MODULE); return null; } diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java index 7e7ecd0..6bdfb43 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java @@ -412,7 +412,7 @@ public final class LoginWorker { Debug.logError(e1.getMessage(), MODULE); } - if(entityDeCrypto != null && "true".equals(forgotPwdFlag)) { + if (entityDeCrypto != null && "true".equals(forgotPwdFlag)) { try { Object decryptedPwd = entityDeCrypto.decrypt(KEY_VALUE, ModelField.EncryptMethod.TRUE, password); password = decryptedPwd.toString(); 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 dfba382..3b20718 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 @@ -1047,7 +1047,7 @@ public class RequestHandler { (requestResponse.redirectParameterMap.size() == 0 && requestResponse.redirectParameterValueMap.size() == 0)) { Map<String, Object> urlParams = UtilHttp.getUrlOnlyParameterMap(request); String queryString = UtilHttp.urlEncodeArgs(urlParams, false); - if(UtilValidate.isEmpty(queryString)) { + if (UtilValidate.isEmpty(queryString)) { return queryString; } return "?" + queryString; 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 30d68d8..0ab811a 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 @@ -194,7 +194,7 @@ public class SOAPEventHandler implements EventHandler { if (UtilProperties.getPropertyAsBoolean("service", "secureSoapAnswer", true)) { sendError(response, "Problem processing the service, check your parameters.", serviceName); } else { - if(e.getMessageList() == null) { + if (e.getMessageList() == null) { sendError(response, e.getMessage(), serviceName); } else { sendError(response, e.getMessageList(), serviceName); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizContentTransform.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizContentTransform.java index 8d197e8..7a1d4d3 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizContentTransform.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizContentTransform.java @@ -102,8 +102,8 @@ public class OfbizContentTransform implements TemplateTransformModel { newURL.append('/'); } - if(UtilValidate.isNotEmpty(imgSize)){ - if(!"/images/defaultImage.jpg".equals(requestUrl)){ + if (UtilValidate.isNotEmpty(imgSize)){ + if (!"/images/defaultImage.jpg".equals(requestUrl)){ int index = requestUrl.lastIndexOf("."); if (index > 0) { String suffix = requestUrl.substring(index); diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java index a8c333d..8292807 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java @@ -146,7 +146,7 @@ public class LabelManagerFactory { // No longer supporting old way of specifying xml:lang value. // Old way: en_AU, new way: en-AU String localeName = valueElem.getAttribute("xml:lang"); - if( localeName.contains("_")) { + if ( localeName.contains("_")) { GeneralException e = new GeneralException("Confusion in labels with the separator used between languages and countries. Please use a dash instead of an underscore."); throw e; } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java index 13ae707..a09e417 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java @@ -120,7 +120,7 @@ public final class WidgetWorker { String tokenValue = CsrfUtil.generateTokenForNonAjax(request, target); if (UtilValidate.isNotEmpty(tokenValue)){ String currentString = externalWriter.toString(); - if(currentString.startsWith("<form")) { + if (currentString.startsWith("<form")) { currentString = currentString.substring(currentString.lastIndexOf("\"")+1); } if (currentString.indexOf('?') == -1) { 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 20ca57f..453ca55 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 @@ -582,7 +582,7 @@ public abstract class ModelForm extends ModelWidget { this.paginateViewSizeLabel = paginateViewSizeLabel; String paginateStyle = formElement.getAttribute("paginate-style"); if (paginateStyle.isEmpty()) { - if(parentModel != null) { + if (parentModel != null) { this.paginateStyle = parentModel.paginateStyle; } else { this.paginateStyle = DEFAULT_PAG_STYLE; @@ -1309,7 +1309,7 @@ public abstract class ModelForm extends ModelWidget { String styles = ""; try { for (AltRowStyle altRowStyle : this.altRowStyles) { - Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(altRowStyle.useWhen),context); + Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(altRowStyle.useWhen), context); // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { Boolean boolVal = (Boolean) retVal; @@ -1345,7 +1345,7 @@ public abstract class ModelForm extends ModelWidget { try { for (AltTarget altTarget : this.altTargets) { String useWhen = FlexibleStringExpander.expandString(altTarget.useWhen, context); - Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhen),context); + Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhen), context); boolean condTrue = false; // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java index 03264a4..15be463 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java @@ -931,7 +931,7 @@ public class ModelFormField { } try { - Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhenStr),context); + Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhenStr), context); boolean condTrue = false; // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { @@ -1196,7 +1196,7 @@ public class ModelFormField { Map<String, Object> parameters = UtilGenerics.checkMap(context.get("parameters"), String.class, Object.class); if (UtilValidate.isNotEmpty(parameters)) { String fieldName = this.getModelFormField().getName(); - if( parameters.containsKey(fieldName.concat("_fld1_value"))) { + if ( parameters.containsKey(fieldName.concat("_fld1_value"))) { defaultOption = (String)parameters.get(fieldName.concat("_fld1_op")); } } @@ -3850,7 +3850,7 @@ public class ModelFormField { String useWhen = this.getUseWhen(context); if (UtilValidate.isNotEmpty(useWhen)) { try { - Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhen),context); + Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(useWhen), context); // retVal should be a Boolean, if not something weird is up... if (retVal instanceof Boolean) { @@ -3878,7 +3878,7 @@ public class ModelFormField { } try { - Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(ignoreWhen),context); + Object retVal = GroovyUtil.eval(StringUtil.convertOperatorSubstitutions(ignoreWhen), context); if (retVal instanceof Boolean) { shouldIgnore =(Boolean) retVal; diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenCondition.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenCondition.java index 44a6f36..c8a6485 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenCondition.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenCondition.java @@ -85,7 +85,7 @@ public final class ModelScreenCondition { if ("if-empty-section".equals(conditionElement.getLocalName())) { return new IfEmptySection(this, modelWidget, conditionElement); } - return super.newInstance(this, modelWidget,conditionElement); + return super.newInstance(this, modelWidget, conditionElement); } } } 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 49889aa..52d18db 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 @@ -551,7 +551,7 @@ public class FormRenderer { boolean cellOpen = false; ModelFormField modelFormField = innerDisplayHyperlinkFieldIter.next(); - if(modelFormField.shouldIgnore(localContext)) { + if (modelFormField.shouldIgnore(localContext)) { continue; } @@ -1204,7 +1204,7 @@ public class FormRenderer { if (iter instanceof EntityListIterator) { EntityListIterator eli = (EntityListIterator) iter; try { - if(eli.getResultsSizeAfterPartialList() > 0){ + if (eli.getResultsSizeAfterPartialList() > 0){ itemIndex++; } } catch (GenericEntityException gee) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java index 920d6df..359f1fe 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java @@ -71,9 +71,9 @@ public final class Paginator { } else if (entryList instanceof List<?>) { List<?> items = (List<?>) entryList; listSize = items.size(); - if(context.containsKey("result")){ + if (context.containsKey("result")){ Map<String, Object> resultMap = UtilGenerics.cast(context.get("result")); - if(resultMap.containsKey("listSize")){ + if (resultMap.containsKey("listSize")){ listSize = (int)resultMap.get("listSize"); } } |
Free forum by Nabble | Edit this page |