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 97b1688 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component. (OFBIZ-11963) Also made some related checkstyle code enhancements. Thanks Jacques for review. 97b1688 is described below commit 97b1688b0da843eb46e01a672dbc7ecf429a54f4 Author: Suraj Khurana <[hidden email]> AuthorDate: Sat Sep 12 12:05:16 2020 +0530 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component. (OFBIZ-11963) Also made some related checkstyle code enhancements. Thanks Jacques for review. --- .../apache/ofbiz/base/util/GeneralException.java | 6 +- .../ofbiz/base/util/GeneralRuntimeException.java | 2 +- .../ofbiz/base/util/HttpClientException.java | 2 +- .../org/apache/ofbiz/base/util/UtilProperties.java | 2 +- .../ofbiz/base/util/cache/HardRefCacheLine.java | 2 +- .../ofbiz/base/util/cache/SoftRefCacheLine.java | 2 +- .../util/collections/GenericMapCollection.java | 15 +++- .../base/util/collections/GenericMapEntrySet.java | 4 +- .../base/util/collections/GenericMapKeySet.java | 2 +- .../ofbiz/base/util/collections/GenericMapSet.java | 2 +- .../base/util/collections/GenericMapValues.java | 2 +- .../ofbiz/base/util/collections/MapContext.java | 10 ++- .../ofbiz/base/util/collections/MapStack.java | 6 +- .../util/collections/MultivaluedMapContext.java | 2 +- .../base/util/collections/ReadOnlyMapEntry.java | 4 +- .../ofbiz/base/util/string/UelFunctions.java | 2 +- .../apache/ofbiz/common/test/PerformFindTests.java | 4 +- .../java/org/apache/ofbiz/datafile/DataFile.java | 4 +- .../entity/condition/EntityConditionBuilder.java | 2 +- .../entity/condition/EntityConditionList.java | 4 +- .../entity/condition/EntityConditionListBase.java | 10 ++- .../entity/condition/EntityConditionParam.java | 12 +++- .../apache/ofbiz/entity/finder/ByAndFinder.java | 4 +- .../org/apache/ofbiz/entity/finder/Finder.java | 29 +++++++- .../org/apache/ofbiz/entity/finder/ListFinder.java | 4 +- .../ofbiz/entity/finder/PrimaryKeyFinder.java | 4 +- .../ofbiz/entity/test/EntityCryptoTestSuite.java | 12 ++-- .../ofbiz/entity/test/EntityQueryTestSuite.java | 17 +++++ .../apache/ofbiz/entity/test/EntityTestSuite.java | 84 ++++++++++++++-------- .../ofbiz/entity/test/EntityUtilTestSuite.java | 2 +- .../ofbiz/entity/testtools/EntityTestCase.java | 10 ++- .../entity/transaction/JNDITransactionFactory.java | 4 +- .../apache/ofbiz/entity/util/EntitySaxReader.java | 2 +- .../ofbiz/entity/util/EntityStoreOptions.java | 2 +- .../entityext/data/EntityDataLoadContainer.java | 2 +- .../synchronization/EntitySyncServices.java | 2 +- .../org/apache/ofbiz/minilang/MiniLangElement.java | 2 +- .../ofbiz/minilang/method/callops/CallService.java | 7 +- .../minilang/method/callops/CallServiceAsynch.java | 1 + .../minilang/method/callops/CallSimpleMethod.java | 22 +++--- .../ofbiz/minilang/method/callops/Return.java | 6 +- .../minilang/method/callops/SetServiceFields.java | 2 +- .../method/conditional/CombinedCondition.java | 40 ++++++++--- .../method/conditional/CompareCondition.java | 2 +- .../method/conditional/CompareFieldCondition.java | 2 +- .../minilang/method/entityops/CreateValue.java | 7 +- .../ofbiz/minilang/method/entityops/EntityAnd.java | 2 +- .../minilang/method/entityops/EntityCondition.java | 2 +- .../minilang/method/entityops/EntityCount.java | 2 +- .../ofbiz/minilang/method/entityops/EntityOne.java | 2 +- .../ofbiz/minilang/method/entityops/FindByAnd.java | 2 +- .../method/entityops/FindByPrimaryKey.java | 2 +- .../minilang/method/entityops/GetRelated.java | 2 +- .../minilang/method/entityops/GetRelatedOne.java | 2 +- .../minilang/method/entityops/RefreshValue.java | 2 +- .../minilang/method/entityops/RemoveByAnd.java | 2 +- .../minilang/method/entityops/RemoveList.java | 2 +- .../minilang/method/entityops/RemoveRelated.java | 2 +- .../minilang/method/entityops/RemoveValue.java | 2 +- .../ofbiz/minilang/method/entityops/StoreList.java | 2 +- .../minilang/method/entityops/StoreValue.java | 2 +- .../method/entityops/TransactionBegin.java | 2 +- .../method/entityops/TransactionCommit.java | 2 +- .../method/entityops/TransactionRollback.java | 5 +- .../ofbiz/minilang/method/envops/CheckErrors.java | 7 +- .../ofbiz/minilang/method/envops/CreateObject.java | 4 +- .../ofbiz/minilang/method/envops/SetOperation.java | 2 +- .../minilang/method/ifops/CheckPermission.java | 6 +- .../apache/ofbiz/minilang/method/otherops/Log.java | 4 +- .../ofbiz/minilang/operation/ConstantOper.java | 2 +- .../ofbiz/minilang/operation/InFieldOper.java | 3 +- .../ofbiz/minilang/operation/MakeInString.java | 15 +++- .../ofbiz/minilang/operation/MapProcessor.java | 18 ++++- .../org/apache/ofbiz/service/ModelPermGroup.java | 29 ++++++-- .../apache/ofbiz/service/ModelServiceReader.java | 8 +-- .../ofbiz/service/calendar/RecurrenceInfo.java | 21 +++--- .../ofbiz/service/calendar/RecurrenceRule.java | 26 ++++--- .../ofbiz/service/calendar/TemporalExpression.java | 71 ++++++++++++++++-- .../service/calendar/TemporalExpressions.java | 46 ++++++------ .../ofbiz/service/eca/ServiceEcaCondition.java | 33 ++++++--- .../ofbiz/service/engine/GenericEngineFactory.java | 4 +- .../ofbiz/service/jms/AbstractJmsListener.java | 7 +- .../org/apache/ofbiz/service/job/AbstractJob.java | 19 ++++- .../ofbiz/service/job/GenericServiceJob.java | 23 +++--- .../ofbiz/service/job/PersistedServiceJob.java | 6 +- .../org/apache/ofbiz/service/job/PurgeJob.java | 8 +-- .../ofbiz/service/mail/ServiceMcaAction.java | 24 +++++-- .../ofbiz/service/mail/ServiceMcaCondition.java | 25 +++++-- .../apache/ofbiz/service/mail/ServiceMcaRule.java | 4 +- .../ofbiz/service/rmi/ExampleRemoteClient.java | 8 ++- .../ofbiz/service/test/AbstractXmlRpcTestCase.java | 20 +++++- .../ofbiz/service/test/ServiceEntityAutoTests.java | 8 +++ .../ofbiz/service/test/ServiceSOAPTests.java | 2 +- .../ofbiz/service/testtools/OFBizTestCase.java | 10 +-- .../apache/ofbiz/service/xmlrpc/XmlRpcClient.java | 10 ++- .../ofbiz/testtools/EntityXmlAssertTest.java | 10 +-- .../apache/ofbiz/testtools/SimpleMethodTest.java | 4 +- .../apache/ofbiz/webapp/ftl/OfbizCacheStorage.java | 2 +- .../ofbiz/webapp/ftl/OfbizNumberTransform.java | 2 +- .../ofbiz/webapp/view/AbstractViewHandler.java | 2 +- .../org/apache/ofbiz/webapp/view/ViewFactory.java | 8 ++- .../ofbiz/webtools/labelmanager/LabelValue.java | 20 +++++- .../ofbiz/widget/cache/GenericWidgetOutput.java | 4 +- .../ofbiz/widget/model/AbstractModelCondition.java | 2 +- .../org/apache/ofbiz/widget/model/ModelForm.java | 12 +++- .../org/apache/ofbiz/widget/model/ModelTree.java | 4 +- .../ofbiz/widget/model/XmlWidgetVisitor.java | 4 +- .../widget/renderer/macro/MacroScreenRenderer.java | 2 +- 108 files changed, 666 insertions(+), 292 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralException.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralException.java index dd575da..3c3e301 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralException.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralException.java @@ -46,7 +46,7 @@ public class GeneralException extends Exception { throw (GeneralException) new GeneralException(message).initCause(t); } - List<String> messages = null; + private List<String> messages = null; /** * Creates new <code>GeneralException</code> without detail message. @@ -129,6 +129,10 @@ public class GeneralException extends Exception { return super.getMessage(); } + /** + * Gets message list. + * @return the message list + */ public List<String> getMessageList() { return this.messages; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralRuntimeException.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralRuntimeException.java index 01cd204..6dfc58e 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralRuntimeException.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/GeneralRuntimeException.java @@ -28,7 +28,7 @@ import java.io.PrintWriter; @SuppressWarnings("serial") public class GeneralRuntimeException extends RuntimeException { - Throwable nested = null; + private Throwable nested = null; /** * Creates new <code>GeneralException</code> without detail message. diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClientException.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClientException.java index cf123e7..63f8bd8 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClientException.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClientException.java @@ -25,7 +25,7 @@ package org.apache.ofbiz.base.util; @SuppressWarnings("serial") public class HttpClientException extends GeneralException { - Throwable nested = null; + private Throwable nested = null; public HttpClientException() { super(); 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 370d872..8b1f313 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 @@ -1077,7 +1077,7 @@ public final class UtilProperties implements Serializable { @Override public Enumeration<String> getKeys() { return new Enumeration<String>() { - Iterator<String> i = UtilGenerics.cast(properties.keySet().iterator()); + private Iterator<String> i = UtilGenerics.cast(properties.keySet().iterator()); @Override public boolean hasMoreElements() { return (i.hasNext()); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/HardRefCacheLine.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/HardRefCacheLine.java index 1467fb1..465b6ff 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/HardRefCacheLine.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/HardRefCacheLine.java @@ -19,7 +19,7 @@ package org.apache.ofbiz.base.util.cache; public abstract class HardRefCacheLine<V> extends CacheLine<V> { - public final V value; + private final V value; public HardRefCacheLine(V value, long loadTimeNanos, long expireTimeNanos) { super(loadTimeNanos, expireTimeNanos); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/SoftRefCacheLine.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/SoftRefCacheLine.java index 434d338..edc9cf7 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/SoftRefCacheLine.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/SoftRefCacheLine.java @@ -20,7 +20,7 @@ package org.apache.ofbiz.base.util.cache; @SuppressWarnings("serial") public abstract class SoftRefCacheLine<V> extends CacheLine<V> { - public final CacheSoftReference<V> ref; + private final CacheSoftReference<V> ref; public SoftRefCacheLine(V value, long loadTimeNanos, long expireTimeNanos) { super(loadTimeNanos, expireTimeNanos); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapCollection.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapCollection.java index 2177086..83ab7e0 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapCollection.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapCollection.java @@ -25,7 +25,15 @@ import java.util.List; import java.util.Map; public abstract class GenericMapCollection<K, V, M extends Map<K, V>, I> implements Collection<I> { - protected final M source; + private final M source; + + /** + * Gets source. + * @return the source + */ + public M getSource() { + return source; + } public GenericMapCollection(M source) { this.source = source; @@ -123,6 +131,11 @@ public abstract class GenericMapCollection<K, V, M extends Map<K, V>, I> impleme return appendTo(new StringBuilder()).toString(); } + /** + * Append to string builder. + * @param sb the sb + * @return the string builder + */ public StringBuilder appendTo(StringBuilder sb) { sb.append("["); Iterator<I> it = iterator(false); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapEntrySet.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapEntrySet.java index dcb8d54..601fd6f 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapEntrySet.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapEntrySet.java @@ -49,10 +49,10 @@ public abstract class GenericMapEntrySet<K, V, M extends GenericMap<K, V>> exten } Map.Entry<?, ?> other = (Map.Entry<?, ?>) item; Object key = other.getKey(); - if (!source.containsKey(key)) { + if (!getSource().containsKey(key)) { return false; } - source.remove(key); + getSource().remove(key); return true; } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapKeySet.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapKeySet.java index 9db5910..3a1bf20 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapKeySet.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapKeySet.java @@ -27,7 +27,7 @@ public abstract class GenericMapKeySet<K, V, M extends Map<K, V>> extends Generi @Override public boolean remove(Object item) { - return source.remove(item) != null; + return getSource().remove(item) != null; } } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapSet.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapSet.java index 4530ca1..280bdfd 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapSet.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapSet.java @@ -32,7 +32,7 @@ public abstract class GenericMapSet<K, V, M extends Map<K, V>, I> extends Generi return false; } Set<?> other = (Set<?>) o; - if (source.size() != other.size()) { + if (getSource().size() != other.size()) { return false; } for (I item: this) { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java index b2a5cc0..947cd71 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java @@ -50,7 +50,7 @@ public abstract class GenericMapValues<K, V, M extends Map<K, V>> extends Generi return false; } Collection<?> other = (Collection<?>) o; - if (source.size() != other.size()) { + if (getSource().size() != other.size()) { return false; } Iterator<V> it = iterator(false); diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java index bf4459a..34f8141 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java @@ -47,9 +47,15 @@ import org.apache.ofbiz.base.util.UtilGenerics; */ public class MapContext<K, V> implements Map<K, V>, LocalizedMap<V> { - private static final String MODULE = MapContext.class.getName(); + private Deque<Map<K, V>> contexts = new LinkedList<>(); - protected Deque<Map<K, V>> contexts = new LinkedList<>(); + /** + * Gets contexts. + * @return the contexts + */ + public Deque<Map<K, V>> getContexts() { + return contexts; + } /** Puts a new Map on the top of the stack */ public void push() { diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapStack.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapStack.java index 74f7058..3030a6b 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapStack.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapStack.java @@ -41,9 +41,9 @@ public class MapStack<K> extends MapContext<K, Object> { public static <K> MapStack<K> create(Map<K, Object> baseMap) { MapStack<K> newValue = new MapStack<>(); if (baseMap instanceof MapStack) { - newValue.contexts.addAll(((MapStack<K>) baseMap).contexts); + newValue.getContexts().addAll(((MapStack<K>) baseMap).getContexts()); } else { - newValue.contexts.addFirst(baseMap); + newValue.getContexts().addFirst(baseMap); } return newValue; } @@ -51,7 +51,7 @@ public class MapStack<K> extends MapContext<K, Object> { /** Does a shallow copy of the internal stack of the passed MapStack; enables simultaneous stacks that share common parent Maps */ public static <K> MapStack<K> create(MapStack<K> source) { MapStack<K> newValue = new MapStack<>(); - newValue.contexts.addAll(source.contexts); + newValue.getContexts().addAll(source.getContexts()); return newValue; } diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MultivaluedMapContext.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MultivaluedMapContext.java index 048228e..79f543f 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MultivaluedMapContext.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MultivaluedMapContext.java @@ -57,7 +57,7 @@ public class MultivaluedMapContext<K, V> extends MapContext<K, List<V>> { * @param value the value to add to the context */ public void add(K key, V value) { - List<V> cur = contexts.getFirst().get(key); + List<V> cur = getContexts().getFirst().get(key); if (cur == null) { cur = new LinkedList<>(); /* if this method is called after a context switch, copy the previous values diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ReadOnlyMapEntry.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ReadOnlyMapEntry.java index 81ca92b..53b0375 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ReadOnlyMapEntry.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/ReadOnlyMapEntry.java @@ -27,8 +27,8 @@ import org.apache.ofbiz.base.util.UtilObject; * AbstractMap.SimpleImmutableEntry */ public class ReadOnlyMapEntry<K, V> implements Map.Entry<K, V> { - protected final K key; - protected final V value; + private final K key; + private final V value; public ReadOnlyMapEntry(K key, V value) { this.key = key; diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java index 2d94fdd..9d6ffd2 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java @@ -444,7 +444,7 @@ public class UelFunctions { } protected static class Functions extends FunctionMapper { - protected final Map<String, Method> functionMap = new HashMap<>(); + private final Map<String, Method> functionMap = new HashMap<>(); public Functions() { 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 954853d..6732853 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 @@ -28,6 +28,7 @@ import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilDateTime; import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilValidate; +import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.util.EntityListIterator; @@ -56,6 +57,7 @@ public class PerformFindTests extends OFBizTestCase { } private void prepareData() throws Exception { + Delegator delegator = getDelegator(); if (EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "PERFOMFINDTEST").cache().queryOne() == null) { delegator.create("TestingType", "testingTypeId", "PERFOMFINDTEST"); delegator.create("Testing", "testingId", "PERF_TEST_1", "testingTypeId", "PERFOMFINDTEST", "testingName", "nice name one"); @@ -138,7 +140,7 @@ public class PerformFindTests extends OFBizTestCase { result = dispatcher.runSync("performFind", performFindMap); assertTrue(ServiceUtil.isSuccess(result)); foundElements = getCompleteList(result); - List<GenericValue> testingElements = delegator.findAll("Testing", false); + List<GenericValue> testingElements = getDelegator().findAll("Testing", false); assertEquals("performFind search without condition with equals on testingTypeId", testingElements.size(), foundElements.size()); //fourth test with equals condition on testingId diff --git a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/DataFile.java b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/DataFile.java index 709534b..b81919a 100644 --- a/framework/datafile/src/main/java/org/apache/ofbiz/datafile/DataFile.java +++ b/framework/datafile/src/main/java/org/apache/ofbiz/datafile/DataFile.java @@ -43,10 +43,10 @@ public class DataFile { private static final String MODULE = DataFile.class.getName(); /** List of record in the file, contains Record objects */ - protected List<Record> records = new ArrayList<>(); + private List<Record> records = new ArrayList<>(); /** Contains the definition for the file */ - protected ModelDataFile modelDataFile; + private ModelDataFile modelDataFile; /** Creates a DataFile object which will contain the parsed objects for the specified datafile, using the specified definition. * @param fileUrl The URL where the data file is located diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java index bd907d3..60b6a55 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java @@ -38,7 +38,7 @@ public class EntityConditionBuilder extends BuilderSupport { @SuppressWarnings("serial") private static class ConditionHolder implements EntityCondition { - protected EntityCondition condition; + private EntityCondition condition; protected ConditionHolder(EntityCondition condition) { this.condition = condition; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionList.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionList.java index 09fec70..2e81594 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionList.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionList.java @@ -45,7 +45,7 @@ public final class EntityConditionList<T extends EntityCondition> extends Entity * @return the size of the internal list of condition expressions */ public int getConditionListSize() { - return conditions.size(); + return getConditions().size(); } /** @@ -54,7 +54,7 @@ public final class EntityConditionList<T extends EntityCondition> extends Entity */ @SuppressWarnings("unchecked") public Iterator<T> getConditionIterator() { - return (Iterator<T>) conditions.iterator(); + return (Iterator<T>) getConditions().iterator(); } @Override diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionListBase.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionListBase.java index 178865e..f15ab68 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionListBase.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionListBase.java @@ -32,11 +32,15 @@ import org.apache.ofbiz.entity.model.ModelEntity; */ @SuppressWarnings("serial") abstract class EntityConditionListBase<T extends EntityCondition> implements EntityCondition { - private static final String MODULE = EntityConditionListBase.class.getName(); + + public List<? extends T> getConditions() { + return conditions; + } + /** The list of condition expressions to combine. */ - protected final List<? extends T> conditions; + private final List<? extends T> conditions; /** The infix operator used to combine every elements in the list of conditions. */ - protected final EntityJoinOperator operator; + private final EntityJoinOperator operator; /** * Constructs a combination of multiple condition expressions. diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionParam.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionParam.java index 448a95b..2c00caa 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionParam.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionParam.java @@ -28,8 +28,8 @@ import org.apache.ofbiz.entity.model.ModelField; */ @SuppressWarnings("serial") public class EntityConditionParam implements Serializable { - protected ModelField modelField; - protected Object fieldValue; + private ModelField modelField; + private Object fieldValue; protected EntityConditionParam() { } @@ -41,10 +41,18 @@ public class EntityConditionParam implements Serializable { this.fieldValue = fieldValue; } + /** + * Gets model field. + * @return the model field + */ public ModelField getModelField() { return modelField; } + /** + * Gets field value. + * @return the field value + */ public Object getFieldValue() { return fieldValue; } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ByAndFinder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ByAndFinder.java index 02cbac7..0d22029 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ByAndFinder.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ByAndFinder.java @@ -34,9 +34,7 @@ import org.w3c.dom.Element; @SuppressWarnings("serial") public class ByAndFinder extends ListFinder { - private static final String MODULE = ByAndFinder.class.getName(); - - protected Map<FlexibleMapAccessor<Object>, Object> fieldMap; + private Map<FlexibleMapAccessor<Object>, Object> fieldMap; public ByAndFinder(Element element) { super(element, "and"); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/Finder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/Finder.java index 86dcdf5..a4dc902 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/Finder.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/Finder.java @@ -28,14 +28,35 @@ import org.w3c.dom.Element; @SuppressWarnings("serial") public abstract class Finder implements Serializable { - protected FlexibleStringExpander entityNameExdr; - protected FlexibleStringExpander useCacheStrExdr; + private FlexibleStringExpander entityNameExdr; + + /** + * Gets entity name exdr. + * @return the entity name exdr + */ + public FlexibleStringExpander getEntityNameExdr() { + return entityNameExdr; + } + + private FlexibleStringExpander useCacheStrExdr; + + /** + * Gets use cache str exdr. + * @return the use cache str exdr + */ + public FlexibleStringExpander getUseCacheStrExdr() { + return useCacheStrExdr; + } protected Finder(Element element) { this.entityNameExdr = FlexibleStringExpander.getInstance(element.getAttribute("entity-name")); this.useCacheStrExdr = FlexibleStringExpander.getInstance(element.getAttribute("use-cache")); } + /** + * Gets entity name. + * @return the entity name + */ public String getEntityName() { String entName = this.entityNameExdr.getOriginal(); // if there is expansion syntax @@ -45,6 +66,10 @@ public abstract class Finder implements Serializable { return entName; } + /** + * Sets entity name. + * @param entityName the entity name + */ public void setEntityName(String entityName) { this.entityNameExdr = FlexibleStringExpander.getInstance(entityName); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java index 4797c8e..f869aae 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/ListFinder.java @@ -117,8 +117,8 @@ public abstract class ListFinder extends Finder { @Override public void runFind(Map<String, Object> context, Delegator delegator) throws GeneralException { - String entityName = this.entityNameExdr.expandString(context); - String useCacheStr = this.useCacheStrExdr.expandString(context); + String entityName = this.getEntityNameExdr().expandString(context); + String useCacheStr = this.getUseCacheStrExdr().expandString(context); String filterByDateStr = this.filterByDateStrExdr.expandString(context); String distinctStr = this.distinctStrExdr.expandString(context); String delegatorName = this.delegatorNameExdr.expandString(context); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/PrimaryKeyFinder.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/PrimaryKeyFinder.java index bfd3da5..33ca80b 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/PrimaryKeyFinder.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/PrimaryKeyFinder.java @@ -69,9 +69,9 @@ public class PrimaryKeyFinder extends Finder { @Override public void runFind(Map<String, Object> context, Delegator delegator) throws GeneralException { - String entityName = this.entityNameExdr.expandString(context); + String entityName = this.getEntityNameExdr().expandString(context); - String useCacheString = this.useCacheStrExdr.expandString(context); + String useCacheString = this.getUseCacheStrExdr().expandString(context); // default to false boolean useCacheBool = "true".equals(useCacheString); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityCryptoTestSuite.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityCryptoTestSuite.java index fa993e7..360af42 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityCryptoTestSuite.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityCryptoTestSuite.java @@ -21,6 +21,7 @@ package org.apache.ofbiz.entity.test; import java.util.List; import org.apache.ofbiz.base.util.UtilMisc; +import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.condition.EntityCondition; import org.apache.ofbiz.entity.condition.EntityConditionSubSelect; @@ -42,9 +43,9 @@ public class EntityCryptoTestSuite extends EntityTestCase { */ public void testCrypto() throws Exception { String nanoTime = "" + System.nanoTime(); - delegator.removeByAnd("TestingCrypto", UtilMisc.toMap("testingCryptoTypeId", "BASIC")); - delegator.create("TestingCrypto", UtilMisc.toMap("testingCryptoId", "1", "testingCryptoTypeId", "BASIC")); - GenericValue entity = EntityQuery.use(delegator).from("TestingCrypto").where("testingCryptoId", "1").queryOne(); + getDelegator().removeByAnd("TestingCrypto", UtilMisc.toMap("testingCryptoTypeId", "BASIC")); + getDelegator().create("TestingCrypto", UtilMisc.toMap("testingCryptoId", "1", "testingCryptoTypeId", "BASIC")); + GenericValue entity = EntityQuery.use(getDelegator()).from("TestingCrypto").where("testingCryptoId", "1").queryOne(); assertNull(entity.getString("unencryptedValue")); assertNull(entity.getString("encryptedValue")); entity.setString("unencryptedValue", nanoTime); @@ -65,6 +66,7 @@ public class EntityCryptoTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testCryptoEncryption() throws Exception { + Delegator delegator = getDelegator(); // clear out all values delegator.removeByAnd("TestingCrypto", UtilMisc.toMap("testingCryptoTypeId", "BASIC")); @@ -126,6 +128,7 @@ public class EntityCryptoTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testCryptoLookup() throws Exception { + Delegator delegator = getDelegator(); String nanoTime = "" + System.nanoTime(); delegator.removeByAnd("TestingCrypto", UtilMisc.toMap("testingCryptoTypeId", "LOOKUP")); @@ -166,7 +169,7 @@ public class EntityCryptoTestSuite extends EntityTestCase { */ protected EntityConditionSubSelect makeSubSelect(String nanoTime) { EntityCondition subCondition = makeSubSelectCondition(nanoTime); - return new EntityConditionSubSelect("TestingCrypto", "testingCryptoId", subCondition, true, delegator); + return new EntityConditionSubSelect("TestingCrypto", "testingCryptoId", subCondition, true, getDelegator()); } /** @@ -174,6 +177,7 @@ public class EntityCryptoTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testCryptoSubSelect() throws Exception { + Delegator delegator = getDelegator(); String nanoTime = "" + System.nanoTime(); EntityCondition condition; List<GenericValue> results; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityQueryTestSuite.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityQueryTestSuite.java index 10385bf..b0d55db 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityQueryTestSuite.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityQueryTestSuite.java @@ -24,6 +24,7 @@ import java.util.Map; import org.apache.ofbiz.base.util.UtilDateTime; import org.apache.ofbiz.base.util.UtilMisc; +import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.condition.EntityCondition; @@ -46,6 +47,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert: Compared count of number of records found by Entity Engine method with count of number of records found by EntityQuery method. */ public void testQueryCount() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "record-1", "description", "Record One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "record-2", "description", "Record Two")); @@ -65,6 +67,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testWhere() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "where-1", "description", "find me")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "where-2", "description", "find me not")); @@ -91,6 +94,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testQueryList() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryList-1", "description", "queryList record one")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryList-2", "description", "queryList record two")); @@ -114,6 +118,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 2: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testQueryFirst() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryFirst-1", "description", "first record")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryFirst-2", "description", "second record")); @@ -135,6 +140,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 2: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testQueryOne() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOne-1", "description", "query one")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOne-2", "description", "query two")); @@ -156,6 +162,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 2: Check the TestingType entity queryOneMap-3 has been resolve with the parameters map present in context */ public void testQueryOneWithContext() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOneMap-1", "description", "query one by map")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOneMap-2", "description", "query two by map")); @@ -180,6 +187,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 2: Compared 'testingTypeId' field for null which is fetched by EntityQuery method. */ public void testSelect() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "select-1", "description", "description one")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "select-2", "description", "description two")); @@ -204,6 +212,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'testingTypeId' field for null which is fetched by EntityQuery method. */ public void testDistinctAndSelect() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "distinct-1", "description", "Distinct Record")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "distinct-2", "description", "Distinct Record")); @@ -231,6 +240,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testOrderBy() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "orderBy-1", "description", "B")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "orderBy-2", "description", "C")); @@ -258,6 +268,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 5: Compared 'thruDate' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testFilterByDate() throws GenericEntityException { + Delegator delegator = getDelegator(); delegator.create("TestingType", "testingTypeId", "filterByDate-1", "description", "Filter BY Date"); delegator.create("Testing", "testingId", "testing-1", "testingTypeId", "filterByDate-1"); @@ -303,6 +314,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testMaxRows() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "maxRows-1", "description", "Max Row One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "maxRows-2", "description", "Max Row Two")); @@ -328,6 +340,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method. */ public void testFetchSize() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "fetchSize-1", "description", "Fetch Size One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "fetchSize-2", "description", "Fetch Size Two")); @@ -353,6 +366,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert: Compared first record of both the iterator. */ public void testQueryIterator() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryIterator-1", "description", "Value One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryIterator-2", "description", "Value Two")); @@ -386,6 +400,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert: Compared first record found by both the iterator. */ public void testCursorForwardOnly() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "cursorForwardOnly-1", "description", "cursorForwardOnly One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "cursorForwardOnly-2", "description", "cursorForwardOnly Two")); @@ -422,6 +437,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert: Compared first record found by both the iterators. */ public void testCursorScrollSensitive() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollSensitive-1", "description", "cursorScrollSensitive One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollSensitive-2", "description", "cursorScrollSensitive Two")); @@ -459,6 +475,7 @@ public class EntityQueryTestSuite extends EntityTestCase { * assert: Compared first record found by both the iterators. */ public void testCursorScrollInSensitive() throws GenericEntityException { + Delegator delegator = getDelegator(); List<GenericValue> testingTypes = new LinkedList<>(); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollInSensitive-1", "description", "cursorScrollInSensitive One")); testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollInSensitive-2", "description", "cursorScrollInSensitive Two")); 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 c88b4f9..5c552a4 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 @@ -43,12 +43,7 @@ import org.apache.ofbiz.base.util.Observer; import org.apache.ofbiz.base.util.UtilDateTime; import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilXml; -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.entity.DelegatorFactory; -import org.apache.ofbiz.entity.GenericEntity; -import org.apache.ofbiz.entity.GenericEntityException; -import org.apache.ofbiz.entity.GenericPK; -import org.apache.ofbiz.entity.GenericValue; +import org.apache.ofbiz.entity.*; import org.apache.ofbiz.entity.condition.EntityCondition; import org.apache.ofbiz.entity.condition.EntityOperator; import org.apache.ofbiz.entity.config.model.Datasource; @@ -86,7 +81,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testModels() throws Exception { - ModelEntity modelEntity = delegator.getModelEntity("TestingType"); + ModelEntity modelEntity = getDelegator().getModelEntity("TestingType"); assertNotNull("TestingType entity model not null", modelEntity); ModelField modelField = modelEntity.getField("description"); assertNotNull("TestingType.description field model not null", modelField); @@ -105,20 +100,20 @@ public class EntityTestSuite extends EntityTestCase { */ public void testMakeValue() throws Exception { // This method call directly stores a new value into the entity engine - GenericValue createdValue = delegator.create("TestingType", "testingTypeId", "TEST-MAKE-1", "description", "Testing Type #Make-1"); + GenericValue createdValue = getDelegator().create("TestingType", "testingTypeId", "TEST-MAKE-1", "description", "Testing Type #Make-1"); assertTrue("Created value is mutable", createdValue.isMutable()); assertFalse("Observable has not changed", createdValue.hasChanged()); // This sequence creates the GenericValue entities first, puts them in a List, then calls the delegator to store them all List<GenericValue> newValues = new LinkedList<>(); - newValues.add(delegator.makeValue("TestingType", "testingTypeId", "TEST-MAKE-2", "description", "Testing Type #Make-2")); - newValues.add(delegator.makeValue("TestingType", "testingTypeId", "TEST-MAKE-3", "description", "Testing Type #Make-3")); - newValues.add(delegator.makeValue("TestingType", "testingTypeId", "TEST-MAKE-4", "description", "Testing Type #Make-4")); - delegator.storeAll(newValues); + newValues.add(getDelegator().makeValue("TestingType", "testingTypeId", "TEST-MAKE-2", "description", "Testing Type #Make-2")); + newValues.add(getDelegator().makeValue("TestingType", "testingTypeId", "TEST-MAKE-3", "description", "Testing Type #Make-3")); + newValues.add(getDelegator().makeValue("TestingType", "testingTypeId", "TEST-MAKE-4", "description", "Testing Type #Make-4")); + getDelegator().storeAll(newValues); // finds a List of newly created values. the second parameter specifies the fields to order results by. - List<GenericValue> newlyCreatedValues = EntityQuery.use(delegator) + List<GenericValue> newlyCreatedValues = EntityQuery.use(getDelegator()) .from("TestingType") .where(EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-MAKE-%")) .orderBy("testingTypeId") @@ -131,11 +126,11 @@ public class EntityTestSuite extends EntityTestCase { */ public void testUpdateValue() throws Exception { // retrieve a sample GenericValue, make sure it's correct - delegator.removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-UPDATE-%")); - GenericValue testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); + getDelegator().removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-UPDATE-%")); + GenericValue testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); assertNull("No pre-existing type value", testValue); - delegator.create("TestingType", "testingTypeId", "TEST-UPDATE-1", "description", "Testing Type #Update-1"); - testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); + getDelegator().create("TestingType", "testingTypeId", "TEST-UPDATE-1", "description", "Testing Type #Update-1"); + testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); assertEquals("Retrieved value has the correct description", "Testing Type #Update-1", testValue.getString("description")); // Test Observable aspect assertFalse("Observable has not changed", testValue.hasChanged()); @@ -151,7 +146,7 @@ public class EntityTestSuite extends EntityTestCase { testValue.store(); assertFalse("Observable has not changed", testValue.hasChanged()); // now retrieve it again and make sure that the updated value is correct - testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); + testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-UPDATE-1").queryOne(); assertEquals("Retrieved value has the correct description", "New Testing Type #Update-1", testValue.getString("description")); } @@ -161,11 +156,11 @@ public class EntityTestSuite extends EntityTestCase { */ public void testRemoveValue() throws Exception { // Retrieve a sample GenericValue, make sure it's correct - delegator.removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-REMOVE-%")); - GenericValue testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); + getDelegator().removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-REMOVE-%")); + GenericValue testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); assertNull("No pre-existing type value", testValue); - delegator.create("TestingType", "testingTypeId", "TEST-REMOVE-1", "description", "Testing Type #Remove-1"); - testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); + getDelegator().create("TestingType", "testingTypeId", "TEST-REMOVE-1", "description", "Testing Type #Remove-1"); + testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); assertEquals("Retrieved value has the correct description", "Testing Type #Remove-1", testValue.getString("description")); testValue.remove(); assertFalse("Observable has not changed", testValue.hasChanged()); @@ -180,15 +175,17 @@ public class EntityTestSuite extends EntityTestCase { fail("Modified an immutable GenericValue"); } catch (UnsupportedOperationException e) { } - testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); + testValue = EntityQuery.use(getDelegator()).from("TestingType").where("testingTypeId", "TEST-REMOVE-1").queryOne(); assertEquals("Finding removed value returns null", null, testValue); } /** * Tests the entity cache + * @throws Exception the exception */ public void testEntityCache() throws Exception { // Test primary key cache + Delegator delegator = getDelegator(); delegator.removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-CACHE-%")); delegator.removeByCondition("TestingSubtype", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-CACHE-%")); GenericValue testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-CACHE-1").cache(true).queryOne(); @@ -344,6 +341,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ protected long flushAndRecreateTree(String descriptionPrefix) throws Exception { + Delegator delegator = getDelegator(); // // The tree has a root, the root has level1max children. // @@ -368,6 +366,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests storing data with the delegator's .create method. Also tests .findCountByCondition and .getNextSeqId */ public void testCreateTree() throws Exception { + Delegator delegator = getDelegator(); // get how many child nodes did we have before creating the tree delegator.removeByCondition("TestingNode", EntityCondition.makeCondition("description", EntityOperator.LIKE, "create:")); long created = flushAndRecreateTree("create"); @@ -382,6 +381,7 @@ public class EntityTestSuite extends EntityTestCase { * More tests of storing data with .storeAll. Also prepares data for testing view-entities (see below.) */ public void testAddMembersToTree() throws Exception { + Delegator delegator = getDelegator(); delegator.removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-TREE-%")); GenericValue testValue = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "TEST-TREE-1").cache(true).queryOne(); assertNull("No pre-existing type value", testValue); @@ -426,6 +426,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws GenericEntityException the generic entity exception */ protected void purgeTestingByTypeId(String likeTypeId) throws GenericEntityException { + Delegator delegator = getDelegator(); delegator.removeByCondition("Testing", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, likeTypeId)); delegator.removeByCondition("TestingTest", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, likeTypeId)); } @@ -438,6 +439,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws GenericEntityException the generic entity exception */ protected void createNodeMembers(String typeId, String typeDescription, String descriptionPrefix) throws GenericEntityException { + Delegator delegator = getDelegator(); delegator.removeByCondition("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.EQUALS, typeId)); delegator.create("TestingType", "testingTypeId", typeId, "description", typeDescription); int i = 0; @@ -466,6 +468,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests findByCondition and tests searching on a view-entity */ public void testCountViews() throws Exception { + Delegator delegator = getDelegator(); delegator.removeByCondition("Testing", EntityCondition.makeCondition("testingTypeId", EntityOperator.EQUALS, "TEST-COUNT-VIEW")); flushAndRecreateTree("count-views"); createNodeMembers("TEST-COUNT-VIEW", "Testing Type #Count", "count-views"); @@ -494,6 +497,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests findByCondition and a find by distinct */ public void testFindDistinct() throws Exception { + Delegator delegator = getDelegator(); delegator.removeByCondition("Testing", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-DISTINCT-%")); List<GenericValue> testingDistinctList = EntityQuery.use(delegator).from("Testing") .where(EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "TEST-DISTINCT-%")).queryList(); @@ -531,7 +535,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests a findByCondition using not like */ public void testNotLike() throws Exception { - List<GenericValue> nodes = EntityQuery.use(delegator) + List<GenericValue> nodes = EntityQuery.use(getDelegator()) .from("TestingNode") .where(EntityCondition.makeCondition("description", EntityOperator.NOT_LIKE, "root%")) .queryList(); @@ -549,7 +553,7 @@ public class EntityTestSuite extends EntityTestCase { */ public void testForeignKeyCreate() { try { - String helperName = delegator.getEntityHelper("Testing").getHelperName(); + String helperName = getDelegator().getEntityHelper("Testing").getHelperName(); Datasource datasourceInfo = EntityConfig.getDatasource(helperName); if (!datasourceInfo.getUseForeignKeys()) { Debug.logInfo("Datasource " + datasourceInfo.getName() + " use-foreign-keys set to false, skipping testForeignKeyCreate", MODULE); @@ -560,7 +564,7 @@ public class EntityTestSuite extends EntityTestCase { } GenericEntityException caught = null; try { - delegator.create("Testing", "testingId", delegator.getNextSeqId("Testing"), "testingTypeId", "NO-SUCH-KEY"); + getDelegator().create("Testing", "testingId", getDelegator().getNextSeqId("Testing"), "testingTypeId", "NO-SUCH-KEY"); } catch (GenericEntityException e) { caught = e; } @@ -572,6 +576,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests foreign key integrity by trying to remove an entity which has foreign-key dependencies. Should cause an exception. */ public void testForeignKeyRemove() throws Exception { + Delegator delegator = getDelegator(); try { String helperName = delegator.getEntityHelper("TestingNode").getHelperName(); Datasource datasourceInfo = EntityConfig.getDatasource(helperName); @@ -605,6 +610,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests the .getRelatedOne method and removeAll for removing entities */ public void testRemoveNodeMemberAndTesting() throws Exception { + Delegator delegator = getDelegator(); flushAndRecreateTree("rnmat"); createNodeMembers("TEST-RNMAT", "remove-node-member-and-testing", "rnmat"); // @@ -645,8 +651,8 @@ public class EntityTestSuite extends EntityTestCase { // change the description of all the level1 nodes EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.LIKE, "store-by-condition-a:%"); Map<String, String> fieldsToSet = UtilMisc.toMap("description", "store-by-condition-a:updated"); - delegator.storeByCondition("TestingNode", fieldsToSet, isLevel1); - List<GenericValue> updatedNodes = EntityQuery.use(delegator).from("TestingNode").where(fieldsToSet).queryList(); + getDelegator().storeByCondition("TestingNode", fieldsToSet, isLevel1); + List<GenericValue> updatedNodes = EntityQuery.use(getDelegator()).from("TestingNode").where(fieldsToSet).queryList(); int n = updatedNodes.size(); assertTrue("testStoreByCondition updated nodes > 0", n > 0); } @@ -660,7 +666,7 @@ public class EntityTestSuite extends EntityTestCase { // remove all the level1 nodes by using a condition on the description field // EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.LIKE, "remove-by-condition-a:1:%"); - int n = delegator.removeByCondition("TestingNode", isLevel1); + int n = getDelegator().removeByCondition("TestingNode", isLevel1); assertTrue("testRemoveByCondition nodes > 0", n > 0); } @@ -668,6 +674,7 @@ public class EntityTestSuite extends EntityTestCase { * Test the .removeByPrimaryKey by using findByCondition and then retrieving the GenericPk from a GenericValue */ public void testRemoveByPK() throws Exception { + Delegator delegator = getDelegator(); flushAndRecreateTree("remove-by-pk"); // // Find all the root nodes, @@ -695,6 +702,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests the .removeAll method only. */ public void testRemoveType() throws Exception { + Delegator delegator = getDelegator(); List<GenericValue> values = EntityQuery.use(delegator).from("TestingRemoveAll").queryList(); delegator.removeAll(values); values = EntityQuery.use(delegator).from("TestingRemoveAll").queryList(); @@ -716,6 +724,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will create a large number of unique items and add them to the delegator at once */ public void testCreateManyAndStoreAtOnce() throws Exception { + Delegator delegator = getDelegator(); try { List<GenericValue> newValues = new LinkedList<>(); for (int i = 0; i < TEST_COUNT; i++) { @@ -742,6 +751,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will create a large number of unique items and add them to the delegator at once */ public void testCreateManyAndStoreOneAtATime() throws Exception { + Delegator delegator = getDelegator(); try { for (int i = 0; i < TEST_COUNT; i++) { delegator.create(delegator.makeValue("Testing", "testingId", getTestId("T2-", i))); @@ -766,6 +776,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will use the large number of unique items from above and test the EntityListIterator looping through the list */ public void testEntityListIterator() throws Exception { + Delegator delegator = getDelegator(); try { List<GenericValue> newValues = new LinkedList<>(); for (int i = 0; i < TEST_COUNT; i++) { @@ -817,6 +828,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will verify transaction rollbacks using TransactionUtil. */ public void testTransactionUtilRollback() throws Exception { + Delegator delegator = getDelegator(); GenericValue testValue = delegator.makeValue("Testing", "testingId", "rollback-test"); boolean transBegin = TransactionUtil.begin(); delegator.create(testValue); @@ -829,6 +841,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will verify that a transaction which takes longer than the pre-set timeout are rolled back. */ public void testTransactionUtilMoreThanTimeout() throws Exception { + Delegator delegator = getDelegator(); GenericTransactionException caught = null; try { GenericValue testValue = delegator.makeValue("Testing", "testingId", "timeout-test"); @@ -848,6 +861,7 @@ public class EntityTestSuite extends EntityTestCase { * This test will verify that the same transaction transaction which takes less time than timeout will be committed. */ public void testTransactionUtilLessThanTimeout() throws Exception { + Delegator delegator = getDelegator(); try { GenericValue testValue = delegator.makeValue("Testing", "testingId", "timeout-test"); boolean transBegin = TransactionUtil.begin(); @@ -864,6 +878,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests field types. */ public void testFieldTypes() throws Exception { + Delegator delegator = getDelegator(); String id = "testFieldTypes"; byte[] b = new byte[100000]; for (int i = 0; i < b.length; i++) { @@ -1073,6 +1088,7 @@ public class EntityTestSuite extends EntityTestCase { * Tests EntitySaxReader, verification loading data with tag create, create-update, create-replace, delete */ public void testEntitySaxReaderCreation() throws Exception { + Delegator delegator = getDelegator(); String xmlContentLoad = "<entity-engine-xml>" + "<TestingType testingTypeId=\"JUNIT-TEST\" description=\"junit test\"/>" @@ -1107,6 +1123,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testEntitySaxReaderCreateSkip() throws Exception { + Delegator delegator = getDelegator(); String xmlContentLoad = "<entity-engine-xml>" + "<TestingType testingTypeId=\"reader-create-skip\" description=\"reader create skip\"/>" @@ -1136,6 +1153,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testEntitySaxReaderUpdate() throws Exception { + Delegator delegator = getDelegator(); String xmlContentLoad = "<entity-engine-xml>" + "<TestingType testingTypeId=\"create-update\" description=\"create update\"/>" @@ -1172,6 +1190,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testEntitySaxReaderReplace() throws Exception { + Delegator delegator = getDelegator(); String xmlContentLoad = "<entity-engine-xml>" + "<TestingType testingTypeId=\"create-replace\" description=\"reader create skip\"/>" @@ -1206,6 +1225,7 @@ public class EntityTestSuite extends EntityTestCase { * @throws Exception the exception */ public void testEntitySaxReaderDelete() throws Exception { + Delegator delegator = getDelegator(); String xmlContentLoad = "<delete>" + " <Testing testingId=\"T1\"/>" @@ -1233,6 +1253,7 @@ public class EntityTestSuite extends EntityTestCase { * Test sequence value item. */ public void testSequenceValueItem() { + Delegator delegator = getDelegator(); SequenceUtil sequencer = new SequenceUtil(delegator.getGroupHelperInfo(delegator.getEntityGroupName("SequenceValueItem")), delegator.getModelEntity("SequenceValueItem"), "seqName", "seqId"); @@ -1251,6 +1272,7 @@ public class EntityTestSuite extends EntityTestCase { * Test sequence value item with concurrent threads. */ public void testSequenceValueItemWithConcurrentThreads() { + Delegator delegator = getDelegator(); final SequenceUtil sequencer = new SequenceUtil(delegator.getGroupHelperInfo(delegator.getEntityGroupName("SequenceValueItem")), delegator.getModelEntity("SequenceValueItem"), "seqName", "seqId"); @@ -1312,7 +1334,7 @@ public class EntityTestSuite extends EntityTestCase { try { transactionStarted = TransactionUtil.begin(); for (int i = 1; i <= numberOfQueries; i++) { - List<GenericValue> rows = EntityQuery.use(delegator).from("SequenceValueItem").queryList(); + List<GenericValue> rows = EntityQuery.use(getDelegator()).from("SequenceValueItem").queryList(); totalNumberOfRows = totalNumberOfRows + rows.size(); } TransactionUtil.commit(transactionStarted); @@ -1334,7 +1356,7 @@ public class EntityTestSuite extends EntityTestCase { try { for (int i = 1; i <= numberOfQueries; i++) { transactionStarted = TransactionUtil.begin(); - List<GenericValue> rows = EntityQuery.use(delegator).from("SequenceValueItem").queryList(); + List<GenericValue> rows = EntityQuery.use(getDelegator()).from("SequenceValueItem").queryList(); totalNumberOfRows = totalNumberOfRows + rows.size(); TransactionUtil.commit(transactionStarted); } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityUtilTestSuite.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityUtilTestSuite.java index 86b1145..d18df38 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityUtilTestSuite.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityUtilTestSuite.java @@ -43,7 +43,7 @@ public class EntityUtilTestSuite extends EntityTestCase { private List<GenericValue> prepareGenericValueList() { List<GenericValue> newValues = new ArrayList<>(); for (int i = 0; i < TEST_COUNT; i++) { - newValues.add(delegator.makeValue("Testing", "testingId", StringUtil.padNumberString(String.valueOf(i), 5), + newValues.add(getDelegator().makeValue("Testing", "testingId", StringUtil.padNumberString(String.valueOf(i), 5), "description", "Description " + i % 10)); } return newValues; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/testtools/EntityTestCase.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/testtools/EntityTestCase.java index 4e5c2bd..bff685c 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/testtools/EntityTestCase.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/testtools/EntityTestCase.java @@ -25,16 +25,24 @@ import junit.framework.TestCase; public class EntityTestCase extends TestCase { - protected Delegator delegator = null; + private Delegator delegator = null; public EntityTestCase(String name) { super(name); } + /** + * Sets delegator. + * @param delegator the delegator + */ public void setDelegator(Delegator delegator) { this.delegator = delegator; } + /** + * Gets delegator. + * @return the delegator + */ public Delegator getDelegator() { return delegator; } diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java index de6b907..87cb51f 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/JNDITransactionFactory.java @@ -51,8 +51,8 @@ public class JNDITransactionFactory implements TransactionFactory { // Debug MODULE name private static final String MODULE = JNDITransactionFactory.class.getName(); - volatile TransactionManager transactionManager = null; - volatile UserTransaction userTransaction = null; + private volatile TransactionManager transactionManager = null; + private volatile UserTransaction userTransaction = null; protected static final ConcurrentHashMap<String, DataSource> DS_CACHE = new ConcurrentHashMap<>(); diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java index 41bb10c..37ef2f1 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntitySaxReader.java @@ -76,7 +76,7 @@ public class EntitySaxReader extends DefaultHandler { private static final String MODULE = EntitySaxReader.class.getName(); public static final int DEFAULT_TX_TIMEOUT = 7200; - protected org.xml.sax.Locator locator; + private org.xml.sax.Locator locator; private Delegator delegator; private EntityEcaHandler<?> ecaHandler = null; private GenericValue currentValue = null; diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityStoreOptions.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityStoreOptions.java index 8d5c464..be60425 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityStoreOptions.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityStoreOptions.java @@ -25,7 +25,7 @@ package org.apache.ofbiz.entity.util; public class EntityStoreOptions implements java.io.Serializable { /** Option for creating missing referenced values as dummy (pk-only) entries */ - protected boolean createDummyFks = false; + private boolean createDummyFks = false; /** * Default constructor. Defaults are as follows: createDummyFks = false diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java index 0d0dd90..e740865 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java @@ -494,7 +494,7 @@ public class EntityDataLoadContainer implements Container { return urlList; } - static private List<String> getLoadFiles(String fileProp) { + private static List<String> getLoadFiles(String fileProp) { List<String> fileList = new ArrayList<>(); Optional.ofNullable(fileProp) .ifPresent(props -> fileList.addAll(StringUtil.split(props, ","))); diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java index 80e7ce9..63dfd82 100644 --- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java +++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/synchronization/EntitySyncServices.java @@ -489,7 +489,7 @@ public class EntitySyncServices { esc.setSplitStartTime(); // just run this the first time, will be updated between each loop automatically while (esc.hasMoreTimeToSync()) { - esc.setTotalSplits(esc.getTotalSplits()+1); + esc.setTotalSplits(esc.getTotalSplits() + 1); ArrayList<GenericValue> valuesToCreate = esc.assembleValuesToCreate(); ArrayList<GenericValue> valuesToStore = esc.assembleValuesToStore(); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/MiniLangElement.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/MiniLangElement.java index be3bde4..7a2b148 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/MiniLangElement.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/MiniLangElement.java @@ -32,7 +32,7 @@ public class MiniLangElement { private static final String MODULE = MiniLangElement.class.getName(); private final Object lineNumber; - protected final SimpleMethod simpleMethod; + private final SimpleMethod simpleMethod; private final String tagName; public MiniLangElement(Element element, SimpleMethod simpleMethod) { diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallService.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallService.java index 968e0cf..cbc3364 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallService.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallService.java @@ -169,6 +169,7 @@ public final class CallService extends MethodOperation { @Override public boolean exec(MethodContext methodContext) throws MiniLangException { + SimpleMethod simpleMethod = getSimpleMethod(); if (methodContext.isTraceOn()) { outputTraceMessage(methodContext, "Begin call-service."); } @@ -319,9 +320,9 @@ public final class CallService extends MethodOperation { } } else { ServiceUtil.addErrors(UtilMisc.<String, String>getListFromMap(methodContext.getEnvMap(), - this.simpleMethod.getServiceErrorMessageListName()), - UtilMisc.<String, String, Object>getMapFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageMapName()), - result); + this.getSimpleMethod().getServiceErrorMessageListName()), + UtilMisc.<String, String, Object>getMapFromMap(methodContext.getEnvMap(), this.getSimpleMethod() + .getServiceErrorMessageMapName()), result); Debug.logError(new Exception(errorMessage), MODULE); } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallServiceAsynch.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallServiceAsynch.java index a34a046..ce9aecc 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallServiceAsynch.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallServiceAsynch.java @@ -63,6 +63,7 @@ public final class CallServiceAsynch extends MethodOperation { @Override public boolean exec(MethodContext methodContext) throws MiniLangException { + SimpleMethod simpleMethod = getSimpleMethod(); if (methodContext.isTraceOn()) { outputTraceMessage(methodContext, "Begin call-service-asynch."); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java index 051d513..6897431 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallSimpleMethod.java @@ -106,8 +106,8 @@ public final class CallSimpleMethod extends MethodOperation { if ("function".equals(this.scope)) { Map<String, Object> localEnv = new HashMap<>(); localEnv.putAll(methodContext.getEnvMap()); - localEnv.remove(this.simpleMethod.getEventResponseCodeName()); - localEnv.remove(this.simpleMethod.getServiceResponseMessageName()); + localEnv.remove(this.getSimpleMethod().getEventResponseCodeName()); + localEnv.remove(this.getSimpleMethod().getServiceResponseMessageName()); localContext = new MethodContext(localEnv, methodContext.getLoader(), methodContext.getMethodType()); } String returnVal = simpleMethodToCall.exec(localContext); @@ -117,30 +117,30 @@ public final class CallSimpleMethod extends MethodOperation { } if (simpleMethodToCall.getDefaultErrorCode().equals(returnVal)) { if (methodContext.getMethodType() == MethodContext.EVENT) { - methodContext.putEnv(simpleMethod.getEventResponseCodeName(), simpleMethod.getDefaultErrorCode()); + methodContext.putEnv(getSimpleMethod().getEventResponseCodeName(), getSimpleMethod().getDefaultErrorCode()); } else if (methodContext.getMethodType() == MethodContext.SERVICE) { - methodContext.putEnv(simpleMethod.getServiceResponseMessageName(), simpleMethod.getDefaultErrorCode()); + methodContext.putEnv(getSimpleMethod().getServiceResponseMessageName(), getSimpleMethod().getDefaultErrorCode()); } return false; } if (methodContext.getMethodType() == MethodContext.EVENT) { // FIXME: This doesn't make sense. We are comparing the called method's response code with this method's // response code. Since response codes are configurable per method, this code will fail. - String responseCode = (String) localContext.getEnv(this.simpleMethod.getEventResponseCodeName()); - if (this.simpleMethod.getDefaultErrorCode().equals(responseCode)) { + String responseCode = (String) localContext.getEnv(this.getSimpleMethod().getEventResponseCodeName()); + if (this.getSimpleMethod().getDefaultErrorCode().equals(responseCode)) { Debug.logWarning("Got error [" + responseCode + "] calling inline simple-method named [" + this.methodName + "] in resource [" - + this.xmlResource + "], message is " + methodContext.getEnv(this.simpleMethod.getEventErrorMessageName()), MODULE); + + this.xmlResource + "], message is " + methodContext.getEnv(this.getSimpleMethod().getEventErrorMessageName()), MODULE); return false; } } else if (methodContext.getMethodType() == MethodContext.SERVICE) { // FIXME: This doesn't make sense. We are comparing the called method's response message with this method's // response message. Since response messages are configurable per method, this code will fail. - String responseMessage = (String) localContext.getEnv(this.simpleMethod.getServiceResponseMessageName()); - if (this.simpleMethod.getDefaultErrorCode().equals(responseMessage)) { + String responseMessage = (String) localContext.getEnv(this.getSimpleMethod().getServiceResponseMessageName()); + if (this.getSimpleMethod().getDefaultErrorCode().equals(responseMessage)) { Debug.logWarning("Got error [" + responseMessage + "] calling inline simple-method named [" + this.methodName + "] in resource [" - + this.xmlResource + "], message is " + methodContext.getEnv(this.simpleMethod.getServiceErrorMessageName()) + + this.xmlResource + "], message is " + methodContext.getEnv(this.getSimpleMethod().getServiceErrorMessageName()) + ", and the error message list is: " - + methodContext.getEnv(this.simpleMethod.getServiceErrorMessageListName()), MODULE); + + methodContext.getEnv(this.getSimpleMethod().getServiceErrorMessageListName()), MODULE); return false; } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/Return.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/Return.java index f78296e..0bbe752 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/Return.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/Return.java @@ -47,12 +47,12 @@ public final class Return extends MethodOperation { public boolean exec(MethodContext methodContext) throws MiniLangException { String responseCode = responseCodeFse.expandString(methodContext.getEnvMap()); if (responseCode.isEmpty()) { - responseCode = simpleMethod.getDefaultSuccessCode(); + responseCode = getSimpleMethod().getDefaultSuccessCode(); } if (methodContext.getMethodType() == MethodContext.EVENT) { - methodContext.putEnv(simpleMethod.getEventResponseCodeName(), responseCode); + methodContext.putEnv(getSimpleMethod().getEventResponseCodeName(), responseCode); } else { - methodContext.putEnv(simpleMethod.getServiceResponseMessageName(), responseCode); + methodContext.putEnv(getSimpleMethod().getServiceResponseMessageName(), responseCode); } return false; } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java index 5268785..5f08cf1 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/SetServiceFields.java @@ -107,7 +107,7 @@ public final class SetServiceFields extends MethodOperation { methodContext.getTimeZone(), methodContext.getLocale()); if (!errorMessages.isEmpty()) { for (Object obj : errorMessages) { - simpleMethod.addErrorMessage(methodContext, (String) obj); + getSimpleMethod().addErrorMessage(methodContext, (String) obj); } throw new MiniLangRuntimeException("Errors encountered while setting service attributes for service name \"" + serviceName + "\"", this); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CombinedCondition.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CombinedCondition.java index 4bded57..ee9a9b6 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CombinedCondition.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CombinedCondition.java @@ -36,7 +36,15 @@ import org.w3c.dom.Element; */ public abstract class CombinedCondition extends MiniLangElement implements Conditional { - protected final List<Conditional> subConditions; + private final List<Conditional> subConditions; + + /** + * Gets sub conditions. + * @return the sub conditions + */ + public List<Conditional> getSubConditions() { + return subConditions; + } public CombinedCondition(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); @@ -51,6 +59,12 @@ public abstract class CombinedCondition extends MiniLangElement implements Condi this.subConditions = Collections.unmodifiableList(conditionalList); } + /** + * Pretty print. + * @param messageBuffer the message buffer + * @param methodContext the method context + * @param combineText the combine text + */ protected void prettyPrint(StringBuilder messageBuffer, MethodContext methodContext, String combineText) { messageBuffer.append("("); for (Conditional subCond : subConditions) { @@ -69,9 +83,10 @@ public abstract class CombinedCondition extends MiniLangElement implements Condi return new CombinedCondition(element, simpleMethod) { @Override public boolean checkCondition(MethodContext methodContext) throws MiniLangException { - if (subConditions.isEmpty()) + if (getSubConditions().isEmpty()) { return true; - for (Conditional subCond : subConditions) { + } + for (Conditional subCond : getSubConditions()) { if (!subCond.checkCondition(methodContext)) { return false; } @@ -100,16 +115,17 @@ public abstract class CombinedCondition extends MiniLangElement implements Condi return new CombinedCondition(element, simpleMethod) { @Override public boolean checkCondition(MethodContext methodContext) throws MiniLangException { - if (subConditions.isEmpty()) + if (getSubConditions().isEmpty()) { return true; - Conditional subCond = subConditions.get(0); + } + Conditional subCond = getSubConditions().get(0); return !subCond.checkCondition(methodContext); } @Override public void prettyPrint(StringBuilder messageBuffer, MethodContext methodContext) { messageBuffer.append("( NOT "); - if (!subConditions.isEmpty()) { - Conditional subCond = subConditions.get(0); + if (!getSubConditions().isEmpty()) { + Conditional subCond = getSubConditions().get(0); subCond.prettyPrint(messageBuffer, methodContext); } messageBuffer.append(")"); @@ -132,9 +148,10 @@ public abstract class CombinedCondition extends MiniLangElement implements Condi return new CombinedCondition(element, simpleMethod) { @Override public boolean checkCondition(MethodContext methodContext) throws MiniLangException { - if (subConditions.isEmpty()) + if (getSubConditions().isEmpty()) { return true; - for (Conditional subCond : subConditions) { + } + for (Conditional subCond : getSubConditions()) { if (subCond.checkCondition(methodContext)) { return true; } @@ -163,10 +180,11 @@ public abstract class CombinedCondition extends MiniLangElement implements Condi return new CombinedCondition(element, simpleMethod) { @Override public boolean checkCondition(MethodContext methodContext) throws MiniLangException { - if (subConditions.isEmpty()) + if (getSubConditions().isEmpty()) { return true; + } boolean trueFound = false; - for (Conditional subCond : subConditions) { + for (Conditional subCond : getSubConditions()) { if (subCond.checkCondition(methodContext)) { if (trueFound) { return false; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareCondition.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareCondition.java index 274e6f6..0c238b3 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareCondition.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareCondition.java @@ -117,7 +117,7 @@ public final class CompareCondition extends MethodOperation implements Condition // We use en locale here so constant (literal) values are converted properly. return this.compare.doCompare(fieldVal, value, targetClass, Locale.ENGLISH, methodContext.getTimeZone(), format); } catch (Exception e) { - simpleMethod.addErrorMessage(methodContext, e.getMessage()); + getSimpleMethod().addErrorMessage(methodContext, e.getMessage()); } return false; } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareFieldCondition.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareFieldCondition.java index af46dd2..280f03d 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareFieldCondition.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/conditional/CompareFieldCondition.java @@ -124,7 +124,7 @@ public final class CompareFieldCondition extends MethodOperation implements Cond try { return this.compare.doCompare(fieldVal, toFieldVal, targetClass, methodContext.getLocale(), methodContext.getTimeZone(), format); } catch (Exception e) { - simpleMethod.addErrorMessage(methodContext, e.getMessage()); + getSimpleMethod().addErrorMessage(methodContext, e.getMessage()); } return false; } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/CreateValue.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/CreateValue.java index 7c0c267..baf255f 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/CreateValue.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/CreateValue.java @@ -58,11 +58,12 @@ public final class CreateValue extends MethodOperation { @Override public boolean exec(MethodContext methodContext) throws MiniLangException { + SimpleMethod simpleMethod = getSimpleMethod(); GenericValue value = valueFma.get(methodContext.getEnvMap()); if (value == null) { String errMsg = "In <create-value> the value \"" + valueFma + "\" was not found, not creating"; Debug.logWarning(errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } try { @@ -72,9 +73,9 @@ public final class CreateValue extends MethodOperation { value.getDelegator().create(value); } } catch (GenericEntityException e) { - String errMsg = "Exception thrown while creating the \"" + valueFma +"\" GenericValue: " + e.getMessage(); + String errMsg = "Exception thrown while creating the \"" + valueFma + "\" GenericValue: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityAnd.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityAnd.java index b11cf9b..fda9580 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityAnd.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityAnd.java @@ -60,7 +60,7 @@ public final class EntityAnd extends EntityOperation { } catch (GeneralException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCondition.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCondition.java index 25deb5c..54b9491 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCondition.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCondition.java @@ -61,7 +61,7 @@ public final class EntityCondition extends EntityOperation { } catch (GeneralException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java index 59da2e2..19ba0bb 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityCount.java @@ -110,7 +110,7 @@ public final class EntityCount extends EntityOperation { } catch (GeneralException e) { String errMsg = "Exception thrown while performing entity count: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityOne.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityOne.java index 1e19db2..a032bad 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityOne.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/EntityOne.java @@ -58,7 +58,7 @@ public final class EntityOne extends EntityOperation { } catch (GeneralException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByAnd.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByAnd.java index 2fd6c8f..b6d6c4b 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByAnd.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByAnd.java @@ -103,7 +103,7 @@ public final class FindByAnd extends EntityOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByPrimaryKey.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByPrimaryKey.java index dfb55da..aefc13a 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByPrimaryKey.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/FindByPrimaryKey.java @@ -95,7 +95,7 @@ public final class FindByPrimaryKey extends EntityOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelated.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelated.java index 61665a5..bf2bcad 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelated.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelated.java @@ -81,7 +81,7 @@ public final class GetRelated extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while finding related values: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelatedOne.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelatedOne.java index 2e11021..cad03fd 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelatedOne.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/GetRelatedOne.java @@ -72,7 +72,7 @@ public final class GetRelatedOne extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while finding related value: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RefreshValue.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RefreshValue.java index 08cb3b2..0e7b6f0 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RefreshValue.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RefreshValue.java @@ -62,7 +62,7 @@ public final class RefreshValue extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while refreshing value: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java index e5c5a4f..18570f4 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveByAnd.java @@ -67,7 +67,7 @@ public final class RemoveByAnd extends EntityOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveList.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveList.java index 0a9d31a..1b60d04 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveList.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveList.java @@ -64,7 +64,7 @@ public final class RemoveList extends EntityOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveRelated.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveRelated.java index fc2f005..9918c4d 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveRelated.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveRelated.java @@ -66,7 +66,7 @@ public final class RemoveRelated extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing related entities: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveValue.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveValue.java index 0329754..a007f5c 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveValue.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/RemoveValue.java @@ -61,7 +61,7 @@ public final class RemoveValue extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entity value: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreList.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreList.java index c76f85b..3582efc 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreList.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreList.java @@ -64,7 +64,7 @@ public final class StoreList extends EntityOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while storing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreValue.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreValue.java index 15cbc7d..b188d55 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreValue.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/StoreValue.java @@ -61,7 +61,7 @@ public final class StoreValue extends MethodOperation { } catch (GenericEntityException e) { String errMsg = "Exception thrown while storing entity value: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } return true; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionBegin.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionBegin.java index 52d5127..6800ed1 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionBegin.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionBegin.java @@ -58,7 +58,7 @@ public final class TransactionBegin extends MethodOperation { } catch (GenericTransactionException e) { String errMsg = "Exception thrown while beginning transaction: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } beganTransactionFma.put(methodContext.getEnvMap(), beganTransaction); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java index 5b514d9..d21728c 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionCommit.java @@ -62,7 +62,7 @@ public final class TransactionCommit extends MethodOperation { } catch (GenericTransactionException e) { String errMsg = "Exception thrown while committing transaction: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } beganTransactionFma.remove(methodContext.getEnvMap()); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java index 9a39d25..2209ab1 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/entityops/TransactionRollback.java @@ -58,11 +58,12 @@ public final class TransactionRollback extends MethodOperation { beganTransaction = beganTransactionBoolean; } try { - TransactionUtil.rollback(beganTransaction, "Explicit rollback in simple-method [" + this.simpleMethod.getShortDescription() + "]", null); + TransactionUtil.rollback(beganTransaction, "Explicit rollback in simple-method [" + this.getSimpleMethod().getShortDescription() + + "]", null); } catch (GenericTransactionException e) { String errMsg = "Exception thrown while rolling back transaction: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } beganTransactionFma.remove(methodContext.getEnvMap()); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CheckErrors.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CheckErrors.java index 66d7e36..11d6356 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CheckErrors.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/CheckErrors.java @@ -50,6 +50,7 @@ public final class CheckErrors extends MethodOperation { @Override public boolean exec(MethodContext methodContext) throws MiniLangException { + SimpleMethod simpleMethod = getSimpleMethod(); if (methodContext.isTraceOn()) { outputTraceMessage(methodContext, "Begin check-errors."); } @@ -57,10 +58,10 @@ public final class CheckErrors extends MethodOperation { if (messages != null && !messages.isEmpty()) { if (methodContext.getMethodType() == MethodContext.EVENT) { methodContext.putEnv(simpleMethod.getEventErrorMessageListName(), messages); - methodContext.putEnv(this.simpleMethod.getEventResponseCodeName(), getErrorCode(methodContext)); + methodContext.putEnv(this.getSimpleMethod().getEventResponseCodeName(), getErrorCode(methodContext)); } else { methodContext.putEnv(simpleMethod.getServiceErrorMessageListName(), messages); - methodContext.putEnv(this.simpleMethod.getServiceResponseMessageName(), getErrorCode(methodContext)); + methodContext.putEnv(this.getSimpleMethod().getServiceResponseMessageName(), getErrorCode(methodContext)); } if (methodContext.isTraceOn()) { outputTraceMessage(methodContext, "Found error messages. Setting error status and halting script execution."); @@ -78,7 +79,7 @@ public final class CheckErrors extends MethodOperation { private String getErrorCode(MethodContext methodContext) { String errorCode = this.errorCodeFse.expandString(methodContext.getEnvMap()); if (errorCode.isEmpty()) { - errorCode = this.simpleMethod.getDefaultErrorCode(); + errorCode = this.getSimpleMethod().getDefaultErrorCode(); } return errorCode; } 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 b2dac5b..4b6d3ee 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 @@ -100,10 +100,10 @@ public final class CreateObject extends MethodOperation { try { typeClass = methodObjectDef.getTypeClass(methodContext); } catch (ClassNotFoundException e) { - String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + String errMsg = "ERROR: Could not complete the " + getSimpleMethod().getShortDescription() + " process [Parameter type not found with name " + methodObjectDef.getTypeName() + "]"; Debug.logWarning(e, errMsg, MODULE); - simpleMethod.addErrorMessage(methodContext, errMsg); + getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } parameterTypes[i] = typeClass; diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java index 25f3859..86de3cb 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/envops/SetOperation.java @@ -195,7 +195,7 @@ public final class SetOperation extends MethodOperation { String errMsg = "Could not convert field value for the field: [" + this.fieldFma.toString() + "] to the [" + this.type + "] type for the value [" + newValue + "]: " + e.getMessage(); Debug.logWarning(e, errMsg, MODULE); - this.simpleMethod.addErrorMessage(methodContext, errMsg); + this.getSimpleMethod().addErrorMessage(methodContext, errMsg); return false; } } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/ifops/CheckPermission.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/ifops/CheckPermission.java index cda3db4..5d14b72 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/ifops/CheckPermission.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/ifops/CheckPermission.java @@ -130,14 +130,14 @@ public final class CheckPermission extends MethodOperation { } } - private class PermissionInfo { + final class PermissionInfo { private final FlexibleStringExpander actionFse; private final FlexibleStringExpander permissionFse; private PermissionInfo(Element element) throws MiniLangException { if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "permission", "action"); - MiniLangValidate.requiredAttributes(simpleMethod, element, "permission"); + MiniLangValidate.attributeNames(getSimpleMethod(), element, "permission", "action"); + MiniLangValidate.requiredAttributes(getSimpleMethod(), element, "permission"); } this.permissionFse = FlexibleStringExpander.getInstance(element.getAttribute("permission")); this.actionFse = FlexibleStringExpander.getInstance(element.getAttribute("action")); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java index 21dc0f6..64a3f86 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/otherops/Log.java @@ -68,14 +68,14 @@ public final class Log extends MethodOperation { if (Debug.isOn(level)) { String message = this.messageFse.expandString(methodContext.getEnvMap()); StringBuilder buf = new StringBuilder("["); - String methodLocation = this.simpleMethod.getFromLocation(); + String methodLocation = this.getSimpleMethod().getFromLocation(); int pos = methodLocation.lastIndexOf("/"); if (pos != -1) { methodLocation = methodLocation.substring(pos + 1); } buf.append(methodLocation); buf.append("#"); - buf.append(this.simpleMethod.getMethodName()); + buf.append(this.getSimpleMethod().getMethodName()); buf.append(" line "); buf.append(getLineNumber()); buf.append("] "); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ConstantOper.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ConstantOper.java index e21485a..9d75dce 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ConstantOper.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/ConstantOper.java @@ -31,7 +31,7 @@ import org.w3c.dom.Element; */ public class ConstantOper extends MakeInStringOperation { - String constant; + private String constant; public ConstantOper(Element element) { super(element); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/InFieldOper.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/InFieldOper.java index 615af5b..37b5a6f 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/InFieldOper.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/InFieldOper.java @@ -33,8 +33,7 @@ import org.w3c.dom.Element; public class InFieldOper extends MakeInStringOperation { private static final String MODULE = InFieldOper.class.getName(); - - String fieldName; + private String fieldName; public InFieldOper(Element element) { super(element); diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MakeInString.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MakeInString.java index f99535e..ab584a4 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MakeInString.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MakeInString.java @@ -35,8 +35,8 @@ public class MakeInString { private static final String MODULE = MakeInString.class.getName(); - String fieldName; - List<MakeInStringOperation> operations = new ArrayList<>(); + private String fieldName; + private List<MakeInStringOperation> operations = new ArrayList<>(); public MakeInString(Element makeInStringElement) { fieldName = makeInStringElement.getAttribute("field"); @@ -57,12 +57,21 @@ public class MakeInString { } } + /** + * Exec. + * @param inMap the in map + * @param results the results + * @param messages the messages + * @param locale the locale + * @param loader the loader + */ public void exec(Map<String, Object> inMap, Map<String, Object> results, List<Object> messages, Locale locale, ClassLoader loader) { StringBuilder buffer = new StringBuilder(); for (MakeInStringOperation oper : operations) { String curStr = oper.exec(inMap, messages, locale, loader); - if (curStr != null) + if (curStr != null) { buffer.append(curStr); + } } inMap.put(fieldName, buffer.toString()); } diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MapProcessor.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MapProcessor.java index cd6359c..e0aad32 100644 --- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MapProcessor.java +++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/operation/MapProcessor.java @@ -32,9 +32,9 @@ import org.w3c.dom.Element; */ public class MapProcessor { - List<MakeInString> makeInStrings = new ArrayList<>(); - String name; - List<SimpleMapProcess> simpleMapProcesses = new ArrayList<>(); + private List<MakeInString> makeInStrings = new ArrayList<>(); + private String name; + private List<SimpleMapProcess> simpleMapProcesses = new ArrayList<>(); public MapProcessor(Element simpleMapProcessorElement) { name = simpleMapProcessorElement.getAttribute("name"); @@ -48,6 +48,14 @@ public class MapProcessor { } } + /** + * Exec. + * @param inMap the in map + * @param results the results + * @param messages the messages + * @param locale the locale + * @param loader the loader + */ public void exec(Map<String, Object> inMap, Map<String, Object> results, List<Object> messages, Locale locale, ClassLoader loader) { if (UtilValidate.isNotEmpty(makeInStrings)) { for (MakeInString makeInString : makeInStrings) { @@ -61,6 +69,10 @@ public class MapProcessor { } } + /** + * Gets name. + * @return the name + */ public String getName() { return name; } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermGroup.java b/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermGroup.java index 911dc1d..b9e20f2 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermGroup.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/ModelPermGroup.java @@ -32,13 +32,34 @@ import org.apache.ofbiz.base.util.UtilValidate; @SuppressWarnings("serial") public class ModelPermGroup implements Serializable { - private static final String MODULE = ModelPermGroup.class.getName(); - public static final String PERM_JOIN_AND = "AND"; public static final String PERM_JOIN_OR = "OR"; - public List<ModelPermission> permissions = new LinkedList<>(); - public String joinType; + private List<ModelPermission> permissions = new LinkedList<>(); + private String joinType; + + /** + * Sets join type. + * @param joinType the join type + */ + public void setJoinType(String joinType) { + this.joinType = joinType; + } + + /** + * Gets permissions. + * @return the permissions + */ + public List<ModelPermission> getPermissions() { + return permissions; + } + + /** + * Eval permissions map. + * @param dctx the dctx + * @param context the context + * @return the map + */ public Map<String, Object> evalPermissions(DispatchContext dctx, Map<String, ? extends Object> context) { List<String> permissionErrors = new ArrayList<>(); if (UtilValidate.isNotEmpty(permissions)) { 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 76cdf41..3317038 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 @@ -333,7 +333,7 @@ public class ModelServiceReader implements Serializable { 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"); + group.setJoinType(element.getAttribute("join-type")); createGroupPermissions(element, group, model); model.getPermissionGroups().add(group); } @@ -351,14 +351,14 @@ public class ModelServiceReader implements Serializable { perm.setPermissionType(ModelPermission.getPERMISSION()); } perm.setServiceModel(service); - group.permissions.add(perm); + group.getPermissions().add(perm); } // Create the permissions based on permission services for (Element element : UtilXml.childElementList(baseElement, "permission-service")) { - group.permissions.add(createServicePermission(element, service)); + group.getPermissions().add(createServicePermission(element, service)); } - if (UtilValidate.isNotEmpty(group.permissions)) { + if (UtilValidate.isNotEmpty(group.getPermissions())) { // auth is always required when permissions are set service.setAuth(true); } 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 ce027a3..8fa8694 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 @@ -39,12 +39,12 @@ public class RecurrenceInfo { private static final String MODULE = RecurrenceInfo.class.getName(); - protected GenericValue info; - protected Date startDate; - protected List<RecurrenceRule> rRulesList; - protected List<RecurrenceRule> eRulesList; - protected List<Date> rDateList; - protected List<Date> eDateList; + private GenericValue info; + private Date startDate; + private List<RecurrenceRule> rRulesList; + private List<RecurrenceRule> eRulesList; + private List<Date> rDateList; + private List<Date> eDateList; /** Creates new RecurrenceInfo */ public RecurrenceInfo(GenericValue info) throws RecurrenceInfoException { @@ -297,6 +297,10 @@ public class RecurrenceInfo { return true; } + /** + * Primary key string. + * @return the string + */ public String primaryKey() { return info.getString("recurrenceInfoId"); } @@ -348,7 +352,7 @@ public class RecurrenceInfo { */ @SuppressWarnings("serial") protected static class RecurrenceWrapper extends TemporalExpression { - protected RecurrenceInfo info; + private RecurrenceInfo info; protected RecurrenceWrapper() { } public RecurrenceWrapper(RecurrenceInfo info) { this.info = info; @@ -378,7 +382,8 @@ public class RecurrenceInfo { return next; } @Override - public void accept(TemporalExpressionVisitor visitor) {} + public void accept(TemporalExpressionVisitor visitor) { } + @Override public boolean isSubstitutionCandidate(Calendar cal, TemporalExpression expressionToTest) { return false; 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 421aba4..6186b08 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 @@ -85,20 +85,20 @@ public class RecurrenceRule { // ********************** // * GenericValue object // ********************** - protected GenericValue rule; + private GenericValue rule; // ********************** // * Parsed byXXX lists // ********************** - protected List<String> bySecondList; - protected List<String> byMinuteList; - protected List<String> byHourList; - protected List<String> byDayList; - protected List<String> byMonthDayList; - protected List<String> byYearDayList; - protected List<String> byWeekNoList; - protected List<String> byMonthList; - protected List<String> bySetPosList; + private List<String> bySecondList; + private List<String> byMinuteList; + private List<String> byHourList; + private List<String> byDayList; + private List<String> byMonthDayList; + private List<String> byYearDayList; + private List<String> byWeekNoList; + private List<String> byMonthList; + private List<String> bySetPosList; /** * Creates a new RecurrenceRule object from a RecurrenceInfo entity. @@ -419,7 +419,7 @@ public class RecurrenceRule { // Check for validity of the current frequency. if (validByRule(cal.getTime())) { - return cal.getTime().getTime(); + return cal.getTime().getTime(); } return 0; @@ -789,6 +789,10 @@ public class RecurrenceRule { return 0; } + /** + * Primary key string. + * @return the string + */ public String primaryKey() { return rule.getString("recurrenceRuleId"); } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpression.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpression.java index 73f7c17..b5d2e40 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpression.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpression.java @@ -31,11 +31,27 @@ public abstract class TemporalExpression implements Serializable, Comparable<Tem /** Field used to sort expressions. Expression evaluation depends * on correct ordering. Expressions are evaluated from lowest value * to highest value. */ - protected int sequence = Integer.MAX_VALUE; + private int sequence = Integer.MAX_VALUE; + + /** + * Gets sequence. + * @return the sequence + */ + public int getSequence() { + return sequence; + } + + /** + * Sets sequence. + * @param sequence the sequence + */ + public void setSequence(int sequence) { + this.sequence = sequence; + } /** A unique ID for this expression. This field is intended to be used by * persistence classes. */ - protected String id = null; + private String id = null; protected TemporalExpression() { } @@ -86,6 +102,11 @@ public abstract class TemporalExpression implements Serializable, Comparable<Tem return result; } + /** + * Contains expression boolean. + * @param expression the expression + * @return the boolean + */ protected boolean containsExpression(TemporalExpression expression) { return false; } @@ -173,8 +194,48 @@ public abstract class TemporalExpression implements Serializable, Comparable<Tem } protected class ExpressionContext { - public boolean hourBumped = false; - public boolean dayBumped = false; - public boolean monthBumped = false; + private boolean hourBumped = false; + private boolean dayBumped = false; + private boolean monthBumped = false; + + /** + * Is hour bumped boolean. + * @return the boolean + */ + public boolean isHourBumped() { + return hourBumped; + } + + /** + * Is day bumped boolean. + * @return the boolean + */ + public boolean isDayBumped() { + return dayBumped; + } + + /** + * Sets hour bumped. + * @param hourBumped the hour bumped + */ + public void setHourBumped(boolean hourBumped) { + this.hourBumped = hourBumped; + } + + /** + * Sets day bumped. + * @param dayBumped the day bumped + */ + public void setDayBumped(boolean dayBumped) { + this.dayBumped = dayBumped; + } + + /** + * Sets month bumped. + * @param monthBumped the month bumped + */ + public void setMonthBumped(boolean monthBumped) { + this.monthBumped = monthBumped; + } } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java index 3a62744..8658c4d 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/calendar/TemporalExpressions.java @@ -58,7 +58,7 @@ public class TemporalExpressions implements Serializable { /** A temporal expression that represents a range of dates. */ public static class DateRange extends TemporalExpression { private static final String MODULE = DateRange.class.getName(); - protected final org.apache.ofbiz.base.util.DateRange range; + private final org.apache.ofbiz.base.util.DateRange range; public DateRange(Date date) { this(date, date); @@ -66,7 +66,7 @@ public class TemporalExpressions implements Serializable { public DateRange(Date start, Date end) { this.range = new org.apache.ofbiz.base.util.DateRange(start, end); - this.sequence = SEQUENCE_DATE_RANGE; + this.setSequence(SEQUENCE_DATE_RANGE); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -159,7 +159,7 @@ public class TemporalExpressions implements Serializable { // Example: Last Monday should come after first Monday result += 11; } - this.sequence = SEQUENCE_DAY_IN_MONTH + (result * 10) + dayOfWeek; + this.setSequence(SEQUENCE_DAY_IN_MONTH + (result * 10) + dayOfWeek); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -312,7 +312,7 @@ public class TemporalExpressions implements Serializable { if (end < 1 || end > 31) { throw new IllegalArgumentException("Invalid end argument"); } - this.sequence = SEQUENCE_DOM_RANGE + start; + this.setSequence(SEQUENCE_DOM_RANGE + start); this.start = start; this.end = end; if (Debug.verboseOn()) { @@ -431,7 +431,7 @@ public class TemporalExpressions implements Serializable { if (end < Calendar.SUNDAY || end > Calendar.SATURDAY) { throw new IllegalArgumentException("Invalid end argument"); } - this.sequence = SEQUENCE_DOW_RANGE + start; + this.setSequence(SEQUENCE_DOW_RANGE + start); this.start = start; this.end = end; if (Debug.verboseOn()) { @@ -528,8 +528,8 @@ public class TemporalExpressions implements Serializable { public Calendar next(Calendar cal, ExpressionContext context) { Calendar next = (Calendar) cal.clone(); if (includesDate(next)) { - if (context.dayBumped) { - context.dayBumped = false; + if (context.isDayBumped()) { + context.setDayBumped(false); return next; } next.add(Calendar.DAY_OF_MONTH, 1); @@ -538,7 +538,7 @@ public class TemporalExpressions implements Serializable { next.add(Calendar.DAY_OF_MONTH, 1); } if (cal.get(Calendar.MONTH) != next.get(Calendar.MONTH)) { - context.monthBumped = true; + context.setMonthBumped(true); } return next; } @@ -564,7 +564,7 @@ public class TemporalExpressions implements Serializable { if (containsExpression(this)) { throw new IllegalArgumentException("recursive expression"); } - this.sequence = included.sequence; + this.setSequence(included.getSequence()); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -681,7 +681,7 @@ public class TemporalExpressions implements Serializable { } else { this.start = new Date(); } - this.sequence = SEQUENCE_FREQ + freqType; + this.setSequence(SEQUENCE_FREQ + freqType); this.freqType = freqType; this.freqCount = freqCount; if (Debug.verboseOn()) { @@ -846,7 +846,7 @@ public class TemporalExpressions implements Serializable { } this.start = start; this.end = end; - this.sequence = SEQUENCE_HOUR_RANGE + start; + this.setSequence(SEQUENCE_HOUR_RANGE + start); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -958,7 +958,7 @@ public class TemporalExpressions implements Serializable { public Calendar next(Calendar cal, ExpressionContext context) { Calendar next = (Calendar) cal.clone(); if (includesDate(next)) { - if (context.hourBumped) { + if (context.isHourBumped()) { return next; } next.add(Calendar.HOUR_OF_DAY, 1); @@ -967,9 +967,9 @@ public class TemporalExpressions implements Serializable { next.add(Calendar.HOUR_OF_DAY, 1); } if (cal.get(Calendar.DAY_OF_MONTH) != next.get(Calendar.DAY_OF_MONTH)) { - context.dayBumped = true; + context.setDayBumped(true); if (cal.get(Calendar.MONTH) != next.get(Calendar.MONTH)) { - context.monthBumped = true; + context.setMonthBumped(true); } } return next; @@ -1002,9 +1002,9 @@ public class TemporalExpressions implements Serializable { TemporalExpression[] exprArray = this.expressionSet.toArray(new TemporalExpression[this.expressionSet.size()]); for (int i = exprArray.length - 1; i >= 0; i--) { result *= 10; - result += exprArray[i].sequence; + result += exprArray[i].getSequence(); } - this.sequence = result; + this.setSequence(result); } if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); @@ -1136,7 +1136,7 @@ public class TemporalExpressions implements Serializable { } this.start = start; this.end = end; - this.sequence = SEQUENCE_MINUTE_RANGE + start; + this.setSequence(SEQUENCE_MINUTE_RANGE + start); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -1254,11 +1254,11 @@ public class TemporalExpressions implements Serializable { next.add(Calendar.MINUTE, 1); } if (cal.get(Calendar.HOUR_OF_DAY) != next.get(Calendar.HOUR_OF_DAY)) { - context.hourBumped = true; + context.setHourBumped(true); if (cal.get(Calendar.DAY_OF_MONTH) != next.get(Calendar.DAY_OF_MONTH)) { - context.dayBumped = true; + context.setDayBumped(true); if (cal.get(Calendar.MONTH) != next.get(Calendar.MONTH)) { - context.monthBumped = true; + context.setMonthBumped(true); } } } @@ -1294,7 +1294,7 @@ public class TemporalExpressions implements Serializable { if (end < Calendar.JANUARY || end > Calendar.UNDECIMBER) { throw new IllegalArgumentException("Invalid end argument"); } - this.sequence = SEQUENCE_MONTH_RANGE + start; + this.setSequence(SEQUENCE_MONTH_RANGE + start); this.start = start; this.end = end; if (Debug.verboseOn()) { @@ -1452,7 +1452,7 @@ public class TemporalExpressions implements Serializable { if (containsExpression(this)) { throw new IllegalArgumentException("recursive expression"); } - this.sequence = included.sequence; + this.setSequence(included.getSequence()); if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); } @@ -1565,7 +1565,7 @@ public class TemporalExpressions implements Serializable { } if (!this.expressionSet.isEmpty()) { TemporalExpression that = this.expressionSet.iterator().next(); - this.sequence = that.sequence; + this.setSequence(that.getSequence()); } if (Debug.verboseOn()) { Debug.logVerbose("Created " + this, MODULE); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java index a264f51..8efccff 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java @@ -42,16 +42,16 @@ public class ServiceEcaCondition implements java.io.Serializable { private static final String MODULE = ServiceEcaCondition.class.getName(); - protected String conditionService = null; - protected String lhsValueName = null; - protected String rhsValueName = null; - protected String lhsMapName = null; - protected String rhsMapName = null; - protected String operator = null; - protected String compareType = null; - protected String format = null; - protected boolean isConstant = false; - protected boolean isService = false; + private String conditionService = null; + private String lhsValueName = null; + private String rhsValueName = null; + private String lhsMapName = null; + private String rhsMapName = null; + private String operator = null; + private String compareType = null; + private String format = null; + private boolean isConstant = false; + private boolean isService = false; protected ServiceEcaCondition() { } @@ -79,6 +79,11 @@ public class ServiceEcaCondition implements java.io.Serializable { } } + /** + * Gets short display description. + * @param moreDetail the more detail + * @return the short display description + */ public String getShortDisplayDescription(boolean moreDetail) { StringBuilder buf = new StringBuilder(); if (isService) { @@ -107,6 +112,14 @@ public class ServiceEcaCondition implements java.io.Serializable { return buf.toString(); } + /** + * Eval boolean. + * @param serviceName the service name + * @param dctx the dctx + * @param context the context + * @return the boolean + * @throws GenericServiceException the generic service exception + */ public boolean eval(String serviceName, DispatchContext dctx, Map<String, Object> context) throws GenericServiceException { if (serviceName == null || dctx == null || context == null || dctx.getClassLoader() == null) { throw new GenericServiceException("Cannot have null Service, Context or DispatchContext!"); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericEngineFactory.java b/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericEngineFactory.java index 9d4530e..abd519c 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericEngineFactory.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/engine/GenericEngineFactory.java @@ -33,8 +33,8 @@ import org.apache.ofbiz.service.config.ServiceConfigUtil; */ public class GenericEngineFactory { - protected ServiceDispatcher dispatcher = null; - protected Map<String, GenericEngine> engines = null; + private ServiceDispatcher dispatcher = null; + private Map<String, GenericEngine> engines = null; public GenericEngineFactory(ServiceDispatcher dispatcher) { this.dispatcher = dispatcher; diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/jms/AbstractJmsListener.java b/framework/service/src/main/java/org/apache/ofbiz/service/jms/AbstractJmsListener.java index db7265a..6bb91eb 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/jms/AbstractJmsListener.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/jms/AbstractJmsListener.java @@ -42,8 +42,8 @@ public abstract class AbstractJmsListener implements GenericMessageListener, Exc private static final String MODULE = AbstractJmsListener.class.getName(); - protected LocalDispatcher dispatcher; - protected boolean isConnected = false; + private LocalDispatcher dispatcher; + private boolean isConnected = false; /** * Initializes the LocalDispatcher for this service listener. @@ -76,8 +76,9 @@ public abstract class AbstractJmsListener implements GenericMessageListener, Exc if (Debug.verboseOn()) { Debug.logVerbose("De-Serialized Context --> " + o, MODULE); } - if (ObjectType.instanceOf(o, "java.util.Map")) + if (ObjectType.instanceOf(o, "java.util.Map")) { context = UtilGenerics.cast(o); + } } catch (JMSException je) { Debug.logError(je, "Problems reading message.", MODULE); } catch (Exception e) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/AbstractJob.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/AbstractJob.java index 2578120..3f314c1 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/AbstractJob.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/AbstractJob.java @@ -34,7 +34,24 @@ public abstract class AbstractJob implements Job { private final String jobId; private final String jobName; - protected State currentState = State.CREATED; + private State currentState = State.CREATED; + + /** + * Gets current state. + * @return the current state + */ + public State getCurrentState() { + return currentState; + } + + /** + * Sets current state. + * @param currentState the current state + */ + public void setCurrentState(State currentState) { + this.currentState = currentState; + } + private long elapsedTime = 0; private final Date startTime = new Date(); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/GenericServiceJob.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/GenericServiceJob.java index 99aa9fd..8923b6f 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/GenericServiceJob.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/GenericServiceJob.java @@ -37,10 +37,17 @@ public class GenericServiceJob extends AbstractJob implements Serializable { private static final String MODULE = GenericServiceJob.class.getName(); - protected final transient GenericRequester requester; - protected final transient DispatchContext dctx; + private final transient GenericRequester requester; + private final transient DispatchContext dctx; private final String service; private final Map<String, Object> context; + /** + * Gets dctx. + * @return the dctx + */ + public DispatchContext getDctx() { + return dctx; + } public GenericServiceJob(DispatchContext dctx, String jobId, String jobName, String service, Map<String, Object> context, GenericRequester req) { super(jobId, jobName); @@ -56,10 +63,10 @@ public class GenericServiceJob extends AbstractJob implements Serializable { */ @Override public void exec() throws InvalidJobException { - if (currentState != State.QUEUED) { + if (getCurrentState() != State.QUEUED) { throw new InvalidJobException("Illegal state change"); } - currentState = State.RUNNING; + setCurrentState(State.RUNNING); init(); Throwable thrown = null; Map<String, Object> result = null; @@ -102,10 +109,10 @@ public class GenericServiceJob extends AbstractJob implements Serializable { * Method is called after the service has finished successfully. */ protected void finish(Map<String, Object> result) throws InvalidJobException { - if (currentState != State.RUNNING) { + if (getCurrentState() != State.RUNNING) { throw new InvalidJobException("Illegal state change"); } - currentState = State.FINISHED; + setCurrentState(State.FINISHED); if (Debug.verboseOn()) { Debug.logVerbose("Async-Service finished.", MODULE); } @@ -121,7 +128,7 @@ public class GenericServiceJob extends AbstractJob implements Serializable { } else { Debug.logError(t, "Async-Service failed.", MODULE); } - currentState = State.FAILED; + setCurrentState(State.FAILED); } /** @@ -142,7 +149,7 @@ public class GenericServiceJob extends AbstractJob implements Serializable { @Override public boolean isValid() { - return currentState == State.CREATED; + return getCurrentState() == State.CREATED; } @Override diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java index 2b489a4..c4f02e96 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/PersistedServiceJob.java @@ -307,7 +307,7 @@ public class PersistedServiceJob extends GenericServiceJob { } // check the runAsUser if (UtilValidate.isNotEmpty(jobValue.getString("runAsUser"))) { - context.put("userLogin", ServiceUtil.getUserLogin(dctx, context, jobValue.getString("runAsUser"))); + context.put("userLogin", ServiceUtil.getUserLogin(getDctx(), context, jobValue.getString("runAsUser"))); } } catch (GenericEntityException e) { Debug.logError(e, "PersistedServiceJob.getContext(): Entity Exception", MODULE); @@ -366,10 +366,10 @@ public class PersistedServiceJob extends GenericServiceJob { @Override public void deQueue() throws InvalidJobException { - if (currentState != State.QUEUED) { + if (getCurrentState() != State.QUEUED) { throw new InvalidJobException("Illegal state change"); } - currentState = State.CREATED; + setCurrentState(State.CREATED); try { jobValue.refresh(); jobValue.set("startDateTime", null); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/job/PurgeJob.java b/framework/service/src/main/java/org/apache/ofbiz/service/job/PurgeJob.java index 11c1729..8b4926b 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/job/PurgeJob.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/job/PurgeJob.java @@ -39,21 +39,21 @@ public class PurgeJob extends AbstractJob implements Serializable { @Override public void exec() throws InvalidJobException { - if (currentState != State.QUEUED) { + if (getCurrentState() != State.QUEUED) { throw new InvalidJobException("Illegal state change"); } - currentState = State.RUNNING; + setCurrentState(State.RUNNING); JobUtil.removeJob(jobValue); } @Override public boolean isValid() { - return currentState == State.CREATED; + return getCurrentState() == State.CREATED; } @Override public void deQueue() throws InvalidJobException { - if (currentState != State.QUEUED) { + if (getCurrentState() != State.QUEUED) { throw new InvalidJobException("Illegal state change"); } } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaAction.java b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaAction.java index 0923eca..b3562da 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaAction.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaAction.java @@ -35,10 +35,18 @@ public class ServiceMcaAction implements java.io.Serializable { private static final String MODULE = ServiceMcaAction.class.getName(); - protected String serviceName = null; - protected String serviceMode = null; - protected String runAsUser = null; - protected boolean persist = false; + private String serviceName = null; + private String serviceMode = null; + private String runAsUser = null; + private boolean persist = false; + + /** + * Gets service name. + * @return the service name + */ + public String getServiceName() { + return serviceName; + } protected ServiceMcaAction() { } @@ -53,6 +61,14 @@ public class ServiceMcaAction implements java.io.Serializable { this.persist = "true".equals(action.getAttribute("persist")); } + /** + * Run action boolean. + * @param dispatcher the dispatcher + * @param messageWrapper the message wrapper + * @param userLogin the user login + * @return the boolean + * @throws GenericServiceException the generic service exception + */ public boolean runAction(LocalDispatcher dispatcher, MimeMessageWrapper messageWrapper, GenericValue userLogin) throws GenericServiceException { Map<String, Object> serviceContext = new HashMap<>(); serviceContext.putAll(UtilMisc.toMap("messageWrapper", messageWrapper, "userLogin", userLogin)); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java index 9440e65..4510bf7 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaCondition.java @@ -46,11 +46,11 @@ public class ServiceMcaCondition implements java.io.Serializable { public static final int CONDITION_HEADER = 2; public static final int CONDITION_SERVICE = 3; - protected String serviceName = null; - protected String headerName = null; - protected String fieldName = null; - protected String operator = null; - protected String value = null; + private String serviceName = null; + private String headerName = null; + private String fieldName = null; + private String operator = null; + private String value = null; public ServiceMcaCondition(Element condElement, int condType) { switch (condType) { @@ -78,6 +78,13 @@ public class ServiceMcaCondition implements java.io.Serializable { } } + /** + * Eval boolean. + * @param dispatcher the dispatcher + * @param messageWrapper the message wrapper + * @param userLogin the user login + * @return the boolean + */ public boolean eval(LocalDispatcher dispatcher, MimeMessageWrapper messageWrapper, GenericValue userLogin) { boolean passedCondition = false; if (serviceName != null) { @@ -191,6 +198,14 @@ public class ServiceMcaCondition implements java.io.Serializable { return passedCondition; } + /** + * Get field value string [ ]. + * @param message the message + * @param fieldName the field name + * @return the string [ ] + * @throws MessagingException the messaging exception + * @throws IOException the io exception + */ protected String[] getFieldValue(MimeMessage message, String fieldName) throws MessagingException, IOException { String[] values = null; if ("to".equals(fieldName)) { diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaRule.java b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaRule.java index 0960df5..04fc2bf 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaRule.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/mail/ServiceMcaRule.java @@ -84,9 +84,9 @@ public class ServiceMcaRule implements java.io.Serializable { if (allCondTrue) { for (ServiceMcaAction action: actions) { - if (!actionsRun.contains(action.serviceName)) { + if (!actionsRun.contains(action.getServiceName())) { if (action.runAction(dispatcher, messageWrapper, userLogin)) { - actionsRun.add(action.serviceName); + actionsRun.add(action.getServiceName()); } else { break; } diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/rmi/ExampleRemoteClient.java b/framework/service/src/main/java/org/apache/ofbiz/service/rmi/ExampleRemoteClient.java index 03ab35d..9981fb0 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/rmi/ExampleRemoteClient.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/rmi/ExampleRemoteClient.java @@ -50,7 +50,7 @@ public class ExampleRemoteClient { private static final String MODULE = ExampleRemoteClient.class.getName(); protected static final String RMI_URL = "rmi://localhost:1099/RMIDispatcher"; // change to match the remote server - protected RemoteDispatcher rd = null; + private RemoteDispatcher rd = null; public ExampleRemoteClient() { try { @@ -60,6 +60,12 @@ public class ExampleRemoteClient { } } + /** + * Run test service map. + * @return the map + * @throws RemoteException the remote exception + * @throws GenericServiceException the generic service exception + */ public Map<String, Object> runTestService() throws RemoteException, GenericServiceException { Map<String, Object> context = new HashMap<>(); context.put("message", "Remote Service Test"); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/test/AbstractXmlRpcTestCase.java b/framework/service/src/main/java/org/apache/ofbiz/service/test/AbstractXmlRpcTestCase.java index 4079d58..2390b35 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/test/AbstractXmlRpcTestCase.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/test/AbstractXmlRpcTestCase.java @@ -34,9 +34,9 @@ public class AbstractXmlRpcTestCase extends TestCase { private static final String MODULE = AbstractXmlRpcTestCase.class.getName(); - protected String keyStoreComponent; - protected String keyStoreName; - protected String keyAlias; + private String keyStoreComponent; + private String keyStoreName; + private String keyAlias; public AbstractXmlRpcTestCase(String name, String keyStoreComponent, String keyStoreName, String keyAlias) { super(name); @@ -53,10 +53,24 @@ public class AbstractXmlRpcTestCase extends TestCase { } + /** + * Gets rpc client. + * @param url the url + * @return the rpc client + * @throws MalformedURLException the malformed url exception + */ public org.apache.xmlrpc.client.XmlRpcClient getRpcClient(String url) throws MalformedURLException { return getRpcClient(url, null, null); } + /** + * Gets rpc client. + * @param url the url + * @param login the login + * @param password the password + * @return the rpc client + * @throws MalformedURLException the malformed url exception + */ public org.apache.xmlrpc.client.XmlRpcClient getRpcClient(String url, String login, String password) throws MalformedURLException { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL(url)); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEntityAutoTests.java b/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEntityAutoTests.java index 1c6eef1..0bae5f6 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEntityAutoTests.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEntityAutoTests.java @@ -26,6 +26,7 @@ import java.util.Map; import org.apache.ofbiz.base.util.UtilDateTime; import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilProperties; +import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.service.GenericServiceException; @@ -51,6 +52,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoCreateSinglPkEntity() throws Exception { + Delegator delegator = getDelegator(); //test create with given pk Map<String, Object> testingPkPresentMap = new HashMap<>(); testingPkPresentMap.put("testingId", "TESTING_1"); @@ -78,6 +80,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoCreateDoublePkEntity() throws Exception { + Delegator delegator = getDelegator(); delegator.create("Testing", "testingId", "TESTING_2"); //test create with given pk @@ -112,6 +115,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoCreateMultiPkEntity() throws Exception { + Delegator delegator = getDelegator(); delegator.create("TestingNode", "testingNodeId", "NODE_1"); delegator.create("Testing", "testingId", "TESTING_3"); @@ -139,6 +143,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoUpdateEntity() throws Exception { + Delegator delegator = getDelegator(); delegator.create("Testing", "testingId", "TESTING_4", "testingName", "entity auto testing"); //test update with exist pk @@ -160,6 +165,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoDeleteEntity() throws Exception { + Delegator delegator = getDelegator(); delegator.create("Testing", "testingId", "TESTING_5"); //test delete with exist pk @@ -182,6 +188,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoExpireEntity() throws Exception { + Delegator delegator = getDelegator(); Timestamp now = UtilDateTime.nowTimestamp(); delegator.create("Testing", "testingId", "TESTING_6"); delegator.create("TestingNode", "testingNodeId", "TESTNODE_6"); @@ -225,6 +232,7 @@ public class ServiceEntityAutoTests extends OFBizTestCase { * @throws Exception the exception */ public void testEntityAutoEntityStatusConcept() throws Exception { + Delegator delegator = getDelegator(); delegator.create("Testing", "testingId", "TESTING_7"); delegator.create("StatusType", "statusTypeId", "TESTINGSTATUS"); delegator.create("StatusItem", "statusId", "TESTING_CREATE", "statusTypeId", "TESTINGSTATUS"); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java b/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java index 6dba0f8..0c6f0f1 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceSOAPTests.java @@ -52,7 +52,7 @@ public class ServiceSOAPTests extends OFBizTestCase { */ public void testSOAPService() throws Exception { Map<String, Object> serviceContext = new HashMap<>(); - GenericValue testing = delegator.makeValue("Testing"); + GenericValue testing = getDelegator().makeValue("Testing"); testing.put("testingId", "COMPLEX_TYPE_TEST"); testing.put("testingTypeId", "SOAP_TEST"); testing.put("testingName", "Complex Type Test"); diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java b/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java index 04a6171..4a78841 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java @@ -61,7 +61,7 @@ public class OFBizTestCase extends EntityTestCase { * @throws GenericEntityException the generic entity exception */ protected GenericValue getUserLogin(String userLoginId) throws GenericEntityException { - return EntityQuery.use(delegator) + return EntityQuery.use(getDelegator()) .from("UserLogin") .where("userLoginId", userLoginId) .queryOne(); @@ -82,7 +82,7 @@ public class OFBizTestCase extends EntityTestCase { * @return the entity query */ protected EntityQuery from(String entityName) { - return EntityQuery.use(delegator).from(entityName); + return EntityQuery.use(getDelegator()).from(entityName); } /** @@ -91,7 +91,7 @@ public class OFBizTestCase extends EntityTestCase { * @return the entity query */ protected EntityQuery from(DynamicViewEntity dynamicViewEntity) { - return EntityQuery.use(delegator).from(dynamicViewEntity); + return EntityQuery.use(getDelegator()).from(dynamicViewEntity); } /** @@ -100,7 +100,7 @@ public class OFBizTestCase extends EntityTestCase { * @return the entity query */ protected EntityQuery select(String... fields) { - return EntityQuery.use(delegator).select(fields); + return EntityQuery.use(getDelegator()).select(fields); } /** @@ -109,7 +109,7 @@ public class OFBizTestCase extends EntityTestCase { * @return the entity query */ protected EntityQuery select(Set<String> fields) { - return EntityQuery.use(delegator).select(fields); + return EntityQuery.use(getDelegator()).select(fields); } /** diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/xmlrpc/XmlRpcClient.java b/framework/service/src/main/java/org/apache/ofbiz/service/xmlrpc/XmlRpcClient.java index 17f6c6d..9b39845 100644 --- a/framework/service/src/main/java/org/apache/ofbiz/service/xmlrpc/XmlRpcClient.java +++ b/framework/service/src/main/java/org/apache/ofbiz/service/xmlrpc/XmlRpcClient.java @@ -34,9 +34,9 @@ public class XmlRpcClient extends org.apache.xmlrpc.client.XmlRpcClient { private static final String MODULE = XmlRpcClient.class.getName(); - protected String keyStoreComponent; - protected String keyStoreName; - protected String keyAlias; + private String keyStoreComponent; + private String keyStoreName; + private String keyAlias; public XmlRpcClient(XmlRpcClientConfig config, String keyStoreComponent, String keyStoreName, String keyAlias) { this(config); @@ -51,6 +51,10 @@ public class XmlRpcClient extends org.apache.xmlrpc.client.XmlRpcClient { this.setConfig(config); } + /** + * Gets client transport factory. + * @return the client transport factory + */ public XmlRpcTransportFactory getClientTransportFactory() { if (keyStoreComponent == null || keyStoreName == null || keyAlias == null) { return this.getTransportFactory(); diff --git a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/EntityXmlAssertTest.java b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/EntityXmlAssertTest.java index 65f42a5..97346bd 100644 --- a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/EntityXmlAssertTest.java +++ b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/EntityXmlAssertTest.java @@ -37,8 +37,8 @@ public class EntityXmlAssertTest extends OFBizTestCase { private static final String MODULE = ServiceTest.class.getName(); - protected String entityXmlUrlString; - protected String action; + private String entityXmlUrlString; + private String action; /** * Tests of entity xml @@ -57,7 +57,7 @@ public class EntityXmlAssertTest extends OFBizTestCase { int testCaseCount = 0; try { URL entityXmlURL = FlexibleLocation.resolveLocation(entityXmlUrlString); - EntitySaxReader reader = new EntitySaxReader(delegator); + EntitySaxReader reader = new EntitySaxReader(getDelegator()); testCaseCount += reader.parse(entityXmlURL); } catch (Exception e) { Debug.logError(e, "Error getting test case count", MODULE); @@ -74,9 +74,9 @@ public class EntityXmlAssertTest extends OFBizTestCase { List<Object> errorMessages = new LinkedList<>(); if ("assert".equals(this.action)) { - EntityDataAssert.assertData(entityXmlURL, delegator, errorMessages); + EntityDataAssert.assertData(entityXmlURL, getDelegator(), errorMessages); } else if ("load".equals(this.action)) { - EntitySaxReader reader = new EntitySaxReader(delegator); + EntitySaxReader reader = new EntitySaxReader(getDelegator()); reader.parse(entityXmlURL); } else { // uh oh, bad value diff --git a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/SimpleMethodTest.java b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/SimpleMethodTest.java index 2668bae..b1633b2 100644 --- a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/SimpleMethodTest.java +++ b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/SimpleMethodTest.java @@ -74,11 +74,11 @@ public class SimpleMethodTest extends OFBizTestCase { result.startTest(this); try { // define request - Security security = SecurityFactory.getInstance(delegator); + Security security = SecurityFactory.getInstance(getDelegator()); MockServletContext servletContext = new MockServletContext(); request.setAttribute("security", security); request.setAttribute("servletContext", servletContext); - request.setAttribute("delegator", delegator); + request.setAttribute("delegator", getDelegator()); request.setAttribute("dispatcher", getDispatcher()); Map<String, Object> serviceResult = SimpleMethod.runSimpleService(methodLocation, methodName, getDispatcher().getDispatchContext(), UtilMisc.toMap("test", this, "testResult", result, "locale", Locale.getDefault(), "request", request, "response", response)); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizCacheStorage.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizCacheStorage.java index 71a9981..790b9a1 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizCacheStorage.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizCacheStorage.java @@ -27,7 +27,7 @@ import freemarker.cache.CacheStorage; */ public class OfbizCacheStorage implements CacheStorage { //can't have global cache because names/keys are relative to the webapp - protected final UtilCache<Object, Object> localCache; + private final UtilCache<Object, Object> localCache; public OfbizCacheStorage(String id) { this.localCache = UtilCache.createUtilCache("webapp.FreeMarkerCache." + id, 0, 0, false); diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizNumberTransform.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizNumberTransform.java index be2a26b..acf0680 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizNumberTransform.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizNumberTransform.java @@ -43,7 +43,7 @@ import org.apache.ofbiz.entity.Delegator; public class OfbizNumberTransform implements TemplateTransformModel { private static final String MODULE = OfbizNumberTransform.class.getName(); - String format = null; + private String format = null; private static String getArg(Map<String, Object> args, String key) { String result = ""; diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/AbstractViewHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/AbstractViewHandler.java index a1e0175..7076a95 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/AbstractViewHandler.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/AbstractViewHandler.java @@ -22,7 +22,7 @@ package org.apache.ofbiz.webapp.view; * ViewHandler - View Handler Interface */ public abstract class AbstractViewHandler implements ViewHandler { - protected String name = null; + private String name = null; @Override public String getName() { diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/ViewFactory.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/ViewFactory.java index 5a16d4c..4001980 100644 --- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/ViewFactory.java +++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/ViewFactory.java @@ -56,7 +56,7 @@ public class ViewFactory { if (!this.handlers.containsKey("default")) { ViewHandler defaultHandler = (ViewHandler) ObjectType.getInstance("org.apache.ofbiz.webapp.view.JspViewHandler"); defaultHandler.init(context); - this. handlers.put("default", defaultHandler); + this.handlers.put("default", defaultHandler); } } catch (Exception e) { Debug.logError(e, MODULE); @@ -64,6 +64,12 @@ public class ViewFactory { } } + /** + * Gets view handler. + * @param type the type + * @return the view handler + * @throws ViewHandlerException the view handler exception + */ public ViewHandler getViewHandler(String type) throws ViewHandlerException { if (UtilValidate.isEmpty(type)) { type = "default"; diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelValue.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelValue.java index aa64e28..7da4c6e 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelValue.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelValue.java @@ -22,26 +22,42 @@ public class LabelValue { private static final String MODULE = LabelValue.class.getName(); - protected String labelValue = ""; - protected String labelComment = ""; + private String labelValue = ""; + private String labelComment = ""; public LabelValue(String labelValue, String labelComment) { this.labelValue = labelValue; this.labelComment = labelComment; } + /** + * Gets label value. + * @return the label value + */ public String getLabelValue() { return labelValue; } + /** + * Gets label comment. + * @return the label comment + */ public String getLabelComment() { return labelComment; } + /** + * Sets label value. + * @param labelValue the label value + */ public void setLabelValue(String labelValue) { this.labelValue = labelValue; } + /** + * Sets label comment. + * @param labelComment the label comment + */ public void setLabelComment(String labelComment) { this.labelComment = labelComment; } diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/cache/GenericWidgetOutput.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/cache/GenericWidgetOutput.java index 5818b9e..2bbeb28 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/cache/GenericWidgetOutput.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/cache/GenericWidgetOutput.java @@ -20,9 +20,7 @@ package org.apache.ofbiz.widget.cache; public class GenericWidgetOutput { - private static final String MODULE = GenericWidgetOutput.class.getName(); - - protected String output; + private String output; public GenericWidgetOutput(String output) { this.output = output; diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java index b76cbbe..c8beb08 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelCondition.java @@ -678,7 +678,7 @@ public abstract class AbstractModelCondition implements Serializable, ModelCondi fieldString = ""; } Class<?>[] paramTypes = {String.class }; - Object[] params = new Object[] { fieldString }; + Object[] params = new Object[] {fieldString }; Class<?> valClass; try { valClass = ObjectType.loadClass(className); 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 632b947..8178712 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 @@ -1809,8 +1809,16 @@ public abstract class ModelForm extends ModelWidget { } public static class AltRowStyle { - public final String useWhen; - public final String style; + private final String useWhen; + private final String style; + + public String getUseWhen() { + return useWhen; + } + + public String getStyle() { + return style; + } public AltRowStyle(Element altRowStyleElement) { this.useWhen = altRowStyleElement.getAttribute("use-when"); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java index 85080c2..4ae9f2e 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java @@ -81,9 +81,9 @@ public class ModelTree extends ModelWidget { private final String defaultRenderStyle; private final FlexibleStringExpander defaultWrapStyleExdr; private final FlexibleStringExpander expandCollapseRequestExdr; - protected final boolean forceChildCheck; + private final boolean forceChildCheck; private final String location; - protected final Map<String, ModelNode> nodeMap; + private final Map<String, ModelNode> nodeMap; private final int openDepth; private final int postTrailOpenDepth; private final String rootNodeName; diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetVisitor.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetVisitor.java index e69b8bf..366d822 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetVisitor.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetVisitor.java @@ -616,8 +616,8 @@ public class XmlWidgetVisitor extends XmlAbstractWidgetVisitor implements ModelW } for (ModelForm.AltRowStyle rowStyle : modelForm.getAltRowStyles()) { writer.append("<alt-row-style"); - visitAttribute("use-when", rowStyle.useWhen); - visitAttribute("style", rowStyle.style); + visitAttribute("use-when", rowStyle.getUseWhen()); + visitAttribute("style", rowStyle.getStyle()); writer.append("/>"); } for (ModelForm.AltTarget target : modelForm.getAltTargets()) { diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java index 23b5990..0ee322c 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java @@ -77,7 +77,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer { private WeakHashMap<Appendable, Environment> environments = new WeakHashMap<>(); private String rendererName; private int elementId = 999; - protected boolean widgetCommentsEnabled = false; + private boolean widgetCommentsEnabled = false; private int screenLetsIdCounter = 1; public MacroScreenRenderer(ModelTheme theme, String modelTemplateName) throws TemplateException, IOException { |
Free forum by Nabble | Edit this page |