From 40d726e9045cd64ef0fdd86b7312843ac67963a7 Mon Sep 17 00:00:00 2001 From: Paolo Bizzarri Date: Tue, 31 Oct 2023 10:07:38 +0100 Subject: [PATCH] [kie-issues #658] Remove checkstyle warnings from drools core module (#5569) * Fixed order of imports * Fixed more checkstyle issues --- .../core/ActivationListenerFactory.java | 2 +- .../drools/core/FlowSessionConfiguration.java | 8 +- .../core/QueryActivationListenerFactory.java | 2 +- .../org/drools/core/QueryResultsImpl.java | 2 +- .../org/drools/core/QueryResultsRowImpl.java | 2 +- .../core/RuleActivationListenerFactory.java | 2 +- .../drools/core/RuleBaseConfiguration.java | 18 +++-- .../drools/core/RuleSessionConfiguration.java | 8 +- .../org/drools/core/SessionConfiguration.java | 8 +- .../org/drools/core/TimerJobFactoryType.java | 16 ++-- .../java/org/drools/core/WorkingMemory.java | 2 +- .../drools/core/WorkingMemoryEntryPoint.java | 7 +- .../core/base/AbstractQueryViewListener.java | 2 +- .../org/drools/core/base/ArrayElements.java | 17 +++- .../core/base/ClassFieldAccessorCache.java | 20 +++-- .../org/drools/core/base/DroolsQueryImpl.java | 2 +- .../InternalViewChangedEventListener.java | 2 +- .../base/NonCloningQueryViewListener.java | 1 - .../core/base/QueryRowWithSubruleIndex.java | 1 - .../base/RuleNameEndsWithAgendaFilter.java | 1 + .../core/base/RuleNameEqualsAgendaFilter.java | 1 + .../base/RuleNameMatchesAgendaFilter.java | 1 + .../base/RuleNameStartsWithAgendaFilter.java | 1 + .../org/drools/core/base/TraitHelper.java | 4 +- .../base/accumulators/CollectAccumulator.java | 9 +-- .../JavaAccumulatorFunctionExecutor.java | 8 +- .../core/common/AgendaGroupQueueImpl.java | 12 +-- .../core/common/AgendaGroupsManager.java | 10 +-- .../java/org/drools/core/common/BaseNode.java | 12 +-- .../core/common/ClassAwareObjectStore.java | 8 +- .../core/common/ConcurrentNodeMemories.java | 8 +- .../core/common/DefaultBetaConstraints.java | 2 +- .../drools/core/common/DefaultFactHandle.java | 19 ++--- .../core/common/DisconnectedFactHandle.java | 29 +++---- .../core/common/EmptyBetaConstraints.java | 2 +- .../drools/core/common/EntryPointFactory.java | 2 +- .../drools/core/common/InternalAgenda.java | 6 +- .../core/common/InternalAgendaGroup.java | 4 +- .../core/common/InternalFactHandle.java | 8 +- .../core/common/InternalWorkingMemory.java | 2 +- .../common/InternalWorkingMemoryActions.java | 4 +- .../InternalWorkingMemoryEntryPoint.java | 2 +- .../core/common/MultipleBetaConstraint.java | 6 +- .../org/drools/core/common/ObjectStore.java | 4 +- .../core/common/ObjectStoreWrapper.java | 2 - .../ObjectTypeConfigurationRegistry.java | 4 +- .../core/common/PhreakPropagationContext.java | 12 +-- .../PhreakPropagationContextFactory.java | 2 +- .../core/common/PropagationContext.java | 4 +- .../common/PropagationContextFactory.java | 2 +- .../core/common/QueryElementFactHandle.java | 15 ++-- .../org/drools/core/common/ReteEvaluator.java | 8 +- .../core/common/SingleBetaConstraints.java | 2 +- .../common/TupleStartEqualsConstraint.java | 2 +- .../core/concurrent/ExecutorProviderImpl.java | 1 + .../concurrent/ParallelGroupEvaluator.java | 10 +-- .../conflict/RuleAgendaConflictResolver.java | 2 +- .../drools/core/event/AgendaEventSupport.java | 2 +- .../event/DefaultAgendaEventListener.java | 6 +- .../core/event/RuleRuntimeEventSupport.java | 2 +- .../rule/impl/SerializableActivation.java | 6 +- .../core/impl/ActivationsManagerImpl.java | 14 ++-- .../core/impl/InternalKieContainer.java | 26 +++--- .../drools/core/impl/InternalRuleBase.java | 16 ++-- .../drools/core/impl/KnowledgeBaseImpl.java | 42 +++++----- .../impl/WorkingMemoryReteExpireAction.java | 10 +-- .../management/DroolsManagementAgent.java | 66 ++++++++------- .../management/KnowledgeBaseMonitoring.java | 5 +- .../marshalling/MarshallerReaderContext.java | 4 +- .../org/drools/core/marshalling/TupleKey.java | 16 +++- .../core/phreak/AbstractReactiveObject.java | 6 +- .../phreak/BuildtimeSegmentUtilities.java | 2 +- .../core/phreak/EagerPhreakBuilder.java | 20 ++--- .../drools/core/phreak/LazyPhreakBuilder.java | 20 ++--- .../drools/core/phreak/LeftTupleEntry.java | 2 +- .../core/phreak/PhreakAccumulateNode.java | 12 +-- .../core/phreak/PhreakAsyncReceiveNode.java | 2 +- .../core/phreak/PhreakAsyncSendNode.java | 8 +- .../drools/core/phreak/PhreakEvalNode.java | 2 +- .../drools/core/phreak/PhreakExistsNode.java | 4 +- .../drools/core/phreak/PhreakFromNode.java | 10 +-- .../drools/core/phreak/PhreakGroupByNode.java | 6 +- .../drools/core/phreak/PhreakJoinNode.java | 2 +- .../org/drools/core/phreak/PhreakNotNode.java | 4 +- .../drools/core/phreak/PhreakQueryNode.java | 2 +- .../core/phreak/PhreakRuleTerminalNode.java | 6 +- .../phreak/PhreakSubnetworkNotExistsNode.java | 4 +- .../drools/core/phreak/PhreakTimerNode.java | 6 +- .../drools/core/phreak/PropagationEntry.java | 12 +-- .../core/phreak/ReactiveCollection.java | 2 +- .../org/drools/core/phreak/ReactiveList.java | 2 +- .../core/phreak/ReactiveObjectUtil.java | 6 +- .../drools/core/phreak/RightTupleEntry.java | 2 +- .../drools/core/phreak/RuleAgendaItem.java | 2 +- .../core/phreak/RuleNetworkEvaluator.java | 7 +- .../drools/core/phreak/SegmentPropagator.java | 2 +- .../org/drools/core/phreak/StackEntry.java | 2 +- .../phreak/SynchronizedPropagationList.java | 16 ++-- .../org/drools/core/phreak/TupleEntry.java | 2 +- .../core/phreak/TupleEvaluationUtil.java | 2 +- .../process/impl/DefaultWorkItemManager.java | 17 ++-- .../core/reteoo/AbstractTerminalNode.java | 10 +-- .../org/drools/core/reteoo/AbstractTuple.java | 2 +- .../drools/core/reteoo/AccumulateNode.java | 22 ++--- .../core/reteoo/AgendaComponentFactory.java | 2 +- .../org/drools/core/reteoo/AlphaNode.java | 4 +- .../drools/core/reteoo/AlphaTerminalNode.java | 4 +- .../drools/core/reteoo/AsyncReceiveNode.java | 8 +- .../org/drools/core/reteoo/AsyncSendNode.java | 8 +- .../org/drools/core/reteoo/BetaMemory.java | 2 +- .../java/org/drools/core/reteoo/BetaNode.java | 14 ++-- .../core/reteoo/ClassObjectTypeConf.java | 19 ++--- .../reteoo/CompositeLeftTupleSinkAdapter.java | 6 +- .../reteoo/CompositeObjectSinkAdapter.java | 24 +++--- ...positePartitionAwareObjectSinkAdapter.java | 16 ++-- .../reteoo/ConditionalBranchEvaluator.java | 2 +- .../core/reteoo/ConditionalBranchNode.java | 2 +- .../reteoo/EmptyLeftTupleSinkAdapter.java | 6 +- .../core/reteoo/EmptyObjectSinkAdapter.java | 8 +- .../drools/core/reteoo/EntryPointNode.java | 12 +-- .../drools/core/reteoo/EvalConditionNode.java | 6 +- .../org/drools/core/reteoo/ExistsNode.java | 2 +- .../core/reteoo/FactTemplateTypeConf.java | 10 +-- .../java/org/drools/core/reteoo/FromNode.java | 14 ++-- .../java/org/drools/core/reteoo/JoinNode.java | 2 +- .../core/reteoo/LeftInputAdapterNode.java | 12 +-- .../org/drools/core/reteoo/LeftTuple.java | 10 +-- .../org/drools/core/reteoo/LeftTupleSink.java | 2 +- .../core/reteoo/LeftTupleSinkPropagator.java | 4 +- .../drools/core/reteoo/LeftTupleSource.java | 6 +- .../core/reteoo/ModifyPreviousTuples.java | 4 +- .../java/org/drools/core/reteoo/NodeSet.java | 4 +- .../drools/core/reteoo/NotNodeLeftTuple.java | 4 +- .../org/drools/core/reteoo/ObjectSink.java | 2 +- .../core/reteoo/ObjectSinkPropagator.java | 4 +- .../org/drools/core/reteoo/ObjectSource.java | 4 +- .../drools/core/reteoo/ObjectTypeConf.java | 6 +- .../drools/core/reteoo/ObjectTypeNode.java | 26 +++--- .../org/drools/core/reteoo/PathMemory.java | 4 +- .../drools/core/reteoo/QueryElementNode.java | 24 ++++-- .../drools/core/reteoo/QueryTerminalNode.java | 4 +- .../drools/core/reteoo/ReactiveFromNode.java | 8 +- .../java/org/drools/core/reteoo/Rete.java | 12 +-- .../org/drools/core/reteoo/ReteDumper.java | 2 +- .../core/reteoo/ReteObjectTypeNode.java | 4 +- .../org/drools/core/reteoo/ReteooBuilder.java | 12 +-- .../core/reteoo/RightInputAdapterNode.java | 10 +-- .../org/drools/core/reteoo/RightTuple.java | 2 +- .../drools/core/reteoo/RightTupleImpl.java | 2 +- .../drools/core/reteoo/RightTupleSink.java | 2 +- .../org/drools/core/reteoo/RuleBuilder.java | 4 +- .../drools/core/reteoo/RuleTerminalNode.java | 6 +- .../reteoo/RuleTerminalNodeLeftTuple.java | 22 +++-- .../core/reteoo/RuntimeComponentFactory.java | 6 +- .../org/drools/core/reteoo/SegmentMemory.java | 12 +-- .../reteoo/SingleLeftTupleSinkAdapter.java | 2 +- .../core/reteoo/SingleObjectSinkAdapter.java | 2 +- .../drools/core/reteoo/SubnetworkTuple.java | 4 +- .../org/drools/core/reteoo/TimerNode.java | 10 +-- .../java/org/drools/core/reteoo/Tuple.java | 6 +- .../org/drools/core/reteoo/WindowNode.java | 10 +-- .../reteoo/builder/AccumulateBuilder.java | 10 +-- .../reteoo/builder/AsyncReceiveBuilder.java | 4 +- .../core/reteoo/builder/AsyncSendBuilder.java | 6 +- .../builder/BetaNodeConstraintFactory.java | 2 +- .../BetaNodeConstraintFactoryImpl.java | 2 +- .../core/reteoo/builder/BuildContext.java | 14 ++-- .../core/reteoo/builder/BuildUtils.java | 18 ++--- .../core/reteoo/builder/CollectBuilder.java | 14 ++-- .../builder/ConditionalBranchBuilder.java | 6 +- .../reteoo/builder/EntryPointBuilder.java | 4 +- .../core/reteoo/builder/EvalBuilder.java | 2 +- .../core/reteoo/builder/FromBuilder.java | 6 +- .../reteoo/builder/GroupElementBuilder.java | 12 +-- .../core/reteoo/builder/NodeFactory.java | 4 +- .../core/reteoo/builder/PatternBuilder.java | 8 +- .../reteoo/builder/PhreakNodeFactory.java | 6 +- .../reteoo/builder/QueryElementBuilder.java | 2 +- .../reteoo/builder/ReactiveFromBuilder.java | 8 +- .../reteoo/builder/ReteooRuleBuilder.java | 8 +- .../core/reteoo/builder/TimerBuilder.java | 4 +- .../builder/WindowReferenceBuilder.java | 2 +- .../org/drools/core/rule/BehaviorContext.java | 6 +- .../org/drools/core/rule/BehaviorManager.java | 2 +- .../core/rule/JavaDialectRuntimeData.java | 36 ++++----- .../drools/core/rule/SlidingTimeWindow.java | 4 +- .../core/rule/accessor/FactHandleFactory.java | 2 +- .../core/rule/consequence/InternalMatch.java | 4 +- .../core/runtime/rule/impl/LiveQueryImpl.java | 2 +- ...nQueryViewChangedEventListenerAdapter.java | 2 +- .../core/runtime/rule/impl/RowAdapter.java | 15 ++-- .../drools/core/time/TimerExpressionUtil.java | 4 +- .../org/drools/core/time/impl/BaseTimer.java | 10 +-- .../time/impl/CompositeMaxDurationTimer.java | 6 +- .../impl/CompositeMaxDurationTrigger.java | 4 +- .../drools/core/time/impl/CronExpression.java | 3 +- .../org/drools/core/time/impl/CronTimer.java | 44 +++++++--- .../drools/core/time/impl/CronTrigger.java | 6 +- .../core/time/impl/DefaultJobHandle.java | 20 +++-- .../impl/DefaultTimerJobFactoryManager.java | 4 +- .../time/impl/DefaultTimerJobInstance.java | 12 +-- .../drools/core/time/impl/DurationTimer.java | 26 +++--- .../time/impl/ExpressionIntervalTimer.java | 44 +++++++--- .../drools/core/time/impl/IntervalTimer.java | 42 +++++++--- .../core/time/impl/JDKTimerService.java | 16 ++-- .../core/time/impl/PseudoClockScheduler.java | 20 ++--- ...eadSafeTrackableTimeJobFactoryManager.java | 4 +- .../time/impl/TimerJobFactoryManager.java | 8 +- .../core/time/impl/TimerJobInstance.java | 4 +- .../impl/TrackableTimeJobFactoryManager.java | 12 +-- .../drools/core/util/AbstractHashTable.java | 24 ++++-- .../java/org/drools/core/util/ArrayQueue.java | 1 - .../org/drools/core/util/BinaryHeapQueue.java | 3 +- .../org/drools/core/util/KieFunctions.java | 80 ++++++++++++++----- .../java/org/drools/core/util/LinkedList.java | 7 +- .../org/drools/core/util/TupleRBTree.java | 76 ++++++++++++------ .../util/index/AbstractTupleIndexTree.java | 2 +- .../core/util/index/AlphaRangeIndex.java | 4 +- .../drools/core/util/index/IndexFactory.java | 4 +- .../org/drools/core/util/index/IndexSpec.java | 6 +- .../drools/core/util/index/RangeIndex.java | 18 +++-- .../core/util/index/TupleIndexHashTable.java | 9 +-- .../org/drools/core/util/index/TupleList.java | 3 +- .../core/base/ClassTypeResolverTest.java | 4 +- .../base/accumulators/VarianceNaNTest.java | 8 +- .../core/common/DroolsObjectIOTest.java | 2 +- .../FactTemplateFieldExtractorTest.java | 2 +- .../ByteArrayResourceSerializationTest.java | 38 ++++----- .../impl/ByteArrayResourceToStringTest.java | 10 +-- .../org/drools/core/reteoo/BaseNodeTest.java | 4 +- .../reteoo/DefaultFactHandleFactoryTest.java | 2 +- .../drools/core/reteoo/MockLeftTupleSink.java | 2 +- .../drools/core/reteoo/MockObjectSink.java | 4 +- .../drools/core/reteoo/MockObjectSource.java | 8 +- .../core/reteoo/MockRightTupleSink.java | 2 +- .../drools/core/reteoo/NodeTypeEnumTest.java | 6 +- .../drools/core/reteoo/ReteComparator.java | 2 +- .../drools/core/reteoo/ReteMemoryChecker.java | 2 +- .../core/reteoo/TupleIterationTest.java | 3 +- .../reteoo/builder/ReteooRuleBuilderTest.java | 8 +- .../org/drools/core/test/model/Address.java | 36 ++++++--- .../org/drools/core/test/model/Person.java | 76 +++++++++++++----- .../impl/CompositeMaxDurationTimerTest.java | 4 +- .../core/time/impl/JDKTimerServiceTest.java | 4 +- .../time/impl/PseudoClockSchedulerTest.java | 4 +- .../drools/core/util/BinaryHeapQueueTest.java | 12 +-- .../drools/core/util/DroolsStreamUtils.java | 3 +- .../java/org/drools/core/util/HeapDump.java | 3 +- .../util/IndexedHashtableIteratorTest.java | 6 +- .../org/drools/core/util/IoUtilsTest.java | 10 +-- .../drools/core/util/KeyStoreHelperTest.java | 1 + .../drools/core/util/KieFunctionsTest.java | 3 +- .../drools/core/util/LeftTupleRBTreeTest.java | 4 +- .../drools/core/util/index/IndexUtilTest.java | 10 +-- 254 files changed, 1280 insertions(+), 967 deletions(-) diff --git a/drools-core/src/main/java/org/drools/core/ActivationListenerFactory.java b/drools-core/src/main/java/org/drools/core/ActivationListenerFactory.java index 78c62a7e2a9..8fff8bf89eb 100644 --- a/drools-core/src/main/java/org/drools/core/ActivationListenerFactory.java +++ b/drools-core/src/main/java/org/drools/core/ActivationListenerFactory.java @@ -19,10 +19,10 @@ package org.drools.core; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.GroupElement; import org.drools.core.reteoo.LeftTupleSource; import org.drools.core.reteoo.TerminalNode; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.GroupElement; public interface ActivationListenerFactory { TerminalNode createActivationListener(int id, diff --git a/drools-core/src/main/java/org/drools/core/FlowSessionConfiguration.java b/drools-core/src/main/java/org/drools/core/FlowSessionConfiguration.java index 51499fc5b56..3716b5f1a52 100644 --- a/drools-core/src/main/java/org/drools/core/FlowSessionConfiguration.java +++ b/drools-core/src/main/java/org/drools/core/FlowSessionConfiguration.java @@ -198,8 +198,12 @@ public final String getInternalProperty(String name) { @Override public final boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } FlowSessionConfiguration that = (FlowSessionConfiguration) o; diff --git a/drools-core/src/main/java/org/drools/core/QueryActivationListenerFactory.java b/drools-core/src/main/java/org/drools/core/QueryActivationListenerFactory.java index 5d35b854829..a302c678ddc 100644 --- a/drools-core/src/main/java/org/drools/core/QueryActivationListenerFactory.java +++ b/drools-core/src/main/java/org/drools/core/QueryActivationListenerFactory.java @@ -19,11 +19,11 @@ package org.drools.core; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.GroupElement; import org.drools.core.reteoo.CoreComponentFactory; import org.drools.core.reteoo.LeftTupleSource; import org.drools.core.reteoo.TerminalNode; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.GroupElement; public class QueryActivationListenerFactory implements ActivationListenerFactory { public static final QueryActivationListenerFactory INSTANCE = new QueryActivationListenerFactory(); diff --git a/drools-core/src/main/java/org/drools/core/QueryResultsImpl.java b/drools-core/src/main/java/org/drools/core/QueryResultsImpl.java index fd2cf7a6cf7..3c0e2a7551c 100644 --- a/drools-core/src/main/java/org/drools/core/QueryResultsImpl.java +++ b/drools-core/src/main/java/org/drools/core/QueryResultsImpl.java @@ -26,9 +26,9 @@ import java.util.NoSuchElementException; import java.util.Set; +import org.drools.base.rule.Declaration; import org.drools.core.base.QueryRowWithSubruleIndex; import org.drools.core.common.ReteEvaluator; -import org.drools.base.rule.Declaration; import org.kie.api.runtime.rule.QueryResults; import org.kie.api.runtime.rule.QueryResultsRow; diff --git a/drools-core/src/main/java/org/drools/core/QueryResultsRowImpl.java b/drools-core/src/main/java/org/drools/core/QueryResultsRowImpl.java index 53d599f8e89..ef82c7dcb3e 100644 --- a/drools-core/src/main/java/org/drools/core/QueryResultsRowImpl.java +++ b/drools-core/src/main/java/org/drools/core/QueryResultsRowImpl.java @@ -20,10 +20,10 @@ import java.util.Map; +import org.drools.base.rule.Declaration; import org.drools.core.base.QueryRowWithSubruleIndex; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; -import org.drools.base.rule.Declaration; import org.kie.api.runtime.rule.FactHandle; import org.kie.api.runtime.rule.QueryResultsRow; diff --git a/drools-core/src/main/java/org/drools/core/RuleActivationListenerFactory.java b/drools-core/src/main/java/org/drools/core/RuleActivationListenerFactory.java index 2e5193fdb31..2c688146cec 100644 --- a/drools-core/src/main/java/org/drools/core/RuleActivationListenerFactory.java +++ b/drools-core/src/main/java/org/drools/core/RuleActivationListenerFactory.java @@ -19,11 +19,11 @@ package org.drools.core; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.GroupElement; import org.drools.core.reteoo.CoreComponentFactory; import org.drools.core.reteoo.LeftTupleSource; import org.drools.core.reteoo.TerminalNode; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.GroupElement; public class RuleActivationListenerFactory implements ActivationListenerFactory { diff --git a/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java b/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java index 0f4d0bde74d..214e8ea8ceb 100755 --- a/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java +++ b/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java @@ -18,6 +18,13 @@ */ package org.drools.core; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.HashMap; +import java.util.Map; + import org.drools.base.rule.consequence.ConflictResolver; import org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler; import org.drools.util.StringUtils; @@ -52,13 +59,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.HashMap; -import java.util.Map; - /** * RuleBaseConfiguration * @@ -878,7 +878,9 @@ private AssertBehaviour(final int value) { } public boolean equals(Object obj) { - if (obj == this) return true; + if (obj == this) { + return true; + } else if (obj instanceof AssertBehaviour) { AssertBehaviour that = (AssertBehaviour) obj; diff --git a/drools-core/src/main/java/org/drools/core/RuleSessionConfiguration.java b/drools-core/src/main/java/org/drools/core/RuleSessionConfiguration.java index b03f4d5212d..b0713b20c6a 100644 --- a/drools-core/src/main/java/org/drools/core/RuleSessionConfiguration.java +++ b/drools-core/src/main/java/org/drools/core/RuleSessionConfiguration.java @@ -293,8 +293,12 @@ public String getInternalProperty(String name) { @Override public final boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } RuleSessionConfiguration that = (RuleSessionConfiguration) o; diff --git a/drools-core/src/main/java/org/drools/core/SessionConfiguration.java b/drools-core/src/main/java/org/drools/core/SessionConfiguration.java index a087e43644b..38f5ce77346 100644 --- a/drools-core/src/main/java/org/drools/core/SessionConfiguration.java +++ b/drools-core/src/main/java/org/drools/core/SessionConfiguration.java @@ -283,8 +283,12 @@ public TimerService createTimerService() { @Override public final boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } SessionConfiguration that = (SessionConfiguration) o; diff --git a/drools-core/src/main/java/org/drools/core/TimerJobFactoryType.java b/drools-core/src/main/java/org/drools/core/TimerJobFactoryType.java index ebba16257a4..0ff7a94061c 100644 --- a/drools-core/src/main/java/org/drools/core/TimerJobFactoryType.java +++ b/drools-core/src/main/java/org/drools/core/TimerJobFactoryType.java @@ -60,16 +60,16 @@ public TimerJobFactoryManager createInstance() { private static final Map registry = new HashMap<>(); static { - register(DEFAULT); - register(TRACKABLE); - register(THREAD_SAFE_TRACKABLE); - register(JPA); + register(DEFAULT); + register(TRACKABLE); + register(THREAD_SAFE_TRACKABLE); + register(JPA); } public static void register(TimerJobFactoryType type) { - if (type != null && type.getId() != null) { - registry.put(type.getId(), type); - } + if (type != null && type.getId() != null) { + registry.put(type.getId(), type); + } } public abstract TimerJobFactoryManager createInstance(); @@ -95,7 +95,7 @@ public String getId() { public static TimerJobFactoryType resolveTimerJobFactoryType( String id ) { TimerJobFactoryType type = registry.get(id); if (type != null) { - return type; + return type; } throw new IllegalArgumentException( "Illegal enum value '" + id + "' for TimerJobFactoryType" ); } diff --git a/drools-core/src/main/java/org/drools/core/WorkingMemory.java b/drools-core/src/main/java/org/drools/core/WorkingMemory.java index 5991a5dac57..8460485386a 100644 --- a/drools-core/src/main/java/org/drools/core/WorkingMemory.java +++ b/drools-core/src/main/java/org/drools/core/WorkingMemory.java @@ -22,9 +22,9 @@ import java.util.Iterator; import java.util.Map; +import org.drools.base.rule.accessor.GlobalResolver; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; -import org.drools.base.rule.accessor.GlobalResolver; import org.kie.api.runtime.Environment; import org.kie.api.runtime.process.ProcessInstance; import org.kie.api.runtime.process.WorkItemManager; diff --git a/drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java b/drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java index 982ce46fd3d..0c23b6e4bd6 100644 --- a/drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java +++ b/drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java @@ -18,17 +18,16 @@ */ package org.drools.core; - +import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.EntryPointId; import org.drools.core.common.ObjectStore; import org.drools.core.common.ObjectTypeConfigurationRegistry; import org.drools.core.common.ReteEvaluator; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.impl.InternalRuleBase; import org.drools.core.reteoo.EntryPointNode; import org.drools.core.reteoo.TerminalNode; -import org.drools.base.rule.EntryPointId; -import org.drools.core.rule.consequence.InternalMatch; import org.drools.core.rule.accessor.FactHandleFactory; +import org.drools.core.rule.consequence.InternalMatch; import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.EntryPoint; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/base/AbstractQueryViewListener.java b/drools-core/src/main/java/org/drools/core/base/AbstractQueryViewListener.java index 1ad3b510187..d22b3345579 100644 --- a/drools-core/src/main/java/org/drools/core/base/AbstractQueryViewListener.java +++ b/drools-core/src/main/java/org/drools/core/base/AbstractQueryViewListener.java @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; -import org.drools.core.common.ReteEvaluator; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleNode; import org.drools.core.reteoo.QueryTerminalNode; diff --git a/drools-core/src/main/java/org/drools/core/base/ArrayElements.java b/drools-core/src/main/java/org/drools/core/base/ArrayElements.java index 6c17e910f7e..9301d93da1a 100644 --- a/drools-core/src/main/java/org/drools/core/base/ArrayElements.java +++ b/drools-core/src/main/java/org/drools/core/base/ArrayElements.java @@ -19,6 +19,7 @@ package org.drools.core.base; import java.util.Arrays; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -59,12 +60,20 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } ArrayElements other = (ArrayElements) obj; if ( !Arrays.equals( elements, - other.elements ) ) return false; + other.elements ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/base/ClassFieldAccessorCache.java b/drools-core/src/main/java/org/drools/core/base/ClassFieldAccessorCache.java index ca875d550e9..4c53370b1c0 100644 --- a/drools-core/src/main/java/org/drools/core/base/ClassFieldAccessorCache.java +++ b/drools-core/src/main/java/org/drools/core/base/ClassFieldAccessorCache.java @@ -84,13 +84,23 @@ public int hashCode() { } public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( !(obj instanceof ClassObjectTypeKey) ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( !(obj instanceof ClassObjectTypeKey) ) { + return false; + } ClassObjectTypeKey other = (ClassObjectTypeKey) obj; if ( cls == null ) { - if ( other.cls != null ) return false; - } else if ( !cls.equals( other.cls ) ) return false; + if ( other.cls != null ) { + return false; + } + } else if ( !cls.equals( other.cls ) ) { + return false; + } return event == other.event; } diff --git a/drools-core/src/main/java/org/drools/core/base/DroolsQueryImpl.java b/drools-core/src/main/java/org/drools/core/base/DroolsQueryImpl.java index a86713ad743..29346afad93 100644 --- a/drools-core/src/main/java/org/drools/core/base/DroolsQueryImpl.java +++ b/drools-core/src/main/java/org/drools/core/base/DroolsQueryImpl.java @@ -22,6 +22,7 @@ import java.util.List; import org.drools.base.base.DroolsQuery; +import org.drools.base.definitions.rule.impl.QueryImpl; import org.drools.core.common.TupleSets; import org.drools.core.common.WorkingMemoryAction; import org.drools.core.phreak.StackEntry; @@ -29,7 +30,6 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.PathMemory; import org.drools.core.reteoo.QueryElementNode.QueryElementNodeMemory; -import org.drools.base.definitions.rule.impl.QueryImpl; import org.drools.core.util.index.TupleList; import org.kie.api.runtime.rule.Variable; diff --git a/drools-core/src/main/java/org/drools/core/base/InternalViewChangedEventListener.java b/drools-core/src/main/java/org/drools/core/base/InternalViewChangedEventListener.java index 4fbd73e2cd4..53e4627de1d 100644 --- a/drools-core/src/main/java/org/drools/core/base/InternalViewChangedEventListener.java +++ b/drools-core/src/main/java/org/drools/core/base/InternalViewChangedEventListener.java @@ -20,8 +20,8 @@ import java.util.List; -import org.drools.core.common.ReteEvaluator; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.LeftTuple; public interface InternalViewChangedEventListener { diff --git a/drools-core/src/main/java/org/drools/core/base/NonCloningQueryViewListener.java b/drools-core/src/main/java/org/drools/core/base/NonCloningQueryViewListener.java index 65f3eaacc35..3f431fdbf34 100644 --- a/drools-core/src/main/java/org/drools/core/base/NonCloningQueryViewListener.java +++ b/drools-core/src/main/java/org/drools/core/base/NonCloningQueryViewListener.java @@ -18,7 +18,6 @@ */ package org.drools.core.base; -import org.drools.core.common.InternalFactHandle; import org.kie.api.runtime.rule.FactHandle; public class NonCloningQueryViewListener diff --git a/drools-core/src/main/java/org/drools/core/base/QueryRowWithSubruleIndex.java b/drools-core/src/main/java/org/drools/core/base/QueryRowWithSubruleIndex.java index c68b169e55b..c7c0cb480fc 100644 --- a/drools-core/src/main/java/org/drools/core/base/QueryRowWithSubruleIndex.java +++ b/drools-core/src/main/java/org/drools/core/base/QueryRowWithSubruleIndex.java @@ -18,7 +18,6 @@ */ package org.drools.core.base; -import org.drools.core.common.InternalFactHandle; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/base/RuleNameEndsWithAgendaFilter.java b/drools-core/src/main/java/org/drools/core/base/RuleNameEndsWithAgendaFilter.java index 6b5556a52c4..50ea110d72a 100644 --- a/drools-core/src/main/java/org/drools/core/base/RuleNameEndsWithAgendaFilter.java +++ b/drools-core/src/main/java/org/drools/core/base/RuleNameEndsWithAgendaFilter.java @@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; + import org.kie.api.runtime.rule.AgendaFilter; import org.kie.api.runtime.rule.Match; diff --git a/drools-core/src/main/java/org/drools/core/base/RuleNameEqualsAgendaFilter.java b/drools-core/src/main/java/org/drools/core/base/RuleNameEqualsAgendaFilter.java index 3401e228162..398651d8249 100644 --- a/drools-core/src/main/java/org/drools/core/base/RuleNameEqualsAgendaFilter.java +++ b/drools-core/src/main/java/org/drools/core/base/RuleNameEqualsAgendaFilter.java @@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; + import org.kie.api.runtime.rule.AgendaFilter; import org.kie.api.runtime.rule.Match; diff --git a/drools-core/src/main/java/org/drools/core/base/RuleNameMatchesAgendaFilter.java b/drools-core/src/main/java/org/drools/core/base/RuleNameMatchesAgendaFilter.java index d535a3be948..55a226bd99e 100644 --- a/drools-core/src/main/java/org/drools/core/base/RuleNameMatchesAgendaFilter.java +++ b/drools-core/src/main/java/org/drools/core/base/RuleNameMatchesAgendaFilter.java @@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; + import org.kie.api.runtime.rule.AgendaFilter; import org.kie.api.runtime.rule.Match; diff --git a/drools-core/src/main/java/org/drools/core/base/RuleNameStartsWithAgendaFilter.java b/drools-core/src/main/java/org/drools/core/base/RuleNameStartsWithAgendaFilter.java index 53047b62f34..285b2602674 100644 --- a/drools-core/src/main/java/org/drools/core/base/RuleNameStartsWithAgendaFilter.java +++ b/drools-core/src/main/java/org/drools/core/base/RuleNameStartsWithAgendaFilter.java @@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; + import org.kie.api.runtime.rule.AgendaFilter; import org.kie.api.runtime.rule.Match; diff --git a/drools-core/src/main/java/org/drools/core/base/TraitHelper.java b/drools-core/src/main/java/org/drools/core/base/TraitHelper.java index a91aa7df474..9e86e1e3a21 100644 --- a/drools-core/src/main/java/org/drools/core/base/TraitHelper.java +++ b/drools-core/src/main/java/org/drools/core/base/TraitHelper.java @@ -20,14 +20,14 @@ import java.util.Collection; -import org.drools.core.common.InternalFactHandle; +import org.drools.base.beliefsystem.Mode; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.factmodel.traits.Thing; import org.drools.base.factmodel.traits.TraitableBean; +import org.drools.core.common.InternalFactHandle; import org.drools.core.reteoo.TerminalNode; import org.drools.core.rule.consequence.InternalMatch; import org.drools.util.bitmask.BitMask; -import org.drools.base.beliefsystem.Mode; public interface TraitHelper { diff --git a/drools-core/src/main/java/org/drools/core/base/accumulators/CollectAccumulator.java b/drools-core/src/main/java/org/drools/core/base/accumulators/CollectAccumulator.java index 78b864cc513..80a19d19a1e 100644 --- a/drools-core/src/main/java/org/drools/core/base/accumulators/CollectAccumulator.java +++ b/drools-core/src/main/java/org/drools/core/base/accumulators/CollectAccumulator.java @@ -18,11 +18,6 @@ */ package org.drools.core.base.accumulators; -import org.drools.core.reteoo.LeftTuple; -import org.drools.base.rule.Collect; -import org.drools.base.rule.Declaration; -import org.drools.base.rule.accessor.Accumulator; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -32,6 +27,10 @@ import org.drools.base.base.ValueResolver; import org.drools.base.reteoo.BaseTuple; +import org.drools.base.rule.Collect; +import org.drools.base.rule.Declaration; +import org.drools.base.rule.accessor.Accumulator; +import org.drools.core.reteoo.LeftTuple; import org.kie.api.runtime.rule.FactHandle; /** diff --git a/drools-core/src/main/java/org/drools/core/base/accumulators/JavaAccumulatorFunctionExecutor.java b/drools-core/src/main/java/org/drools/core/base/accumulators/JavaAccumulatorFunctionExecutor.java index 5fd28ac8eb1..0044a97189b 100644 --- a/drools-core/src/main/java/org/drools/core/base/accumulators/JavaAccumulatorFunctionExecutor.java +++ b/drools-core/src/main/java/org/drools/core/base/accumulators/JavaAccumulatorFunctionExecutor.java @@ -161,8 +161,12 @@ public Object createWorkingMemoryContext() { @Override public boolean equals( Object o ) { - if ( this == o ) return true; - if ( o == null || getClass() != o.getClass() ) return false; + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } JavaAccumulatorFunctionExecutor that = (JavaAccumulatorFunctionExecutor) o; diff --git a/drools-core/src/main/java/org/drools/core/common/AgendaGroupQueueImpl.java b/drools-core/src/main/java/org/drools/core/common/AgendaGroupQueueImpl.java index 4c2df781496..985d42b237b 100644 --- a/drools-core/src/main/java/org/drools/core/common/AgendaGroupQueueImpl.java +++ b/drools-core/src/main/java/org/drools/core/common/AgendaGroupQueueImpl.java @@ -18,6 +18,12 @@ */ package org.drools.core.common; +import java.io.IOException; +import java.util.Collection; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.concurrent.ConcurrentHashMap; + import org.drools.core.conflict.RuleAgendaConflictResolver; import org.drools.core.impl.InternalRuleBase; import org.drools.core.marshalling.MarshallerReaderContext; @@ -27,12 +33,6 @@ import org.drools.core.util.Queue; import org.drools.core.util.QueueFactory; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.PriorityQueue; -import java.util.concurrent.ConcurrentHashMap; - /** * AgendaGroup implementation that uses a PriorityQueue to prioritise the evaluation of added * ActivationQueues. The AgendaGroup also maintains a Map of ActivationQueues diff --git a/drools-core/src/main/java/org/drools/core/common/AgendaGroupsManager.java b/drools-core/src/main/java/org/drools/core/common/AgendaGroupsManager.java index dc5d8225265..84f5a354eb5 100644 --- a/drools-core/src/main/java/org/drools/core/common/AgendaGroupsManager.java +++ b/drools-core/src/main/java/org/drools/core/common/AgendaGroupsManager.java @@ -18,10 +18,6 @@ */ package org.drools.core.common; -import org.drools.core.impl.InternalRuleBase; -import org.drools.core.phreak.RuleAgendaItem; -import org.drools.core.reteoo.RuntimeComponentFactory; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -36,6 +32,10 @@ import java.util.Map; import java.util.stream.Collectors; +import org.drools.core.impl.InternalRuleBase; +import org.drools.core.phreak.RuleAgendaItem; +import org.drools.core.reteoo.RuntimeComponentFactory; + public interface AgendaGroupsManager extends Externalizable { void reset(boolean clearForRecency); @@ -472,7 +472,7 @@ public void deactivateRuleFlowGroup(final String name) { return; } this.workingMemory.getAgendaEventSupport().fireBeforeRuleFlowGroupDeactivated( group, this.workingMemory ); - while ( removeGroup(group) ); // keep removing while group is on the stack + while ( removeGroup(group) ) {}; // keep removing while group is on the stack group.setActive( false ); innerDeactiveRuleFlowGroup( group ); this.workingMemory.getAgendaEventSupport().fireAfterRuleFlowGroupDeactivated( group, this.workingMemory ); diff --git a/drools-core/src/main/java/org/drools/core/common/BaseNode.java b/drools-core/src/main/java/org/drools/core/common/BaseNode.java index 08f5375e1b8..b966c33a4ab 100644 --- a/drools-core/src/main/java/org/drools/core/common/BaseNode.java +++ b/drools-core/src/main/java/org/drools/core/common/BaseNode.java @@ -18,6 +18,12 @@ */ package org.drools.core.common; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import org.drools.base.common.NetworkNode; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.BaseTerminalNode; @@ -32,12 +38,6 @@ import org.drools.core.reteoo.builder.BuildContext; import org.kie.api.definition.rule.Rule; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - /** * The base class for all Rete nodes. */ diff --git a/drools-core/src/main/java/org/drools/core/common/ClassAwareObjectStore.java b/drools-core/src/main/java/org/drools/core/common/ClassAwareObjectStore.java index 99a95e86b07..19eb9b2b03d 100644 --- a/drools-core/src/main/java/org/drools/core/common/ClassAwareObjectStore.java +++ b/drools-core/src/main/java/org/drools/core/common/ClassAwareObjectStore.java @@ -18,10 +18,6 @@ */ package org.drools.core.common; -import org.drools.base.factmodel.traits.CoreWrapper; -import org.kie.api.runtime.ClassObjectFilter; -import org.kie.api.runtime.ObjectFilter; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -36,6 +32,10 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.locks.Lock; +import org.drools.base.factmodel.traits.CoreWrapper; +import org.kie.api.runtime.ClassObjectFilter; +import org.kie.api.runtime.ObjectFilter; + public class ClassAwareObjectStore implements Externalizable, ObjectStore { private Lock lock; diff --git a/drools-core/src/main/java/org/drools/core/common/ConcurrentNodeMemories.java b/drools-core/src/main/java/org/drools/core/common/ConcurrentNodeMemories.java index b1199fdafd7..da7d6c4886f 100644 --- a/drools-core/src/main/java/org/drools/core/common/ConcurrentNodeMemories.java +++ b/drools-core/src/main/java/org/drools/core/common/ConcurrentNodeMemories.java @@ -18,16 +18,16 @@ */ package org.drools.core.common; -import org.drools.core.impl.InternalRuleBase; -import org.drools.core.reteoo.SegmentMemory; -import org.kie.internal.runtime.StatefulKnowledgeSession; - import java.util.HashSet; import java.util.Set; import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.drools.core.impl.InternalRuleBase; +import org.drools.core.reteoo.SegmentMemory; +import org.kie.internal.runtime.StatefulKnowledgeSession; + /** * A concurrent implementation for the node memories interface */ diff --git a/drools-core/src/main/java/org/drools/core/common/DefaultBetaConstraints.java b/drools-core/src/main/java/org/drools/core/common/DefaultBetaConstraints.java index e67af52c930..9260152db1c 100644 --- a/drools-core/src/main/java/org/drools/core/common/DefaultBetaConstraints.java +++ b/drools-core/src/main/java/org/drools/core/common/DefaultBetaConstraints.java @@ -35,8 +35,8 @@ import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.Tuple; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.util.bitmask.BitMask; import org.drools.core.util.index.IndexFactory; +import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; import org.kie.internal.conf.IndexPrecedenceOption; diff --git a/drools-core/src/main/java/org/drools/core/common/DefaultFactHandle.java b/drools-core/src/main/java/org/drools/core/common/DefaultFactHandle.java index c3a8820eec1..f78edfeecd1 100644 --- a/drools-core/src/main/java/org/drools/core/common/DefaultFactHandle.java +++ b/drools-core/src/main/java/org/drools/core/common/DefaultFactHandle.java @@ -18,6 +18,16 @@ */ package org.drools.core.common; +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + import org.drools.base.factmodel.traits.TraitTypeEnum; import org.drools.base.rule.EntryPointId; import org.drools.core.WorkingMemoryEntryPoint; @@ -31,15 +41,6 @@ import org.drools.util.StringUtils; import org.kie.api.runtime.rule.FactHandle; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Predicate; -import java.util.stream.Stream; - /** * Implementation of FactHandle. */ diff --git a/drools-core/src/main/java/org/drools/core/common/DisconnectedFactHandle.java b/drools-core/src/main/java/org/drools/core/common/DisconnectedFactHandle.java index 2710924f631..f3b76bf1444 100644 --- a/drools-core/src/main/java/org/drools/core/common/DisconnectedFactHandle.java +++ b/drools-core/src/main/java/org/drools/core/common/DisconnectedFactHandle.java @@ -18,6 +18,21 @@ */ package org.drools.core.common; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; + import org.drools.base.factmodel.traits.TraitTypeEnum; import org.drools.base.rule.EntryPointId; import org.drools.core.WorkingMemoryEntryPoint; @@ -28,20 +43,6 @@ import org.drools.core.reteoo.Tuple; import org.kie.api.runtime.rule.FactHandle; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.function.Consumer; -import java.util.function.Predicate; - @XmlRootElement(name="disconnected-fact-handle") @XmlAccessorType(XmlAccessType.NONE) @XmlSeeAlso({ArrayElements.class}) diff --git a/drools-core/src/main/java/org/drools/core/common/EmptyBetaConstraints.java b/drools-core/src/main/java/org/drools/core/common/EmptyBetaConstraints.java index 4665629fc78..803b64e00a4 100644 --- a/drools-core/src/main/java/org/drools/core/common/EmptyBetaConstraints.java +++ b/drools-core/src/main/java/org/drools/core/common/EmptyBetaConstraints.java @@ -31,8 +31,8 @@ import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.Tuple; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.util.bitmask.BitMask; import org.drools.core.util.index.TupleList; +import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; import static org.drools.base.reteoo.PropertySpecificUtil.getEmptyPropertyReactiveMask; diff --git a/drools-core/src/main/java/org/drools/core/common/EntryPointFactory.java b/drools-core/src/main/java/org/drools/core/common/EntryPointFactory.java index b4a980cfafa..14db19ce5b8 100644 --- a/drools-core/src/main/java/org/drools/core/common/EntryPointFactory.java +++ b/drools-core/src/main/java/org/drools/core/common/EntryPointFactory.java @@ -18,9 +18,9 @@ */ package org.drools.core.common; +import org.drools.base.rule.EntryPointId; import org.drools.core.EntryPointsManager; import org.drools.core.reteoo.EntryPointNode; -import org.drools.base.rule.EntryPointId; public interface EntryPointFactory { diff --git a/drools-core/src/main/java/org/drools/core/common/InternalAgenda.java b/drools-core/src/main/java/org/drools/core/common/InternalAgenda.java index e5b8c8bd621..a7e1755c90d 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalAgenda.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalAgenda.java @@ -18,13 +18,13 @@ */ package org.drools.core.common; +import java.util.Iterator; +import java.util.Map; + import org.drools.core.phreak.PropagationEntry; import org.kie.api.runtime.rule.Agenda; import org.kie.api.runtime.rule.AgendaFilter; -import java.util.Iterator; -import java.util.Map; - public interface InternalAgenda extends Agenda, ActivationsManager { /** diff --git a/drools-core/src/main/java/org/drools/core/common/InternalAgendaGroup.java b/drools-core/src/main/java/org/drools/core/common/InternalAgendaGroup.java index 8042993155d..5982dbfca08 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalAgendaGroup.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalAgendaGroup.java @@ -18,11 +18,11 @@ */ package org.drools.core.common; -import org.drools.core.phreak.RuleAgendaItem; - import java.util.Collection; import java.util.Map; +import org.drools.core.phreak.RuleAgendaItem; + public interface InternalAgendaGroup extends org.kie.api.runtime.rule.AgendaGroup { /** diff --git a/drools-core/src/main/java/org/drools/core/common/InternalFactHandle.java b/drools-core/src/main/java/org/drools/core/common/InternalFactHandle.java index ba247a32492..27f7af36c1c 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalFactHandle.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalFactHandle.java @@ -18,6 +18,10 @@ */ package org.drools.core.common; +import java.io.Serializable; +import java.util.function.Consumer; +import java.util.function.Predicate; + import org.drools.base.common.RuleBasePartitionId; import org.drools.base.factmodel.traits.TraitTypeEnum; import org.drools.base.rule.EntryPointId; @@ -27,10 +31,6 @@ import org.drools.core.reteoo.Tuple; import org.kie.api.runtime.rule.FactHandle; -import java.io.Serializable; -import java.util.function.Consumer; -import java.util.function.Predicate; - public interface InternalFactHandle extends FactHandle, Cloneable, Serializable { diff --git a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemory.java b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemory.java index 950a6c7f602..cf4594691b4 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemory.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemory.java @@ -28,8 +28,8 @@ import org.drools.core.event.AgendaEventSupport; import org.drools.core.event.RuleRuntimeEventSupport; import org.drools.core.phreak.PropagationEntry; -import org.drools.core.runtime.process.InternalProcessRuntime; import org.drools.core.rule.consequence.InternalMatch; +import org.drools.core.runtime.process.InternalProcessRuntime; import org.kie.api.runtime.Channel; import org.kie.api.runtime.rule.EntryPoint; diff --git a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryActions.java b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryActions.java index dfa1f316901..86727367d7d 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryActions.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryActions.java @@ -20,15 +20,15 @@ import java.util.Collection; -import org.drools.core.WorkingMemoryEntryPoint; +import org.drools.base.beliefsystem.Mode; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.factmodel.traits.Thing; import org.drools.base.factmodel.traits.TraitableBean; +import org.drools.core.WorkingMemoryEntryPoint; import org.drools.core.reteoo.TerminalNode; import org.drools.core.rule.consequence.InternalMatch; import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; -import org.drools.base.beliefsystem.Mode; public interface InternalWorkingMemoryActions extends diff --git a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryEntryPoint.java b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryEntryPoint.java index ebf3a72985c..9d4164d0244 100644 --- a/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryEntryPoint.java +++ b/drools-core/src/main/java/org/drools/core/common/InternalWorkingMemoryEntryPoint.java @@ -18,9 +18,9 @@ */ package org.drools.core.common; +import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.WorkingMemoryEntryPoint; import org.drools.core.base.TraitHelper; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.reteoo.ObjectTypeConf; import org.drools.core.reteoo.TerminalNode; import org.drools.core.rule.consequence.InternalMatch; diff --git a/drools-core/src/main/java/org/drools/core/common/MultipleBetaConstraint.java b/drools-core/src/main/java/org/drools/core/common/MultipleBetaConstraint.java index 99e76625ffb..d082fc12cb0 100644 --- a/drools-core/src/main/java/org/drools/core/common/MultipleBetaConstraint.java +++ b/drools-core/src/main/java/org/drools/core/common/MultipleBetaConstraint.java @@ -22,12 +22,12 @@ import java.io.ObjectInput; import java.io.ObjectOutput; -import org.drools.core.RuleBaseConfiguration; -import org.drools.core.reteoo.BetaMemory; -import org.drools.core.reteoo.builder.BuildContext; import org.drools.base.rule.ContextEntry; import org.drools.base.rule.IndexableConstraint; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; +import org.drools.core.RuleBaseConfiguration; +import org.drools.core.reteoo.BetaMemory; +import org.drools.core.reteoo.builder.BuildContext; import org.drools.core.util.index.IndexFactory; import org.kie.internal.conf.IndexPrecedenceOption; diff --git a/drools-core/src/main/java/org/drools/core/common/ObjectStore.java b/drools-core/src/main/java/org/drools/core/common/ObjectStore.java index 2ea6c0157eb..cd00af5ed43 100644 --- a/drools-core/src/main/java/org/drools/core/common/ObjectStore.java +++ b/drools-core/src/main/java/org/drools/core/common/ObjectStore.java @@ -18,11 +18,11 @@ */ package org.drools.core.common; +import java.util.Iterator; + import org.kie.api.internal.utils.KieService; import org.kie.api.runtime.ObjectFilter; -import java.util.Iterator; - public interface ObjectStore extends KieService { int size(); diff --git a/drools-core/src/main/java/org/drools/core/common/ObjectStoreWrapper.java b/drools-core/src/main/java/org/drools/core/common/ObjectStoreWrapper.java index 42390ff52d1..79237d9f9b7 100644 --- a/drools-core/src/main/java/org/drools/core/common/ObjectStoreWrapper.java +++ b/drools-core/src/main/java/org/drools/core/common/ObjectStoreWrapper.java @@ -19,9 +19,7 @@ package org.drools.core.common; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Iterator; import java.util.List; diff --git a/drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java b/drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java index 7bfdc976948..8821488803d 100644 --- a/drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java +++ b/drools-core/src/main/java/org/drools/core/common/ObjectTypeConfigurationRegistry.java @@ -24,16 +24,16 @@ import java.util.concurrent.ConcurrentHashMap; import org.drools.base.base.ClassObjectType; +import org.drools.base.base.ObjectType; import org.drools.base.facttemplates.Fact; import org.drools.base.facttemplates.FactImpl; +import org.drools.base.rule.EntryPointId; import org.drools.core.impl.InternalRuleBase; import org.drools.core.reteoo.ClassObjectTypeConf; import org.drools.core.reteoo.FactTemplateTypeConf; import org.drools.core.reteoo.ObjectTypeConf; -import org.drools.base.rule.EntryPointId; import org.drools.core.reteoo.RuleTerminalNodeLeftTuple; import org.drools.core.rule.consequence.InternalMatch; -import org.drools.base.base.ObjectType; public class ObjectTypeConfigurationRegistry implements Serializable { private static final long serialVersionUID = 510l; diff --git a/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContext.java b/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContext.java index 76122e30f60..9ed03254444 100644 --- a/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContext.java +++ b/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContext.java @@ -18,6 +18,12 @@ */ package org.drools.core.common; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Collections; +import java.util.List; + import org.drools.base.base.ClassObjectType; import org.drools.base.base.ObjectType; import org.drools.base.definitions.InternalKnowledgePackage; @@ -30,12 +36,6 @@ import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.Collections; -import java.util.List; - import static org.drools.base.reteoo.PropertySpecificUtil.allSetBitMask; import static org.drools.base.reteoo.PropertySpecificUtil.getEmptyPropertyReactiveMask; import static org.drools.base.reteoo.PropertySpecificUtil.isAllSetPropertyReactiveMask; diff --git a/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContextFactory.java b/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContextFactory.java index 514bb19edf9..ddaf282802c 100644 --- a/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContextFactory.java +++ b/drools-core/src/main/java/org/drools/core/common/PhreakPropagationContextFactory.java @@ -21,10 +21,10 @@ import java.io.Serializable; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.EntryPointId; import org.drools.core.marshalling.MarshallerReaderContext; import org.drools.core.reteoo.RuntimeComponentFactory; import org.drools.core.reteoo.TerminalNode; -import org.drools.base.rule.EntryPointId; import org.drools.util.bitmask.BitMask; public class PhreakPropagationContextFactory implements PropagationContextFactory, Serializable { diff --git a/drools-core/src/main/java/org/drools/core/common/PropagationContext.java b/drools-core/src/main/java/org/drools/core/common/PropagationContext.java index fa5a672b472..e70c2d050c5 100644 --- a/drools-core/src/main/java/org/drools/core/common/PropagationContext.java +++ b/drools-core/src/main/java/org/drools/core/common/PropagationContext.java @@ -18,6 +18,8 @@ */ package org.drools.core.common; +import java.io.Externalizable; + import org.drools.base.base.ObjectType; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.rule.EntryPointId; @@ -26,8 +28,6 @@ import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; -import java.io.Externalizable; - public interface PropagationContext extends Externalizable { enum Type { diff --git a/drools-core/src/main/java/org/drools/core/common/PropagationContextFactory.java b/drools-core/src/main/java/org/drools/core/common/PropagationContextFactory.java index 3338b93e206..39755a065bf 100644 --- a/drools-core/src/main/java/org/drools/core/common/PropagationContextFactory.java +++ b/drools-core/src/main/java/org/drools/core/common/PropagationContextFactory.java @@ -19,9 +19,9 @@ package org.drools.core.common; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.EntryPointId; import org.drools.core.marshalling.MarshallerReaderContext; import org.drools.core.reteoo.TerminalNode; -import org.drools.base.rule.EntryPointId; import org.drools.util.bitmask.BitMask; public interface PropagationContextFactory { diff --git a/drools-core/src/main/java/org/drools/core/common/QueryElementFactHandle.java b/drools-core/src/main/java/org/drools/core/common/QueryElementFactHandle.java index 7bbb6e16bc7..97be135e6f2 100644 --- a/drools-core/src/main/java/org/drools/core/common/QueryElementFactHandle.java +++ b/drools-core/src/main/java/org/drools/core/common/QueryElementFactHandle.java @@ -18,6 +18,14 @@ */ package org.drools.core.common; +import java.util.Arrays; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; + import org.drools.base.factmodel.traits.TraitTypeEnum; import org.drools.base.rule.EntryPointId; import org.drools.core.WorkingMemoryEntryPoint; @@ -25,13 +33,6 @@ import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.Tuple; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import java.util.Arrays; -import java.util.function.Consumer; -import java.util.function.Predicate; - @XmlAccessorType(XmlAccessType.NONE) public class QueryElementFactHandle implements diff --git a/drools-core/src/main/java/org/drools/core/common/ReteEvaluator.java b/drools-core/src/main/java/org/drools/core/common/ReteEvaluator.java index d7e9f5aec90..49503f63036 100644 --- a/drools-core/src/main/java/org/drools/core/common/ReteEvaluator.java +++ b/drools-core/src/main/java/org/drools/core/common/ReteEvaluator.java @@ -18,6 +18,10 @@ */ package org.drools.core.common; +import java.util.Collection; +import java.util.Collections; +import java.util.function.Consumer; + import org.drools.base.base.ValueResolver; import org.drools.base.rule.EntryPointId; import org.drools.core.RuleSessionConfiguration; @@ -41,10 +45,6 @@ import org.kie.api.runtime.rule.QueryResults; import org.kie.api.time.SessionClock; -import java.util.Collection; -import java.util.Collections; -import java.util.function.Consumer; - public interface ReteEvaluator extends ValueResolver { enum InternalOperationType{ FIRE, INSERT, UPDATE, DELETE, SET_GLOBAL } diff --git a/drools-core/src/main/java/org/drools/core/common/SingleBetaConstraints.java b/drools-core/src/main/java/org/drools/core/common/SingleBetaConstraints.java index 46346e156f8..d4a00df2046 100644 --- a/drools-core/src/main/java/org/drools/core/common/SingleBetaConstraints.java +++ b/drools-core/src/main/java/org/drools/core/common/SingleBetaConstraints.java @@ -34,8 +34,8 @@ import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.Tuple; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.util.bitmask.BitMask; import org.drools.core.util.index.IndexFactory; +import org.drools.util.bitmask.BitMask; import org.kie.api.runtime.rule.FactHandle; public class SingleBetaConstraints diff --git a/drools-core/src/main/java/org/drools/core/common/TupleStartEqualsConstraint.java b/drools-core/src/main/java/org/drools/core/common/TupleStartEqualsConstraint.java index 7ed4fdf16eb..4d2ee359722 100755 --- a/drools-core/src/main/java/org/drools/core/common/TupleStartEqualsConstraint.java +++ b/drools-core/src/main/java/org/drools/core/common/TupleStartEqualsConstraint.java @@ -24,10 +24,10 @@ import org.drools.base.base.ValueResolver; import org.drools.base.reteoo.BaseTuple; -import org.drools.core.reteoo.LeftTuple; import org.drools.base.rule.ContextEntry; import org.drools.base.rule.Declaration; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; +import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.Tuple; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/concurrent/ExecutorProviderImpl.java b/drools-core/src/main/java/org/drools/core/concurrent/ExecutorProviderImpl.java index 03767e866d3..72f13fe846f 100644 --- a/drools-core/src/main/java/org/drools/core/concurrent/ExecutorProviderImpl.java +++ b/drools-core/src/main/java/org/drools/core/concurrent/ExecutorProviderImpl.java @@ -27,6 +27,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; + import javax.naming.InitialContext; import javax.naming.NamingException; diff --git a/drools-core/src/main/java/org/drools/core/concurrent/ParallelGroupEvaluator.java b/drools-core/src/main/java/org/drools/core/concurrent/ParallelGroupEvaluator.java index 78e20bb8121..3621e4978aa 100644 --- a/drools-core/src/main/java/org/drools/core/concurrent/ParallelGroupEvaluator.java +++ b/drools-core/src/main/java/org/drools/core/concurrent/ParallelGroupEvaluator.java @@ -18,16 +18,16 @@ */ package org.drools.core.concurrent; -import org.drools.base.common.RuleBasePartitionId; -import org.drools.core.common.ActivationsManager; -import org.drools.core.common.InternalAgendaGroup; -import org.drools.core.phreak.RuleAgendaItem; - import java.util.Collection; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.ActivationsManager; +import org.drools.core.common.InternalAgendaGroup; +import org.drools.core.phreak.RuleAgendaItem; + import static org.drools.base.common.PartitionsManager.MIN_PARALLEL_THRESHOLD; import static org.drools.base.common.PartitionsManager.doOnForkJoinPool; diff --git a/drools-core/src/main/java/org/drools/core/conflict/RuleAgendaConflictResolver.java b/drools-core/src/main/java/org/drools/core/conflict/RuleAgendaConflictResolver.java index 46120530241..a13d6d1f440 100644 --- a/drools-core/src/main/java/org/drools/core/conflict/RuleAgendaConflictResolver.java +++ b/drools-core/src/main/java/org/drools/core/conflict/RuleAgendaConflictResolver.java @@ -20,8 +20,8 @@ import java.io.Serializable; -import org.drools.core.phreak.RuleAgendaItem; import org.drools.base.rule.consequence.ConflictResolver; +import org.drools.core.phreak.RuleAgendaItem; import org.kie.api.definition.rule.Rule; public class RuleAgendaConflictResolver implements ConflictResolver, Serializable { diff --git a/drools-core/src/main/java/org/drools/core/event/AgendaEventSupport.java b/drools-core/src/main/java/org/drools/core/event/AgendaEventSupport.java index cfdaef56dc4..9b234a9b4ce 100644 --- a/drools-core/src/main/java/org/drools/core/event/AgendaEventSupport.java +++ b/drools-core/src/main/java/org/drools/core/event/AgendaEventSupport.java @@ -22,6 +22,7 @@ import org.drools.core.common.InternalKnowledgeRuntime; import org.drools.core.common.InternalWorkingMemory; import org.drools.core.common.ReteEvaluator; +import org.drools.core.common.RuleFlowGroup; import org.drools.core.event.rule.impl.ActivationCancelledEventImpl; import org.drools.core.event.rule.impl.ActivationCreatedEventImpl; import org.drools.core.event.rule.impl.AfterActivationFiredEventImpl; @@ -31,7 +32,6 @@ import org.drools.core.event.rule.impl.RuleFlowGroupActivatedEventImpl; import org.drools.core.event.rule.impl.RuleFlowGroupDeactivatedEventImpl; import org.drools.core.rule.consequence.InternalMatch; -import org.drools.core.common.RuleFlowGroup; import org.kie.api.event.rule.AfterMatchFiredEvent; import org.kie.api.event.rule.AgendaEventListener; import org.kie.api.event.rule.BeforeMatchFiredEvent; diff --git a/drools-core/src/main/java/org/drools/core/event/DefaultAgendaEventListener.java b/drools-core/src/main/java/org/drools/core/event/DefaultAgendaEventListener.java index a2576762b70..557b232a3f5 100644 --- a/drools-core/src/main/java/org/drools/core/event/DefaultAgendaEventListener.java +++ b/drools-core/src/main/java/org/drools/core/event/DefaultAgendaEventListener.java @@ -18,9 +18,13 @@ */ package org.drools.core.event; -import org.kie.api.event.rule.*; +import org.kie.api.event.rule.AfterMatchFiredEvent; +import org.kie.api.event.rule.AgendaEventListener; import org.kie.api.event.rule.AgendaGroupPoppedEvent; import org.kie.api.event.rule.AgendaGroupPushedEvent; +import org.kie.api.event.rule.BeforeMatchFiredEvent; +import org.kie.api.event.rule.MatchCancelledEvent; +import org.kie.api.event.rule.MatchCreatedEvent; import org.kie.api.event.rule.RuleFlowGroupActivatedEvent; import org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent; diff --git a/drools-core/src/main/java/org/drools/core/event/RuleRuntimeEventSupport.java b/drools-core/src/main/java/org/drools/core/event/RuleRuntimeEventSupport.java index 853521411fe..39ba201a624 100644 --- a/drools-core/src/main/java/org/drools/core/event/RuleRuntimeEventSupport.java +++ b/drools-core/src/main/java/org/drools/core/event/RuleRuntimeEventSupport.java @@ -19,11 +19,11 @@ package org.drools.core.event; import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.event.rule.impl.ObjectDeletedEventImpl; import org.drools.core.event.rule.impl.ObjectInsertedEventImpl; import org.drools.core.event.rule.impl.ObjectUpdatedEventImpl; -import org.drools.core.common.PropagationContext; import org.kie.api.event.rule.RuleRuntimeEventListener; import org.kie.api.runtime.KieRuntime; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/event/rule/impl/SerializableActivation.java b/drools-core/src/main/java/org/drools/core/event/rule/impl/SerializableActivation.java index 001c4556134..550624af08c 100644 --- a/drools-core/src/main/java/org/drools/core/event/rule/impl/SerializableActivation.java +++ b/drools-core/src/main/java/org/drools/core/event/rule/impl/SerializableActivation.java @@ -26,12 +26,12 @@ import java.util.Collections; import java.util.List; -import org.drools.core.common.InternalFactHandle; import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.core.reteoo.RuleTerminalNodeLeftTuple; import org.drools.base.rule.Declaration; -import org.drools.core.rule.consequence.InternalMatch; +import org.drools.core.common.InternalFactHandle; import org.drools.core.common.PropagationContext; +import org.drools.core.reteoo.RuleTerminalNodeLeftTuple; +import org.drools.core.rule.consequence.InternalMatch; import org.kie.api.definition.rule.Rule; import org.kie.api.runtime.rule.FactHandle; import org.kie.api.runtime.rule.Match; diff --git a/drools-core/src/main/java/org/drools/core/impl/ActivationsManagerImpl.java b/drools-core/src/main/java/org/drools/core/impl/ActivationsManagerImpl.java index 328e0e5c4df..ab3d1a3b1bf 100644 --- a/drools-core/src/main/java/org/drools/core/impl/ActivationsManagerImpl.java +++ b/drools-core/src/main/java/org/drools/core/impl/ActivationsManagerImpl.java @@ -18,6 +18,13 @@ */ package org.drools.core.impl; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.drools.base.definitions.rule.impl.QueryImpl; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.common.ActivationGroupImpl; @@ -52,13 +59,6 @@ import org.kie.api.event.rule.MatchCancelledCause; import org.kie.api.runtime.rule.AgendaFilter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - public class ActivationsManagerImpl implements ActivationsManager { private final ReteEvaluator reteEvaluator; diff --git a/drools-core/src/main/java/org/drools/core/impl/InternalKieContainer.java b/drools-core/src/main/java/org/drools/core/impl/InternalKieContainer.java index e99b6f8c169..f2c59ed4745 100644 --- a/drools-core/src/main/java/org/drools/core/impl/InternalKieContainer.java +++ b/drools-core/src/main/java/org/drools/core/impl/InternalKieContainer.java @@ -72,19 +72,19 @@ public interface InternalKieContainer extends KieContainer { * Returns the ID assigned to the container. * @return the ID assigned to the container. */ - String getContainerId(); - - /** - * Returns the RelaseId configured while creating the Kiecontainer. - * @return the RelaseId configured while creating the Kiecontainer. - */ - ReleaseId getConfiguredReleaseId(); - - /** - * Returns the actual resolved ReleaseId. - * @return the actual resolved ReleaseId. - */ - ReleaseId getResolvedReleaseId(); + String getContainerId(); + + /** + * Returns the RelaseId configured while creating the Kiecontainer. + * @return the RelaseId configured while creating the Kiecontainer. + */ + ReleaseId getConfiguredReleaseId(); + + /** + * Returns the actual resolved ReleaseId. + * @return the actual resolved ReleaseId. + */ + ReleaseId getResolvedReleaseId(); void disposeSession(KieSession kieSession); diff --git a/drools-core/src/main/java/org/drools/core/impl/InternalRuleBase.java b/drools-core/src/main/java/org/drools/core/impl/InternalRuleBase.java index 92d2dca90ce..f4002ac8a1a 100644 --- a/drools-core/src/main/java/org/drools/core/impl/InternalRuleBase.java +++ b/drools-core/src/main/java/org/drools/core/impl/InternalRuleBase.java @@ -18,6 +18,14 @@ */ package org.drools.core.impl; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.Future; + import org.drools.base.RuleBase; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.InternalKnowledgePackage; @@ -49,14 +57,6 @@ import org.kie.api.io.Resource; import org.kie.api.runtime.KieSessionConfiguration; -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.Future; - public interface InternalRuleBase extends RuleBase { Collection getKiePackages(); diff --git a/drools-core/src/main/java/org/drools/core/impl/KnowledgeBaseImpl.java b/drools-core/src/main/java/org/drools/core/impl/KnowledgeBaseImpl.java index dfd978c3f7c..e14d287f218 100644 --- a/drools-core/src/main/java/org/drools/core/impl/KnowledgeBaseImpl.java +++ b/drools-core/src/main/java/org/drools/core/impl/KnowledgeBaseImpl.java @@ -18,6 +18,24 @@ */ package org.drools.core.impl; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.Future; +import java.util.concurrent.locks.ReentrantReadWriteLock; + import org.drools.base.base.ClassObjectType; import org.drools.base.common.PartitionsManager; import org.drools.base.common.RuleBasePartitionId; @@ -79,27 +97,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.Future; -import java.util.concurrent.locks.ReentrantReadWriteLock; - import static org.drools.core.phreak.PhreakBuilder.isEagerSegmentCreation; -import static org.drools.util.bitmask.BitMaskUtil.isSet; import static org.drools.util.ClassUtils.convertClassToResourcePath; +import static org.drools.util.bitmask.BitMaskUtil.isSet; public class KnowledgeBaseImpl implements InternalRuleBase { @@ -880,7 +880,9 @@ public Set getAddedEntryNodeCache() { } public void registeRremovedEntryNodeCache(EntryPointNode node) { - if (removedEntryNodeCache == null) removedEntryNodeCache = new HashSet<>(); + if (removedEntryNodeCache == null) { + removedEntryNodeCache = new HashSet<>(); + } removedEntryNodeCache.add(node); } diff --git a/drools-core/src/main/java/org/drools/core/impl/WorkingMemoryReteExpireAction.java b/drools-core/src/main/java/org/drools/core/impl/WorkingMemoryReteExpireAction.java index 29949977ac1..3599a81382b 100644 --- a/drools-core/src/main/java/org/drools/core/impl/WorkingMemoryReteExpireAction.java +++ b/drools-core/src/main/java/org/drools/core/impl/WorkingMemoryReteExpireAction.java @@ -18,6 +18,11 @@ */ package org.drools.core.impl; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + import org.drools.core.common.DefaultEventHandle; import org.drools.core.common.DefaultFactHandle; import org.drools.core.common.PropagationContext; @@ -27,11 +32,6 @@ import org.drools.core.phreak.PropagationEntry; import org.drools.core.reteoo.ObjectTypeNode; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - import static org.drools.core.common.PhreakPropagationContextFactory.createPropagationContextForFact; public class WorkingMemoryReteExpireAction diff --git a/drools-core/src/main/java/org/drools/core/management/DroolsManagementAgent.java b/drools-core/src/main/java/org/drools/core/management/DroolsManagementAgent.java index 86314c34ae0..5bacd15b864 100644 --- a/drools-core/src/main/java/org/drools/core/management/DroolsManagementAgent.java +++ b/drools-core/src/main/java/org/drools/core/management/DroolsManagementAgent.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.StandardMBean; @@ -46,8 +47,8 @@ */ public interface DroolsManagementAgent extends KieManagementAgentMBean { - String CONTAINER_NAME_PREFIX = "org.kie"; - + String CONTAINER_NAME_PREFIX = "org.kie"; + Logger logger = LoggerFactory.getLogger(DroolsManagementAgent.class); class DroolsManagementAgentHolder { @@ -58,23 +59,23 @@ static DroolsManagementAgent getInstance() { return DroolsManagementAgentHolder.INSTANCE; } - static ObjectName createObjectNameFor(InternalRuleBase kbase) { - return DroolsManagementAgent.createObjectName( - DroolsManagementAgent.createObjectNameBy(kbase.getContainerId()) - + ",kbaseId=" + ObjectName.quote(kbase.getId()) - ); - } - - static ObjectName createObjectNameFor(InternalWorkingMemory ksession) { - return DroolsManagementAgent.createObjectName( - DroolsManagementAgent.createObjectNameFor(ksession.getKnowledgeBase()) + - ",group=Sessions,ksessionId=Session-"+ksession.getIdentifier()); - } - - static ObjectName createObjectNameBy(String containerId) { - return DroolsManagementAgent.createObjectName(CONTAINER_NAME_PREFIX + ":kcontainerId="+ObjectName.quote(containerId)); - } - + static ObjectName createObjectNameFor(InternalRuleBase kbase) { + return DroolsManagementAgent.createObjectName( + DroolsManagementAgent.createObjectNameBy(kbase.getContainerId()) + + ",kbaseId=" + ObjectName.quote(kbase.getId()) + ); + } + + static ObjectName createObjectNameFor(InternalWorkingMemory ksession) { + return DroolsManagementAgent.createObjectName( + DroolsManagementAgent.createObjectNameFor(ksession.getKnowledgeBase()) + + ",group=Sessions,ksessionId=Session-"+ksession.getIdentifier()); + } + + static ObjectName createObjectNameBy(String containerId) { + return DroolsManagementAgent.createObjectName(CONTAINER_NAME_PREFIX + ":kcontainerId="+ObjectName.quote(containerId)); + } + static ObjectName createObjectNameBy(String containerId, String kbaseId, KieSessionModel.KieSessionType ksessionType, String ksessionName) { return DroolsManagementAgent.createObjectName(CONTAINER_NAME_PREFIX + ":kcontainerId="+ObjectName.quote(containerId) + ",kbaseId=" + ObjectName.quote(kbaseId) @@ -163,28 +164,37 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (!(obj instanceof CBSKey)) + } + if (!(obj instanceof CBSKey)) { return false; + } CBSKey other = (CBSKey) obj; if (kbaseId == null) { - if (other.kbaseId != null) + if (other.kbaseId != null) { return false; - } else if (!kbaseId.equals(other.kbaseId)) + } + } else if (!kbaseId.equals(other.kbaseId)) { return false; + } if (kcontainerId == null) { - if (other.kcontainerId != null) + if (other.kcontainerId != null) { return false; - } else if (!kcontainerId.equals(other.kcontainerId)) + } + } else if (!kcontainerId.equals(other.kcontainerId)) { return false; + } if (ksessionName == null) { - if (other.ksessionName != null) + if (other.ksessionName != null) { return false; - } else if (!ksessionName.equals(other.ksessionName)) + } + } else if (!ksessionName.equals(other.ksessionName)) { return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/management/KnowledgeBaseMonitoring.java b/drools-core/src/main/java/org/drools/core/management/KnowledgeBaseMonitoring.java index 1cf3657fb88..609a89e6706 100644 --- a/drools-core/src/main/java/org/drools/core/management/KnowledgeBaseMonitoring.java +++ b/drools-core/src/main/java/org/drools/core/management/KnowledgeBaseMonitoring.java @@ -20,6 +20,7 @@ import java.lang.reflect.Type; import java.util.Map; + import javax.management.Attribute; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; @@ -283,7 +284,9 @@ public Object getAttribute(String attributeName) throws AttributeNotFoundExcepti public AttributeList getAttributes(String[] attributeNames) { AttributeList resultList = new AttributeList(); - if ( attributeNames.length == 0 ) return resultList; + if ( attributeNames.length == 0 ) { + return resultList; + } for ( int i = 0; i < attributeNames.length; i++ ) { try { Object value = getAttribute( attributeNames[i] ); diff --git a/drools-core/src/main/java/org/drools/core/marshalling/MarshallerReaderContext.java b/drools-core/src/main/java/org/drools/core/marshalling/MarshallerReaderContext.java index edec31bbe66..cdd16f975d4 100644 --- a/drools-core/src/main/java/org/drools/core/marshalling/MarshallerReaderContext.java +++ b/drools-core/src/main/java/org/drools/core/marshalling/MarshallerReaderContext.java @@ -21,18 +21,18 @@ import java.io.ObjectInput; import java.util.Map; +import org.drools.base.rule.EntryPointId; import org.drools.core.common.ActivationsFilter; import org.drools.core.common.BaseNode; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.QueryElementFactHandle; import org.drools.core.common.ReteEvaluator; import org.drools.core.impl.InternalRuleBase; import org.drools.core.phreak.PhreakTimerNode.Scheduler; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.ObjectTypeConf; -import org.drools.base.rule.EntryPointId; -import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.Tuple; import org.kie.api.marshalling.ObjectMarshallingStrategy; import org.kie.api.marshalling.ObjectMarshallingStrategyStore; diff --git a/drools-core/src/main/java/org/drools/core/marshalling/TupleKey.java b/drools-core/src/main/java/org/drools/core/marshalling/TupleKey.java index a46d6e8a030..67728a12121 100644 --- a/drools-core/src/main/java/org/drools/core/marshalling/TupleKey.java +++ b/drools-core/src/main/java/org/drools/core/marshalling/TupleKey.java @@ -42,11 +42,19 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } TupleKey other = (TupleKey) obj; - if ( !Arrays.equals( tuple, other.tuple ) ) return false; + if ( !Arrays.equals( tuple, other.tuple ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/phreak/AbstractReactiveObject.java b/drools-core/src/main/java/org/drools/core/phreak/AbstractReactiveObject.java index 04489697c9f..f803352d46e 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/AbstractReactiveObject.java +++ b/drools-core/src/main/java/org/drools/core/phreak/AbstractReactiveObject.java @@ -18,13 +18,13 @@ */ package org.drools.core.phreak; -import org.drools.base.phreak.ReactiveObject; -import org.drools.base.reteoo.BaseTuple; - import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import org.drools.base.phreak.ReactiveObject; +import org.drools.base.reteoo.BaseTuple; + public class AbstractReactiveObject implements ReactiveObject { private Collection tuples; diff --git a/drools-core/src/main/java/org/drools/core/phreak/BuildtimeSegmentUtilities.java b/drools-core/src/main/java/org/drools/core/phreak/BuildtimeSegmentUtilities.java index ab794a071bc..506d5a3802a 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/BuildtimeSegmentUtilities.java +++ b/drools-core/src/main/java/org/drools/core/phreak/BuildtimeSegmentUtilities.java @@ -22,6 +22,7 @@ import java.util.List; import org.drools.base.common.NetworkNode; +import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.impl.InternalRuleBase; import org.drools.core.reteoo.AsyncReceiveNode; import org.drools.core.reteoo.AsyncSendNode; @@ -35,7 +36,6 @@ import org.drools.core.reteoo.LeftTupleSinkNode; import org.drools.core.reteoo.LeftTupleSinkPropagator; import org.drools.core.reteoo.LeftTupleSource; -import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.reteoo.NotNode; import org.drools.core.reteoo.PathEndNode; import org.drools.core.reteoo.PathEndNode.PathMemSpec; diff --git a/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java b/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java index c77f8674551..f3cccaa202e 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java +++ b/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java @@ -18,6 +18,16 @@ */ package org.drools.core.phreak; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + import org.drools.base.common.NetworkNode; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.WorkingMemory; @@ -63,16 +73,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - import static org.drools.core.phreak.BuildtimeSegmentUtilities.isAssociatedWith; public class EagerPhreakBuilder implements PhreakBuilder { diff --git a/drools-core/src/main/java/org/drools/core/phreak/LazyPhreakBuilder.java b/drools-core/src/main/java/org/drools/core/phreak/LazyPhreakBuilder.java index 418dbf4d7fb..7ddbb01eeeb 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/LazyPhreakBuilder.java +++ b/drools-core/src/main/java/org/drools/core/phreak/LazyPhreakBuilder.java @@ -18,6 +18,16 @@ */ package org.drools.core.phreak; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.DefaultEventHandle; @@ -73,16 +83,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - import static org.drools.core.phreak.BuildtimeSegmentUtilities.JOIN_NODE_BIT; import static org.drools.core.phreak.BuildtimeSegmentUtilities.NOT_NODE_BIT; import static org.drools.core.phreak.BuildtimeSegmentUtilities.REACTIVE_EXISTS_NODE_BIT; diff --git a/drools-core/src/main/java/org/drools/core/phreak/LeftTupleEntry.java b/drools-core/src/main/java/org/drools/core/phreak/LeftTupleEntry.java index eecff317b6f..a05a1dabcf0 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/LeftTupleEntry.java +++ b/drools-core/src/main/java/org/drools/core/phreak/LeftTupleEntry.java @@ -20,9 +20,9 @@ import org.drools.core.common.Memory; import org.drools.core.common.PhreakPropagationContext; +import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.RightTuple; -import org.drools.core.common.PropagationContext; public class LeftTupleEntry implements TupleEntry { private final LeftTuple lt; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakAccumulateNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakAccumulateNode.java index e350f760052..c63a815acc3 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakAccumulateNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakAccumulateNode.java @@ -18,14 +18,18 @@ */ package org.drools.core.phreak; +import org.drools.base.reteoo.AccumulateContextEntry; +import org.drools.base.rule.Accumulate; +import org.drools.base.rule.ContextEntry; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.common.TupleSetsImpl; import org.drools.core.reteoo.AccumulateNode; import org.drools.core.reteoo.AccumulateNode.AccumulateContext; -import org.drools.base.reteoo.AccumulateContextEntry; import org.drools.core.reteoo.AccumulateNode.AccumulateMemory; import org.drools.core.reteoo.AccumulateNode.BaseAccumulation; import org.drools.core.reteoo.BetaMemory; @@ -33,12 +37,8 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.RightTupleImpl; -import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.Accumulate; -import org.drools.base.rule.ContextEntry; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.Tuple; +import org.drools.core.reteoo.TupleMemory; import org.drools.core.util.AbstractHashTable; import org.drools.core.util.FastIterator; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncReceiveNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncReceiveNode.java index 1ad8fed76da..601279f0503 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncReceiveNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncReceiveNode.java @@ -18,6 +18,7 @@ */ package org.drools.core.phreak; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; @@ -26,7 +27,6 @@ import org.drools.core.reteoo.AsyncReceiveNode.AsyncReceiveMemory; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSink; -import org.drools.base.rule.ContextEntry; import org.drools.core.util.index.TupleList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncSendNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncSendNode.java index 5c79b3b5383..21637bc42ad 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncSendNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakAsyncSendNode.java @@ -21,8 +21,12 @@ import java.util.LinkedHashMap; import java.util.concurrent.Executor; +import org.drools.base.rule.ContextEntry; +import org.drools.base.rule.accessor.DataProvider; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.AsyncMessage; @@ -31,10 +35,6 @@ import org.drools.core.reteoo.AsyncSendNode.AsyncSendMemory; import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.LeftTuple; -import org.drools.base.rule.ContextEntry; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.rule.accessor.DataProvider; -import org.drools.core.common.PropagationContext; import org.kie.internal.concurrent.ExecutorProviderFactory; public class PhreakAsyncSendNode { diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakEvalNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakEvalNode.java index f062cbf8072..05171795a33 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakEvalNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakEvalNode.java @@ -18,13 +18,13 @@ */ package org.drools.core.phreak; +import org.drools.base.rule.EvalCondition; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.EvalConditionNode; import org.drools.core.reteoo.EvalConditionNode.EvalMemory; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSink; -import org.drools.base.rule.EvalCondition; import static org.drools.core.phreak.RuleNetworkEvaluator.normalizeStagedTuples; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakExistsNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakExistsNode.java index dbd0714b2d2..95d796c565a 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakExistsNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakExistsNode.java @@ -18,7 +18,9 @@ */ package org.drools.core.phreak; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.BetaMemory; @@ -27,8 +29,6 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; -import org.drools.core.common.PropagationContext; import org.drools.core.util.FastIterator; import static org.drools.core.phreak.PhreakJoinNode.updateChildLeftTuple; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakFromNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakFromNode.java index 5445933b343..6a4f5198c86 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakFromNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakFromNode.java @@ -22,7 +22,11 @@ import java.util.LinkedHashMap; import java.util.Map; +import org.drools.base.rule.ContextEntry; +import org.drools.base.rule.accessor.DataProvider; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.common.BetaConstraints; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.AbstractTuple; @@ -33,12 +37,8 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.RightTupleImpl; -import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.rule.accessor.DataProvider; -import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.Tuple; +import org.drools.core.reteoo.TupleMemory; import org.drools.core.util.FastIterator; import org.drools.core.util.LinkedList; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakGroupByNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakGroupByNode.java index 026a8db31e3..84cf7c9a404 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakGroupByNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakGroupByNode.java @@ -18,17 +18,17 @@ */ package org.drools.core.phreak; +import org.drools.base.reteoo.AccumulateContextEntry; +import org.drools.base.rule.Accumulate; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.AccumulateNode; -import org.drools.base.reteoo.AccumulateContextEntry; import org.drools.core.reteoo.AccumulateNode.AccumulateMemory; import org.drools.core.reteoo.AccumulateNode.GroupByContext; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.RightTuple; -import org.drools.base.rule.Accumulate; -import org.drools.core.common.PropagationContext; import org.drools.core.util.index.TupleList; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakJoinNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakJoinNode.java index b1cecc77005..313e0505f5a 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakJoinNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakJoinNode.java @@ -18,6 +18,7 @@ */ package org.drools.core.phreak; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; @@ -27,7 +28,6 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; import org.drools.core.util.AbstractHashTable; import org.drools.core.util.FastIterator; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakNotNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakNotNode.java index 84d5e64dbbe..0e8766dde8d 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakNotNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakNotNode.java @@ -18,7 +18,9 @@ */ package org.drools.core.phreak; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.BetaMemory; @@ -27,8 +29,6 @@ import org.drools.core.reteoo.NotNode; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; -import org.drools.core.common.PropagationContext; import org.drools.core.util.FastIterator; import static org.drools.core.phreak.PhreakJoinNode.updateChildLeftTuple; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakQueryNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakQueryNode.java index 38e3173f63c..97ce0e9021b 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakQueryNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakQueryNode.java @@ -20,6 +20,7 @@ import org.drools.core.base.DroolsQueryImpl; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.LeftInputAdapterNode; @@ -28,7 +29,6 @@ import org.drools.core.reteoo.QueryElementNode; import org.drools.core.reteoo.QueryElementNode.QueryElementNodeMemory; import org.drools.core.reteoo.SegmentMemory; -import org.drools.core.common.PropagationContext; public class PhreakQueryNode { public void doNode(QueryElementNode queryNode, diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakRuleTerminalNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakRuleTerminalNode.java index 1e88d99f8ce..9171ae207cf 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakRuleTerminalNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakRuleTerminalNode.java @@ -18,19 +18,19 @@ */ package org.drools.core.phreak; +import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.accessor.Salience; import org.drools.core.common.ActivationsManager; import org.drools.core.common.InternalAgendaGroup; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.ObjectTypeConf; import org.drools.core.reteoo.RuleTerminalNode; import org.drools.core.reteoo.RuleTerminalNodeLeftTuple; import org.drools.core.reteoo.TerminalNode; -import org.drools.core.common.PropagationContext; -import org.drools.base.rule.accessor.Salience; import org.drools.core.reteoo.Tuple; import org.drools.core.rule.consequence.InternalMatch; import org.kie.api.definition.rule.Rule; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakSubnetworkNotExistsNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakSubnetworkNotExistsNode.java index c7aa1a61596..6b5208c7e44 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakSubnetworkNotExistsNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakSubnetworkNotExistsNode.java @@ -18,16 +18,16 @@ */ package org.drools.core.phreak; +import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.BetaNode; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSink; -import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.reteoo.RightTuple; import org.drools.core.reteoo.SubnetworkTuple; -import org.drools.core.reteoo.TupleMemory; import org.drools.core.reteoo.Tuple; +import org.drools.core.reteoo.TupleMemory; import org.drools.core.util.index.TupleList; import static org.drools.core.phreak.PhreakJoinNode.updateChildLeftTuple; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java index bdaf7ef9211..65dbd9e8ee3 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java @@ -18,6 +18,9 @@ */ package org.drools.core.phreak; +import java.util.Date; +import java.util.List; + import org.drools.base.common.NetworkNode; import org.drools.base.time.JobHandle; import org.drools.base.time.Trigger; @@ -49,9 +52,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Date; -import java.util.List; - import static org.drools.core.phreak.BuildtimeSegmentUtilities.nextNodePosMask; import static org.drools.core.phreak.RuleNetworkEvaluator.normalizeStagedTuples; diff --git a/drools-core/src/main/java/org/drools/core/phreak/PropagationEntry.java b/drools-core/src/main/java/org/drools/core/phreak/PropagationEntry.java index cbd689f1f7f..c257703e69f 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PropagationEntry.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PropagationEntry.java @@ -18,6 +18,12 @@ */ package org.drools.core.phreak; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.concurrent.CountDownLatch; + import org.drools.base.facttemplates.Event; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.base.DroolsQueryImpl; @@ -41,12 +47,6 @@ import org.drools.core.time.impl.DefaultJobHandle; import org.drools.core.time.impl.PointInTimeTrigger; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.concurrent.CountDownLatch; - import static org.drools.base.rule.TypeDeclaration.NEVER_EXPIRES; import static org.drools.core.reteoo.EntryPointNode.removeRightTuplesMatchingOTN; diff --git a/drools-core/src/main/java/org/drools/core/phreak/ReactiveCollection.java b/drools-core/src/main/java/org/drools/core/phreak/ReactiveCollection.java index 8de145e2055..c0d8df33e40 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/ReactiveCollection.java +++ b/drools-core/src/main/java/org/drools/core/phreak/ReactiveCollection.java @@ -22,8 +22,8 @@ import java.util.Iterator; import org.drools.base.phreak.ReactiveObject; -import org.drools.core.phreak.ReactiveObjectUtil.ModificationType; import org.drools.base.reteoo.BaseTuple; +import org.drools.core.phreak.ReactiveObjectUtil.ModificationType; public class ReactiveCollection> extends AbstractReactiveObject implements Collection { diff --git a/drools-core/src/main/java/org/drools/core/phreak/ReactiveList.java b/drools-core/src/main/java/org/drools/core/phreak/ReactiveList.java index 5e85fa8ad92..34850e7cf2c 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/ReactiveList.java +++ b/drools-core/src/main/java/org/drools/core/phreak/ReactiveList.java @@ -24,8 +24,8 @@ import java.util.ListIterator; import org.drools.base.phreak.ReactiveObject; -import org.drools.core.phreak.ReactiveObjectUtil.ModificationType; import org.drools.base.reteoo.BaseTuple; +import org.drools.core.phreak.ReactiveObjectUtil.ModificationType; public class ReactiveList extends ReactiveCollection> implements List{ diff --git a/drools-core/src/main/java/org/drools/core/phreak/ReactiveObjectUtil.java b/drools-core/src/main/java/org/drools/core/phreak/ReactiveObjectUtil.java index 1501cceedec..fbddf9819e8 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/ReactiveObjectUtil.java +++ b/drools-core/src/main/java/org/drools/core/phreak/ReactiveObjectUtil.java @@ -21,17 +21,17 @@ import java.util.Collection; import org.drools.base.phreak.ReactiveObject; +import org.drools.base.reteoo.BaseTuple; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import org.drools.base.reteoo.BaseTuple; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSinkNode; import org.drools.core.reteoo.ReactiveFromNode; import org.drools.core.reteoo.ReactiveFromNodeLeftTuple; import org.drools.core.reteoo.RightTupleImpl; -import org.drools.base.rule.ContextEntry; -import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.Tuple; import static org.drools.core.phreak.PhreakFromNode.deleteChildLeftTuple; diff --git a/drools-core/src/main/java/org/drools/core/phreak/RightTupleEntry.java b/drools-core/src/main/java/org/drools/core/phreak/RightTupleEntry.java index 3bf3f7e291b..a94d2deaa0b 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/RightTupleEntry.java +++ b/drools-core/src/main/java/org/drools/core/phreak/RightTupleEntry.java @@ -20,9 +20,9 @@ import org.drools.core.common.Memory; import org.drools.core.common.PhreakPropagationContext; +import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.RightTuple; -import org.drools.core.common.PropagationContext; public class RightTupleEntry implements TupleEntry { diff --git a/drools-core/src/main/java/org/drools/core/phreak/RuleAgendaItem.java b/drools-core/src/main/java/org/drools/core/phreak/RuleAgendaItem.java index ad943b9dded..bbe098ee3d0 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/RuleAgendaItem.java +++ b/drools-core/src/main/java/org/drools/core/phreak/RuleAgendaItem.java @@ -18,9 +18,9 @@ */ package org.drools.core.phreak; -import org.drools.core.common.InternalAgendaGroup; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.core.common.InternalAgendaGroup; import org.drools.core.reteoo.PathMemory; import org.drools.core.reteoo.TerminalNode; import org.drools.core.util.LinkedList; diff --git a/drools-core/src/main/java/org/drools/core/phreak/RuleNetworkEvaluator.java b/drools-core/src/main/java/org/drools/core/phreak/RuleNetworkEvaluator.java index fcd39d5d8b9..e64269ad056 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/RuleNetworkEvaluator.java +++ b/drools-core/src/main/java/org/drools/core/phreak/RuleNetworkEvaluator.java @@ -20,11 +20,13 @@ import java.util.List; +import org.drools.base.common.NetworkNode; +import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.ContextEntry; import org.drools.core.base.DroolsQueryImpl; import org.drools.core.common.ActivationsManager; import org.drools.core.common.BetaConstraints; import org.drools.core.common.Memory; -import org.drools.base.common.NetworkNode; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.common.TupleSetsImpl; @@ -51,7 +53,6 @@ import org.drools.core.reteoo.LeftTupleSink; import org.drools.core.reteoo.LeftTupleSinkNode; import org.drools.core.reteoo.LeftTupleSource; -import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.reteoo.NotNode; import org.drools.core.reteoo.ObjectSink; import org.drools.core.reteoo.PathMemory; @@ -62,7 +63,6 @@ import org.drools.core.reteoo.RightInputAdapterNode; import org.drools.core.reteoo.RightInputAdapterNode.RiaPathMemory; import org.drools.core.reteoo.RightTuple; -import org.drools.core.reteoo.RightTupleImpl; import org.drools.core.reteoo.SegmentMemory; import org.drools.core.reteoo.SubnetworkTuple; import org.drools.core.reteoo.TerminalNode; @@ -70,7 +70,6 @@ import org.drools.core.reteoo.TimerNode.TimerNodeMemory; import org.drools.core.reteoo.Tuple; import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; import org.drools.core.util.FastIterator; import org.drools.core.util.LinkedList; import org.slf4j.Logger; diff --git a/drools-core/src/main/java/org/drools/core/phreak/SegmentPropagator.java b/drools-core/src/main/java/org/drools/core/phreak/SegmentPropagator.java index 2b9ba365f14..2986421497f 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/SegmentPropagator.java +++ b/drools-core/src/main/java/org/drools/core/phreak/SegmentPropagator.java @@ -28,9 +28,9 @@ import org.drools.core.reteoo.PathMemory; import org.drools.core.reteoo.SegmentMemory; +import static org.drools.base.reteoo.NodeTypeEnums.hasNodeMemory; import static org.drools.core.phreak.TupleEvaluationUtil.forceFlushLeftTuple; import static org.drools.core.phreak.TupleEvaluationUtil.forceFlushWhenRiaNode; -import static org.drools.base.reteoo.NodeTypeEnums.hasNodeMemory; public class SegmentPropagator { diff --git a/drools-core/src/main/java/org/drools/core/phreak/StackEntry.java b/drools-core/src/main/java/org/drools/core/phreak/StackEntry.java index e6cb8265bff..18e92e915b9 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/StackEntry.java +++ b/drools-core/src/main/java/org/drools/core/phreak/StackEntry.java @@ -18,8 +18,8 @@ */ package org.drools.core.phreak; -import org.drools.core.common.Memory; import org.drools.base.common.NetworkNode; +import org.drools.core.common.Memory; import org.drools.core.common.TupleSets; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleSinkNode; diff --git a/drools-core/src/main/java/org/drools/core/phreak/SynchronizedPropagationList.java b/drools-core/src/main/java/org/drools/core/phreak/SynchronizedPropagationList.java index ac7899931e4..e46a618a1a0 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/SynchronizedPropagationList.java +++ b/drools-core/src/main/java/org/drools/core/phreak/SynchronizedPropagationList.java @@ -18,12 +18,12 @@ */ package org.drools.core.phreak; +import java.util.Iterator; + import org.drools.core.common.ReteEvaluator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Iterator; - public class SynchronizedPropagationList implements PropagationList { protected static final Logger log = LoggerFactory.getLogger( SynchronizedPropagationList.class ); @@ -48,11 +48,11 @@ public SynchronizedPropagationList(){} @Override public void addEntry(final PropagationEntry entry) { if (entry.requiresImmediateFlushing()) { - if (entry.isCalledFromRHS()) { - entry.execute(reteEvaluator); - } else { - reteEvaluator.getActivationsManager().executeTask( new ExecutableEntry() { - @Override + if (entry.isCalledFromRHS()) { + entry.execute(reteEvaluator); + } else { + reteEvaluator.getActivationsManager().executeTask( new ExecutableEntry() { + @Override public void execute() { if (entry instanceof PhreakTimerNode.TimerAction) { ( (PhreakTimerNode.TimerAction) entry ).execute( reteEvaluator, true ); @@ -66,7 +66,7 @@ public void enqueue() { internalAddEntry( entry ); } } ); - } + } } else { internalAddEntry( entry ); } diff --git a/drools-core/src/main/java/org/drools/core/phreak/TupleEntry.java b/drools-core/src/main/java/org/drools/core/phreak/TupleEntry.java index c3dee474621..85194ae0112 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/TupleEntry.java +++ b/drools-core/src/main/java/org/drools/core/phreak/TupleEntry.java @@ -19,9 +19,9 @@ package org.drools.core.phreak; import org.drools.core.common.Memory; +import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.RightTuple; -import org.drools.core.common.PropagationContext; public interface TupleEntry { diff --git a/drools-core/src/main/java/org/drools/core/phreak/TupleEvaluationUtil.java b/drools-core/src/main/java/org/drools/core/phreak/TupleEvaluationUtil.java index c6799544d18..e6d0996bcbc 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/TupleEvaluationUtil.java +++ b/drools-core/src/main/java/org/drools/core/phreak/TupleEvaluationUtil.java @@ -22,6 +22,7 @@ import java.util.Collections; import java.util.List; +import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.ActivationsManager; import org.drools.core.common.Memory; import org.drools.core.common.ReteEvaluator; @@ -30,7 +31,6 @@ import org.drools.core.reteoo.AbstractTerminalNode; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.LeftTupleNode; -import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.reteoo.PathEndNode; import org.drools.core.reteoo.PathMemory; import org.drools.core.reteoo.SegmentMemory; diff --git a/drools-core/src/main/java/org/drools/core/process/impl/DefaultWorkItemManager.java b/drools-core/src/main/java/org/drools/core/process/impl/DefaultWorkItemManager.java index 8df599745a9..79ff1ebe3f5 100644 --- a/drools-core/src/main/java/org/drools/core/process/impl/DefaultWorkItemManager.java +++ b/drools-core/src/main/java/org/drools/core/process/impl/DefaultWorkItemManager.java @@ -77,8 +77,9 @@ public void internalExecuteWorkItem(WorkItem workItem) { WorkItemHandler handler = this.workItemHandlers.get(workItem.getName()); if (handler != null) { handler.executeWorkItem(workItem, this); - } else throw new WorkItemHandlerNotFoundException( "Could not find work item handler for " + workItem.getName(), - workItem.getName() ); + } else { + throw new WorkItemHandlerNotFoundException( "Could not find work item handler for " + workItem.getName(), workItem.getName() ); + } } public void internalAddWorkItem(WorkItem workItem) { @@ -106,12 +107,12 @@ public void internalAbortWorkItem(long id) { } public WorkItemHandler getWorkItemHandler(String name) { - return this.workItemHandlers.get(name); + return this.workItemHandlers.get(name); } public void retryWorkItem(long workItemId) { - WorkItem workItem = workItems.get(workItemId); - retryWorkItem(workItem); + WorkItem workItem = workItems.get(workItemId); + retryWorkItem(workItem); } public void retryWorkItemWithParams(long workItemId,Map map) { @@ -129,8 +130,10 @@ private void retryWorkItem(WorkItem workItem) { WorkItemHandler handler = this.workItemHandlers.get(workItem.getName()); if (handler != null) { handler.executeWorkItem(workItem, this); - } else throw new WorkItemHandlerNotFoundException( "Could not find work item handler for " + workItem.getName(), - workItem.getName() ); + } else { + throw new WorkItemHandlerNotFoundException( "Could not find work item handler for " + workItem.getName(), + workItem.getName() ); + } } } diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AbstractTerminalNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AbstractTerminalNode.java index 5faba436799..9e316914a4f 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AbstractTerminalNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AbstractTerminalNode.java @@ -18,6 +18,11 @@ */ package org.drools.core.reteoo; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.rule.impl.RuleImpl; @@ -34,11 +39,6 @@ import org.drools.util.bitmask.BitMask; import org.drools.util.bitmask.EmptyBitMask; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; - import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; public abstract class AbstractTerminalNode extends BaseNode implements TerminalNode { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AbstractTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/AbstractTuple.java index fe770fb8193..bb55f3a2961 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AbstractTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AbstractTuple.java @@ -18,9 +18,9 @@ */ package org.drools.core.reteoo; +import org.drools.base.rule.Declaration; import org.drools.core.common.DefaultEventHandle; import org.drools.core.common.InternalFactHandle; -import org.drools.base.rule.Declaration; import org.drools.core.common.PropagationContext; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AccumulateNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AccumulateNode.java index 4e95d6b71a5..429390441e8 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AccumulateNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AccumulateNode.java @@ -23,17 +23,10 @@ import java.util.List; import java.util.Map; +import org.drools.base.base.ClassObjectType; +import org.drools.base.base.ObjectType; import org.drools.base.reteoo.AccumulateContextEntry; import org.drools.base.reteoo.NodeTypeEnums; -import org.drools.core.RuleBaseConfiguration; -import org.drools.base.base.ClassObjectType; -import org.drools.core.common.BetaConstraints; -import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.Memory; -import org.drools.core.common.ReteEvaluator; -import org.drools.core.impl.InternalRuleBase; -import org.drools.core.phreak.PhreakAccumulateNode; -import org.drools.core.reteoo.builder.BuildContext; import org.drools.base.rule.Accumulate; import org.drools.base.rule.ContextEntry; import org.drools.base.rule.Declaration; @@ -41,11 +34,18 @@ import org.drools.base.rule.TypeDeclaration; import org.drools.base.rule.accessor.Accumulator; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.base.ObjectType; +import org.drools.core.RuleBaseConfiguration; +import org.drools.core.common.BetaConstraints; +import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.Memory; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; +import org.drools.core.impl.InternalRuleBase; +import org.drools.core.phreak.PhreakAccumulateNode; +import org.drools.core.reteoo.builder.BuildContext; import org.drools.core.util.AbstractBaseLinkedListNode; -import org.drools.util.bitmask.BitMask; import org.drools.core.util.index.TupleList; +import org.drools.util.bitmask.BitMask; /** * AccumulateNode diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AgendaComponentFactory.java b/drools-core/src/main/java/org/drools/core/reteoo/AgendaComponentFactory.java index 30279742fa7..9dc85d2f2c1 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AgendaComponentFactory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AgendaComponentFactory.java @@ -20,8 +20,8 @@ import org.drools.core.common.InternalAgendaGroup; import org.drools.core.common.InternalFactHandle; -import org.drools.core.phreak.RuleAgendaItem; import org.drools.core.common.PropagationContext; +import org.drools.core.phreak.RuleAgendaItem; import org.kie.api.internal.utils.KieService; public interface AgendaComponentFactory extends KieService { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AlphaNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AlphaNode.java index 8555aa78176..86cc1aaf0ff 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AlphaNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AlphaNode.java @@ -18,6 +18,8 @@ */ package org.drools.core.reteoo; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.common.NetworkNode; import org.drools.base.common.RuleBasePartitionId; @@ -32,8 +34,6 @@ import org.drools.util.bitmask.BitMask; import org.kie.api.definition.rule.Rule; -import java.util.List; - /** * AlphaNodes are nodes in the Rete network used * to apply FieldConstraint<.code>s on asserted fact diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AlphaTerminalNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AlphaTerminalNode.java index c2b9ff969cf..d8ed04cf5a0 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AlphaTerminalNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AlphaTerminalNode.java @@ -18,16 +18,16 @@ */ package org.drools.core.reteoo; +import org.drools.base.common.NetworkNode; import org.drools.core.common.ActivationsManager; import org.drools.core.common.InternalFactHandle; -import org.drools.base.common.NetworkNode; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.phreak.PhreakRuleTerminalNode; import org.drools.core.phreak.RuleAgendaItem; import org.drools.core.phreak.RuleExecutor; import org.drools.core.reteoo.builder.BuildContext; import org.drools.core.rule.consequence.InternalMatch; -import org.drools.core.common.PropagationContext; public class AlphaTerminalNode extends LeftInputAdapterNode { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AsyncReceiveNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AsyncReceiveNode.java index dc691de8d95..ed9a445c8ce 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AsyncReceiveNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AsyncReceiveNode.java @@ -23,20 +23,20 @@ import java.util.function.Consumer; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.AsyncReceive; +import org.drools.base.rule.Pattern; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.BetaConstraints; import org.drools.core.common.EmptyBetaConstraints; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.phreak.PropagationEntry; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.AsyncReceive; -import org.drools.base.rule.Pattern; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.core.common.PropagationContext; import org.drools.core.util.AbstractBaseLinkedListNode; import org.drools.core.util.index.TupleList; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/AsyncSendNode.java b/drools-core/src/main/java/org/drools/core/reteoo/AsyncSendNode.java index 148eb323373..168a28d28d1 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/AsyncSendNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/AsyncSendNode.java @@ -23,19 +23,19 @@ import java.util.Objects; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.AsyncSend; +import org.drools.base.rule.accessor.DataProvider; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.BetaConstraints; import org.drools.core.common.EmptyBetaConstraints; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.AsyncSend; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.rule.accessor.DataProvider; -import org.drools.core.common.PropagationContext; import org.drools.core.util.AbstractBaseLinkedListNode; import org.drools.core.util.index.TupleList; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/BetaMemory.java b/drools-core/src/main/java/org/drools/core/reteoo/BetaMemory.java index a77dae57cfb..4b88c92ca26 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/BetaMemory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/BetaMemory.java @@ -18,12 +18,12 @@ */ package org.drools.core.reteoo; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.Memory; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.common.TupleSetsImpl; import org.drools.core.reteoo.RightInputAdapterNode.RiaPathMemory; -import org.drools.base.rule.ContextEntry; import org.drools.core.util.AbstractBaseLinkedListNode; public class BetaMemory extends AbstractBaseLinkedListNode diff --git a/drools-core/src/main/java/org/drools/core/reteoo/BetaNode.java b/drools-core/src/main/java/org/drools/core/reteoo/BetaNode.java index a7bb30f9ea8..f892ddd7724 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/BetaNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/BetaNode.java @@ -23,9 +23,14 @@ import java.util.List; import java.util.Objects; +import org.drools.base.base.ObjectType; +import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.IndexableConstraint; +import org.drools.base.rule.Pattern; +import org.drools.base.rule.constraint.BetaNodeFieldConstraint; +import org.drools.base.util.index.IndexUtil; import org.drools.core.RuleBaseConfiguration; -import org.drools.base.base.ObjectType; import org.drools.core.common.BetaConstraints; import org.drools.core.common.DoubleBetaConstraints; import org.drools.core.common.DoubleNonIndexSkipBetaConstraints; @@ -36,7 +41,6 @@ import org.drools.core.common.QuadroupleBetaConstraints; import org.drools.core.common.QuadroupleNonIndexSkipBetaConstraints; import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.SingleBetaConstraints; import org.drools.core.common.SingleNonIndexSkipBetaConstraints; import org.drools.core.common.TripleBetaConstraints; @@ -45,20 +49,16 @@ import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.AccumulateNode.AccumulateMemory; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.IndexableConstraint; -import org.drools.base.rule.Pattern; -import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.core.util.FastIterator; import org.drools.util.bitmask.AllSetBitMask; import org.drools.util.bitmask.BitMask; import org.drools.util.bitmask.EmptyBitMask; -import org.drools.base.util.index.IndexUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; import static org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderChildLeftTuple; import static org.drools.core.phreak.TupleEvaluationUtil.flushLeftTupleIfNecessary; -import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; public abstract class BetaNode extends LeftTupleSource implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ClassObjectTypeConf.java b/drools-core/src/main/java/org/drools/core/reteoo/ClassObjectTypeConf.java index 810e8a01b73..1766531b082 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ClassObjectTypeConf.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ClassObjectTypeConf.java @@ -28,20 +28,20 @@ import java.util.Comparator; import java.util.List; -import org.drools.core.WorkingMemoryEntryPoint; import org.drools.base.base.ClassObjectType; +import org.drools.base.base.ObjectType; +import org.drools.base.rule.EntryPointId; +import org.drools.base.rule.TypeDeclaration; +import org.drools.base.util.TimeIntervalParser; +import org.drools.core.WorkingMemoryEntryPoint; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; import org.drools.core.impl.InternalRuleBase; -import org.drools.base.rule.EntryPointId; -import org.drools.base.rule.TypeDeclaration; import org.drools.core.rule.accessor.FactHandleFactory; import org.drools.core.rule.consequence.InternalMatch; -import org.drools.base.util.TimeIntervalParser; import org.kie.api.definition.type.Expires; import org.kie.api.definition.type.Role; import org.kie.api.definition.type.Role.Type; -import org.drools.base.base.ObjectType; public class ClassObjectTypeConf implements @@ -171,8 +171,9 @@ public static String getPackageName(Class< ? > clazz, String pkgName = ""; if ( pkg == null ) { int index = clazz.getName().lastIndexOf( '.' ); - if ( index != -1 ) pkgName = clazz.getName().substring( 0, - index ); + if ( index != -1 ) { + pkgName = clazz.getName().substring( 0, index ); + } } else { pkgName = pkg.getName(); } @@ -245,11 +246,11 @@ public EntryPointId getEntryPoint() { } public String getClassName() { - return this.cls != null ? this.cls.getName() : ""; + return this.cls != null ? this.cls.getName() : ""; } public String getTypeName() { - return getClassName(); + return getClassName(); } @Override diff --git a/drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java index aa90d48adc4..4d337c21934 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.BaseNode; -import org.drools.base.common.RuleBasePartitionId; - import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; +import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.BaseNode; + public class CompositeLeftTupleSinkAdapter extends AbstractLeftTupleSinkAdapter { private LeftTupleSinkNodeList sinks; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/CompositeObjectSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/CompositeObjectSinkAdapter.java index 0dfe1e5226c..99eb4c941db 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/CompositeObjectSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/CompositeObjectSinkAdapter.java @@ -18,6 +18,18 @@ */ package org.drools.core.reteoo; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; + import org.drools.base.base.ValueType; import org.drools.base.common.NetworkNode; import org.drools.base.reteoo.NodeTypeEnums; @@ -32,18 +44,6 @@ import org.drools.core.common.ReteEvaluator; import org.drools.core.util.index.AlphaRangeIndex; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Objects; - import static org.drools.base.util.index.IndexUtil.isBigDecimalEqualityConstraint; public class CompositeObjectSinkAdapter implements ObjectSinkPropagator { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/CompositePartitionAwareObjectSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/CompositePartitionAwareObjectSinkAdapter.java index 3e6da453c65..df9fb055ba9 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/CompositePartitionAwareObjectSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/CompositePartitionAwareObjectSinkAdapter.java @@ -18,6 +18,14 @@ */ package org.drools.core.reteoo; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; + import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.base.rule.IndexableConstraint; @@ -30,14 +38,6 @@ import org.drools.core.phreak.PropagationEntry; import org.drools.core.reteoo.CompositeObjectSinkAdapter.FieldIndex; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; - public class CompositePartitionAwareObjectSinkAdapter implements ObjectSinkPropagator { private final ObjectSinkPropagator[] partitionedPropagators; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchEvaluator.java b/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchEvaluator.java index 3cbcca39019..c1480fd3b6e 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchEvaluator.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchEvaluator.java @@ -23,9 +23,9 @@ import java.io.ObjectInput; import java.io.ObjectOutput; -import org.drools.core.common.ReteEvaluator; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.rule.EvalCondition; +import org.drools.core.common.ReteEvaluator; public class ConditionalBranchEvaluator implements Externalizable { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchNode.java b/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchNode.java index 150a0771cfe..e9ed92a59a5 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ConditionalBranchNode.java @@ -28,10 +28,10 @@ import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.core.common.PropagationContext; import org.drools.core.util.AbstractBaseLinkedListNode; /** diff --git a/drools-core/src/main/java/org/drools/core/reteoo/EmptyLeftTupleSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/EmptyLeftTupleSinkAdapter.java index 22319622907..b179540deef 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/EmptyLeftTupleSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/EmptyLeftTupleSinkAdapter.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.BaseNode; -import org.drools.base.common.RuleBasePartitionId; - import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; +import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.BaseNode; + public class EmptyLeftTupleSinkAdapter extends AbstractLeftTupleSinkAdapter { private static final EmptyLeftTupleSinkAdapter instance = new EmptyLeftTupleSinkAdapter(); diff --git a/drools-core/src/main/java/org/drools/core/reteoo/EmptyObjectSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/EmptyObjectSinkAdapter.java index 9bb2b1b27ea..4a0b3be8128 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/EmptyObjectSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/EmptyObjectSinkAdapter.java @@ -18,15 +18,15 @@ */ package org.drools.core.reteoo; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + import org.drools.core.common.BaseNode; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - public class EmptyObjectSinkAdapter implements ObjectSinkPropagator { private static final long serialVersionUID = 510l; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/EntryPointNode.java b/drools-core/src/main/java/org/drools/core/reteoo/EntryPointNode.java index 16551ad8276..4f7cb882c0a 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/EntryPointNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/EntryPointNode.java @@ -18,6 +18,11 @@ */ package org.drools.core.reteoo; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.drools.base.base.ClassObjectType; import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; @@ -29,8 +34,8 @@ import org.drools.core.common.InternalFactHandle; import org.drools.core.common.InternalWorkingMemory; import org.drools.core.common.ObjectTypeConfigurationRegistry; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; import org.drools.core.impl.InternalRuleBase; import org.drools.core.phreak.PropagationEntry; import org.drools.core.reteoo.builder.BuildContext; @@ -38,11 +43,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - /** * A node that is an entry point into the Rete network. * diff --git a/drools-core/src/main/java/org/drools/core/reteoo/EvalConditionNode.java b/drools-core/src/main/java/org/drools/core/reteoo/EvalConditionNode.java index 3a1f0acceb6..8159232dd9a 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/EvalConditionNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/EvalConditionNode.java @@ -26,16 +26,16 @@ import java.util.Map; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.EvalCondition; +import org.drools.base.rule.RuleComponent; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.EvalCondition; -import org.drools.core.common.PropagationContext; -import org.drools.base.rule.RuleComponent; import org.drools.core.util.AbstractBaseLinkedListNode; import org.kie.api.definition.rule.Rule; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ExistsNode.java b/drools-core/src/main/java/org/drools/core/reteoo/ExistsNode.java index 65a2add3d04..94cfa6b93ee 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ExistsNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ExistsNode.java @@ -21,9 +21,9 @@ import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.core.common.PropagationContext; /** * ExistsNode extends BetaNode to perform tests for diff --git a/drools-core/src/main/java/org/drools/core/reteoo/FactTemplateTypeConf.java b/drools-core/src/main/java/org/drools/core/reteoo/FactTemplateTypeConf.java index 60566ec838d..7ac53a3b215 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/FactTemplateTypeConf.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/FactTemplateTypeConf.java @@ -23,17 +23,17 @@ import java.io.ObjectInput; import java.io.ObjectOutput; -import org.drools.core.WorkingMemoryEntryPoint; import org.drools.base.base.ObjectType; -import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; import org.drools.base.facttemplates.Event; import org.drools.base.facttemplates.Fact; import org.drools.base.facttemplates.FactTemplate; import org.drools.base.facttemplates.FactTemplateObjectType; -import org.drools.core.impl.InternalRuleBase; import org.drools.base.rule.EntryPointId; import org.drools.base.rule.TypeDeclaration; +import org.drools.core.WorkingMemoryEntryPoint; +import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.ReteEvaluator; +import org.drools.core.impl.InternalRuleBase; import org.drools.core.rule.accessor.FactHandleFactory; public class FactTemplateTypeConf @@ -145,7 +145,7 @@ public EntryPointId getEntryPoint() { @Override public String getTypeName() { - return factTemplate.getName(); + return factTemplate.getName(); } @Override diff --git a/drools-core/src/main/java/org/drools/core/reteoo/FromNode.java b/drools-core/src/main/java/org/drools/core/reteoo/FromNode.java index 95d46da03f7..f66f3805094 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/FromNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/FromNode.java @@ -25,26 +25,26 @@ import java.util.Map; import java.util.Objects; +import org.drools.base.base.ObjectType; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.From; +import org.drools.base.rule.Pattern; +import org.drools.base.rule.accessor.DataProvider; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.BetaConstraints; import org.drools.core.common.EmptyBetaConstraints; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.From; -import org.drools.base.rule.Pattern; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.rule.accessor.DataProvider; -import org.drools.base.base.ObjectType; -import org.drools.core.common.PropagationContext; import org.drools.core.util.AbstractBaseLinkedListNode; +import org.drools.core.util.index.TupleList; import org.drools.util.bitmask.AllSetBitMask; import org.drools.util.bitmask.BitMask; -import org.drools.core.util.index.TupleList; import static org.drools.base.reteoo.PropertySpecificUtil.calculateNegativeMask; import static org.drools.base.reteoo.PropertySpecificUtil.calculatePositiveMask; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/JoinNode.java b/drools-core/src/main/java/org/drools/core/reteoo/JoinNode.java index 6be61759cbb..235ca35bb42 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/JoinNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/JoinNode.java @@ -21,9 +21,9 @@ import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.core.common.PropagationContext; public class JoinNode extends BetaNode { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/LeftInputAdapterNode.java b/drools-core/src/main/java/org/drools/core/reteoo/LeftInputAdapterNode.java index 1b181d1a56a..8ce32cc1f8b 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/LeftInputAdapterNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/LeftInputAdapterNode.java @@ -23,24 +23,24 @@ import java.util.List; import java.util.Set; +import org.drools.base.base.ClassObjectType; +import org.drools.base.base.ObjectType; +import org.drools.base.common.NetworkNode; +import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.BaseTerminalNode; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.Pattern; import org.drools.core.RuleBaseConfiguration; -import org.drools.base.base.ClassObjectType; -import org.drools.base.base.ObjectType; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; -import org.drools.base.common.NetworkNode; import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.TupleSets; import org.drools.core.common.UpdateContext; import org.drools.core.phreak.RuntimeSegmentUtilities; import org.drools.core.reteoo.ObjectTypeNode.Id; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.Pattern; import org.drools.core.rule.consequence.InternalMatch; import org.drools.core.util.AbstractBaseLinkedListNode; import org.drools.util.bitmask.AllSetBitMask; @@ -49,13 +49,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; import static org.drools.core.phreak.TupleEvaluationUtil.createLeftTupleTupleSets; import static org.drools.core.phreak.TupleEvaluationUtil.findPathToFlush; import static org.drools.core.phreak.TupleEvaluationUtil.findPathsToFlushFromRia; import static org.drools.core.phreak.TupleEvaluationUtil.flushLeftTupleIfNecessary; import static org.drools.core.phreak.TupleEvaluationUtil.forceFlushLeftTuple; import static org.drools.core.phreak.TupleEvaluationUtil.forceFlushPath; -import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; /** * All asserting Facts must propagated into the right ObjectSink side of a BetaNode, if this is the first Pattern diff --git a/drools-core/src/main/java/org/drools/core/reteoo/LeftTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/LeftTuple.java index 49a7dc8b093..daa4c9986ae 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/LeftTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/LeftTuple.java @@ -18,16 +18,16 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.PropagationContext; -import org.drools.core.util.index.TupleList; -import org.kie.api.runtime.rule.FactHandle; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; +import org.drools.core.util.index.TupleList; +import org.kie.api.runtime.rule.FactHandle; + /** * A parent class for all specific LeftTuple specializations * diff --git a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSink.java b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSink.java index 00b2afd198f..520824de714 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSink.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSink.java @@ -18,8 +18,8 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.InternalFactHandle; import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.InternalFactHandle; import org.drools.core.common.PropagationContext; import org.drools.util.bitmask.BitMask; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkPropagator.java b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkPropagator.java index 57618db5829..ec9979097e2 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkPropagator.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkPropagator.java @@ -18,10 +18,10 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.BaseNode; - import java.io.Externalizable; +import org.drools.core.common.BaseNode; + public interface LeftTupleSinkPropagator extends Externalizable { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java index 7bb6ac43f93..5b38af65e66 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java @@ -18,6 +18,9 @@ */ package org.drools.core.reteoo; +import java.util.Collection; +import java.util.List; + import org.drools.base.base.ClassObjectType; import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; @@ -30,9 +33,6 @@ import org.drools.util.bitmask.BitMask; import org.drools.util.bitmask.EmptyBitMask; -import java.util.Collection; -import java.util.List; - import static org.drools.base.reteoo.PropertySpecificUtil.calculateNegativeMask; import static org.drools.base.reteoo.PropertySpecificUtil.calculatePositiveMask; import static org.drools.base.reteoo.PropertySpecificUtil.getAccessibleProperties; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ModifyPreviousTuples.java b/drools-core/src/main/java/org/drools/core/reteoo/ModifyPreviousTuples.java index e40e9f87a63..4038bcb265d 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ModifyPreviousTuples.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ModifyPreviousTuples.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo; +import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.ActivationsManager; import org.drools.core.common.DefaultFactHandle; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.drools.core.phreak.PhreakRuleTerminalNode; -import org.drools.core.common.PropagationContext; public class ModifyPreviousTuples { private final DefaultFactHandle.LinkedTuples linkedTuples; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/NodeSet.java b/drools-core/src/main/java/org/drools/core/reteoo/NodeSet.java index beb29d25787..5d2ffaae3ad 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/NodeSet.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/NodeSet.java @@ -18,14 +18,14 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.BaseNode; - import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import org.drools.core.common.BaseNode; + public class NodeSet implements Iterable { private final List nodes = new ArrayList<>(); private final Set nodeIds = new HashSet<>(); diff --git a/drools-core/src/main/java/org/drools/core/reteoo/NotNodeLeftTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/NotNodeLeftTuple.java index eee5b4ecdf2..b0ccf791335 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/NotNodeLeftTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/NotNodeLeftTuple.java @@ -23,12 +23,12 @@ import java.util.Collections; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.ContextEntry; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.MemoryFactory; -import org.drools.core.common.ReteEvaluator; -import org.drools.base.rule.ContextEntry; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; import org.drools.core.util.FastIterator; public class NotNodeLeftTuple extends LeftTuple { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSink.java b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSink.java index 6fc9fb37f71..4c76710f71f 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSink.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSink.java @@ -19,8 +19,8 @@ package org.drools.core.reteoo; import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; /** * Receiver of propagated FactHandleImpls from a diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSinkPropagator.java b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSinkPropagator.java index a6a93343d14..4b971610bcc 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSinkPropagator.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSinkPropagator.java @@ -20,11 +20,11 @@ import java.io.Externalizable; +import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.BaseNode; import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; public interface ObjectSinkPropagator extends diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSource.java b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSource.java index 0fea32bc7df..d4c12c5bfde 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ObjectSource.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ObjectSource.java @@ -18,6 +18,8 @@ */ package org.drools.core.reteoo; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.NodeTypeEnums; @@ -33,8 +35,6 @@ import org.drools.util.bitmask.BitMask; import org.drools.util.bitmask.EmptyBitMask; -import java.util.List; - import static org.drools.base.reteoo.PropertySpecificUtil.getAccessibleProperties; import static org.drools.base.reteoo.PropertySpecificUtil.isPropertyReactive; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeConf.java b/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeConf.java index e03dc119dfe..06ddd2186ec 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeConf.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeConf.java @@ -18,15 +18,15 @@ */ package org.drools.core.reteoo; +import org.drools.base.rule.EntryPointId; +import org.drools.base.rule.TypeDeclaration; import org.drools.core.WorkingMemoryEntryPoint; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; -import org.drools.base.rule.EntryPointId; -import org.drools.base.rule.TypeDeclaration; import org.drools.core.rule.accessor.FactHandleFactory; public interface ObjectTypeConf { - String getTypeName(); + String getTypeName(); ObjectTypeNode[] getObjectTypeNodes(); diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeNode.java b/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeNode.java index e6e5a4ed407..c86acfd8c51 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ObjectTypeNode.java @@ -18,6 +18,15 @@ */ package org.drools.core.reteoo; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + import org.drools.base.InitialFact; import org.drools.base.base.ClassObjectType; import org.drools.base.base.ObjectType; @@ -40,15 +49,6 @@ import org.drools.util.bitmask.BitMask; import org.drools.util.bitmask.EmptyBitMask; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Serializable; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - import static org.drools.base.rule.TypeDeclaration.NEVER_EXPIRES; /** @@ -161,8 +161,12 @@ public String toString() { @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof Id)) return false; + if (this == o) { + return true; + } + if (!(o instanceof Id)) { + return false; + } Id otherId = (Id) o; return id == otherId.id && otnId == otherId.otnId; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java b/drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java index efd8a8c2af2..9bb44c15910 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java @@ -18,6 +18,8 @@ */ package org.drools.core.reteoo; +import java.io.Serializable; + import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.ActivationsFilter; @@ -30,8 +32,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Serializable; - public class PathMemory extends AbstractBaseLinkedListNode implements Serializable, Memory { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/QueryElementNode.java b/drools-core/src/main/java/org/drools/core/reteoo/QueryElementNode.java index afd662c2ec4..f9e6b5a4ba3 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/QueryElementNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/QueryElementNode.java @@ -18,6 +18,8 @@ */ package org.drools.core.reteoo; +import java.util.List; + import org.drools.base.definitions.rule.impl.QueryImpl; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.reteoo.NodeTypeEnums; @@ -43,8 +45,6 @@ import org.drools.core.util.AbstractBaseLinkedListNode; import org.kie.api.runtime.rule.FactHandle; -import java.util.List; - public class QueryElementNode extends LeftTupleSource implements LeftTupleSinkNode, MemoryFactory { private LeftTupleSinkNode previousTupleSinkNode; @@ -474,12 +474,22 @@ public boolean equals(Object object) { } QueryElementNode other = (QueryElementNode) object; - if ( this.leftInput.getId() != other.leftInput.getId() ) return false; - if ( openQuery != other.openQuery ) return false; - if ( !openQuery && dataDriven != other.dataDriven ) return false; + if ( this.leftInput.getId() != other.leftInput.getId() ) { + return false; + } + if ( openQuery != other.openQuery ) { + return false; + } + if ( !openQuery && dataDriven != other.dataDriven ) { + return false; + } if ( queryElement == null ) { - if ( other.queryElement != null ) return false; - } else if ( !queryElement.equals( other.queryElement ) ) return false; + if ( other.queryElement != null ) { + return false; + } + } else if ( !queryElement.equals( other.queryElement ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/reteoo/QueryTerminalNode.java b/drools-core/src/main/java/org/drools/core/reteoo/QueryTerminalNode.java index 1f1b99e56a9..f03c866d304 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/QueryTerminalNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/QueryTerminalNode.java @@ -18,6 +18,8 @@ */ package org.drools.core.reteoo; +import java.util.Map; + import org.drools.base.definitions.rule.impl.QueryImpl; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.reteoo.NodeTypeEnums; @@ -27,8 +29,6 @@ import org.drools.core.common.PropagationContext; import org.drools.core.reteoo.builder.BuildContext; -import java.util.Map; - /** * Leaf Rete-OO node responsible for enacting Action s on a * matched Rule. diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ReactiveFromNode.java b/drools-core/src/main/java/org/drools/core/reteoo/ReactiveFromNode.java index c8d972f6e5d..d10ac72033e 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ReactiveFromNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ReactiveFromNode.java @@ -19,17 +19,17 @@ package org.drools.core.reteoo; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.From; +import org.drools.base.rule.accessor.DataProvider; +import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.BetaConstraints; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.TupleSets; import org.drools.core.common.TupleSetsImpl; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.From; -import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; -import org.drools.base.rule.accessor.DataProvider; -import org.drools.core.common.PropagationContext; import org.drools.core.util.index.TupleList; public class ReactiveFromNode extends FromNode { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/Rete.java b/drools-core/src/main/java/org/drools/core/reteoo/Rete.java index f140c39b19f..bf750649aff 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/Rete.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/Rete.java @@ -18,6 +18,12 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.NodeTypeEnums; @@ -31,12 +37,6 @@ import org.drools.core.reteoo.builder.BuildContext; import org.drools.util.bitmask.BitMask; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * The Rete-OO network. * diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ReteDumper.java b/drools-core/src/main/java/org/drools/core/reteoo/ReteDumper.java index 9a0f61ddcd9..df2dbc696f0 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ReteDumper.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ReteDumper.java @@ -29,8 +29,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.drools.core.common.BaseNode; import org.drools.base.common.NetworkNode; +import org.drools.core.common.BaseNode; import org.drools.core.impl.InternalRuleBase; import org.kie.api.KieBase; import org.kie.api.definition.rule.Rule; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ReteObjectTypeNode.java b/drools-core/src/main/java/org/drools/core/reteoo/ReteObjectTypeNode.java index 0993942bd2f..fce9b459326 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ReteObjectTypeNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ReteObjectTypeNode.java @@ -18,11 +18,11 @@ */ package org.drools.core.reteoo; +import org.drools.base.base.ObjectType; import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.PropagationContextFactory; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.base.ObjectType; -import org.drools.core.common.PropagationContext; public class ReteObjectTypeNode extends ObjectTypeNode { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/ReteooBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/ReteooBuilder.java index 0211f540a92..334a844442b 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/ReteooBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/ReteooBuilder.java @@ -33,19 +33,19 @@ import java.util.Queue; import java.util.Set; -import org.drools.base.reteoo.NodeTypeEnums; -import org.drools.core.common.BaseNode; import org.drools.base.common.DroolsObjectInputStream; import org.drools.base.common.DroolsObjectOutputStream; -import org.drools.core.common.InternalWorkingMemory; -import org.drools.core.common.MemoryFactory; import org.drools.base.common.NetworkNode; import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.InvalidPatternException; +import org.drools.base.rule.WindowDeclaration; +import org.drools.core.common.BaseNode; +import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.common.MemoryFactory; import org.drools.core.impl.InternalRuleBase; import org.drools.core.phreak.PhreakBuilder; import org.drools.core.reteoo.builder.ReteooRuleBuilder; -import org.drools.base.rule.InvalidPatternException; -import org.drools.base.rule.WindowDeclaration; import org.kie.api.definition.rule.Rule; /** diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RightInputAdapterNode.java b/drools-core/src/main/java/org/drools/core/reteoo/RightInputAdapterNode.java index a276bc9536c..68152135dad 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RightInputAdapterNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RightInputAdapterNode.java @@ -18,6 +18,11 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import org.drools.base.base.ObjectType; import org.drools.base.common.NetworkNode; import org.drools.base.definitions.rule.impl.RuleImpl; @@ -35,11 +40,6 @@ import org.drools.util.bitmask.BitMask; import org.kie.api.definition.rule.Rule; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - /** * When joining a subnetwork into the main network again, RightInputAdapterNode adapts the * subnetwork's tuple into a fact in order right join it with the tuple being propagated in diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RightTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/RightTuple.java index 219f3d81e8c..5d5b7e15bed 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RightTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RightTuple.java @@ -19,8 +19,8 @@ package org.drools.core.reteoo; import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; public interface RightTuple extends Tuple { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RightTupleImpl.java b/drools-core/src/main/java/org/drools/core/reteoo/RightTupleImpl.java index b1d3e888772..ee1cd0206b2 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RightTupleImpl.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RightTupleImpl.java @@ -20,8 +20,8 @@ import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; import org.drools.core.util.index.TupleList; public class RightTupleImpl extends AbstractTuple implements RightTuple { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RightTupleSink.java b/drools-core/src/main/java/org/drools/core/reteoo/RightTupleSink.java index ab3d2305b29..cd79e2bfa12 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RightTupleSink.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RightTupleSink.java @@ -18,8 +18,8 @@ */ package org.drools.core.reteoo; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; public interface RightTupleSink extends Sink { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RuleBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/RuleBuilder.java index 6e08b53ae75..407575e152c 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RuleBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RuleBuilder.java @@ -22,10 +22,10 @@ import java.util.Collection; import java.util.List; -import org.drools.core.common.InternalWorkingMemory; import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.core.impl.InternalRuleBase; import org.drools.base.rule.WindowDeclaration; +import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.impl.InternalRuleBase; public interface RuleBuilder { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNode.java b/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNode.java index 1aa45f3085a..4c11b264c06 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNode.java @@ -18,6 +18,9 @@ */ package org.drools.core.reteoo; +import java.util.Map; +import java.util.Objects; + import org.drools.base.base.SalienceInteger; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.reteoo.NodeTypeEnums; @@ -31,9 +34,6 @@ import org.drools.core.reteoo.builder.BuildContext; import org.drools.core.rule.consequence.InternalMatch; -import java.util.Map; -import java.util.Objects; - /** * Leaf Rete-OO node responsible for enacting Action s on a * matched Rule. diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNodeLeftTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNodeLeftTuple.java index 826da2cea61..c613d3c4168 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNodeLeftTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RuleTerminalNodeLeftTuple.java @@ -18,6 +18,11 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.rule.Declaration; import org.drools.base.rule.consequence.Consequence; @@ -31,11 +36,6 @@ import org.drools.core.rule.consequence.InternalMatch; import org.kie.api.runtime.rule.FactHandle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - public class RuleTerminalNodeLeftTuple extends LeftTuple implements InternalMatch { private static final long serialVersionUID = 540l; /** @@ -326,9 +326,15 @@ public void cancelActivation(ActivationsManager activationsManager) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } RuleTerminalNodeLeftTuple that = (RuleTerminalNodeLeftTuple) o; return ruleAgendaItem.getRule().getName().equals(that.ruleAgendaItem.getRule().getName()); } diff --git a/drools-core/src/main/java/org/drools/core/reteoo/RuntimeComponentFactory.java b/drools-core/src/main/java/org/drools/core/reteoo/RuntimeComponentFactory.java index 8fe7e31c094..638e2034775 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/RuntimeComponentFactory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/RuntimeComponentFactory.java @@ -18,6 +18,9 @@ */ package org.drools.core.reteoo; +import org.drools.base.RuleBase; +import org.drools.base.factmodel.traits.TraitFactory; +import org.drools.base.rule.accessor.GlobalResolver; import org.drools.core.SessionConfiguration; import org.drools.core.common.AgendaFactory; import org.drools.core.common.AgendaGroupFactory; @@ -25,15 +28,12 @@ import org.drools.core.common.InternalWorkingMemory; import org.drools.core.common.PropagationContextFactory; import org.drools.core.common.ReteEvaluator; -import org.drools.base.factmodel.traits.TraitFactory; import org.drools.core.management.DroolsManagementAgent; import org.drools.core.management.GenericKieSessionMonitoringImpl; import org.drools.core.marshalling.SerializablePlaceholderResolverStrategy; import org.drools.core.rule.accessor.FactHandleFactory; -import org.drools.base.rule.accessor.GlobalResolver; import org.drools.core.rule.consequence.KnowledgeHelper; import org.drools.core.time.TimerService; -import org.drools.base.RuleBase; import org.kie.api.internal.utils.KieService; import org.kie.api.marshalling.ObjectMarshallingStrategy; import org.kie.api.marshalling.ObjectMarshallingStrategyAcceptor; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/SegmentMemory.java b/drools-core/src/main/java/org/drools/core/reteoo/SegmentMemory.java index 150a7d6a86b..cba0529fe9e 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/SegmentMemory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/SegmentMemory.java @@ -18,6 +18,12 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; @@ -35,12 +41,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - import static org.drools.core.phreak.RuntimeSegmentUtilities.getQuerySegmentMemory; public class SegmentMemory extends LinkedList diff --git a/drools-core/src/main/java/org/drools/core/reteoo/SingleLeftTupleSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/SingleLeftTupleSinkAdapter.java index b5365d28c37..8dea48d8100 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/SingleLeftTupleSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/SingleLeftTupleSinkAdapter.java @@ -22,8 +22,8 @@ import java.io.ObjectInput; import java.io.ObjectOutput; -import org.drools.core.common.BaseNode; import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.BaseNode; public class SingleLeftTupleSinkAdapter extends AbstractLeftTupleSinkAdapter { protected LeftTupleSink sink; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/SingleObjectSinkAdapter.java b/drools-core/src/main/java/org/drools/core/reteoo/SingleObjectSinkAdapter.java index a905aca7879..abfaceb9732 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/SingleObjectSinkAdapter.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/SingleObjectSinkAdapter.java @@ -25,9 +25,9 @@ import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.BaseNode; import org.drools.core.common.InternalFactHandle; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.AccumulateNode.AccumulateMemory; -import org.drools.core.common.PropagationContext; public class SingleObjectSinkAdapter implements ObjectSinkPropagator { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/SubnetworkTuple.java b/drools-core/src/main/java/org/drools/core/reteoo/SubnetworkTuple.java index 82b7c8e5c81..eaa5d08442b 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/SubnetworkTuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/SubnetworkTuple.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo; +import java.util.concurrent.atomic.AtomicInteger; + import org.drools.core.common.DefaultFactHandle; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import java.util.concurrent.atomic.AtomicInteger; - public class SubnetworkTuple extends LeftTuple implements RightTuple { private LeftTuple blocked; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/TimerNode.java b/drools-core/src/main/java/org/drools/core/reteoo/TimerNode.java index 5f8c18815e9..ca3447bb216 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/TimerNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/TimerNode.java @@ -21,17 +21,17 @@ import java.util.Arrays; import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.Declaration; +import org.drools.base.rule.Pattern; +import org.drools.base.time.impl.Timer; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.base.rule.Declaration; -import org.drools.base.rule.Pattern; -import org.drools.core.common.PropagationContext; -import org.drools.base.time.impl.Timer; import org.drools.core.util.AbstractBaseLinkedListNode; import org.drools.core.util.index.TupleList; @@ -147,7 +147,7 @@ public boolean equals(final Object object) { } return Arrays.deepEquals(startEndDeclarations, other.startEndDeclarations) && - this.timer.equals(other.timer); + this.timer.equals(other.timer); } public TimerNodeMemory createMemory(final RuleBaseConfiguration config, ReteEvaluator reteEvaluator) { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/Tuple.java b/drools-core/src/main/java/org/drools/core/reteoo/Tuple.java index 3e4d72046c8..68797a42499 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/Tuple.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/Tuple.java @@ -18,16 +18,16 @@ */ package org.drools.core.reteoo; +import java.io.Serializable; + +import org.drools.base.common.NetworkNode; import org.drools.base.reteoo.BaseTuple; import org.drools.core.common.InternalFactHandle; -import org.drools.base.common.NetworkNode; import org.drools.core.common.PropagationContext; import org.drools.core.util.Entry; import org.drools.core.util.index.TupleList; import org.kie.api.runtime.rule.FactHandle; -import java.io.Serializable; - /** * Partial matches are propagated through the Rete network as Tuples. Each Tuple * Is able to return the FactHandleImpl members of the partial match for the requested pattern. diff --git a/drools-core/src/main/java/org/drools/core/reteoo/WindowNode.java b/drools-core/src/main/java/org/drools/core/reteoo/WindowNode.java index 1e07590f659..5697c3960f8 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/WindowNode.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/WindowNode.java @@ -18,6 +18,11 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.base.rule.EntryPointId; @@ -38,11 +43,6 @@ import org.drools.core.rule.SlidingTimeWindow; import org.drools.util.bitmask.BitMask; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - /** * WindowNodes are nodes in the Rete network used * to manage windows. They support multiple types of windows, like diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/AccumulateBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/AccumulateBuilder.java index b61388cd86c..fafbfbdfb01 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/AccumulateBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/AccumulateBuilder.java @@ -21,16 +21,16 @@ import java.util.ArrayList; import java.util.List; -import org.drools.core.common.BetaConstraints; -import org.drools.core.reteoo.AccumulateNode; -import org.drools.core.reteoo.CoreComponentFactory; -import org.drools.core.reteoo.LeftTupleSource; -import org.drools.core.reteoo.RightInputAdapterNode; import org.drools.base.rule.Accumulate; import org.drools.base.rule.GroupElement; import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; +import org.drools.core.common.BetaConstraints; +import org.drools.core.reteoo.AccumulateNode; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.reteoo.LeftTupleSource; +import org.drools.core.reteoo.RightInputAdapterNode; public class AccumulateBuilder implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncReceiveBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncReceiveBuilder.java index 3a7063ab51d..408ecf34d07 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncReceiveBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncReceiveBuilder.java @@ -18,11 +18,11 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.common.BetaConstraints; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.AsyncReceive; import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; +import org.drools.core.common.BetaConstraints; +import org.drools.core.reteoo.CoreComponentFactory; public class AsyncReceiveBuilder implements ReteooComponentBuilder { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncSendBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncSendBuilder.java index 6906d5fee81..025ab57a814 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncSendBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/AsyncSendBuilder.java @@ -18,12 +18,12 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.common.BetaConstraints; -import org.drools.core.reteoo.AsyncSendNode; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.AsyncSend; import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; +import org.drools.core.common.BetaConstraints; +import org.drools.core.reteoo.AsyncSendNode; +import org.drools.core.reteoo.CoreComponentFactory; public class AsyncSendBuilder implements ReteooComponentBuilder { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactory.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactory.java index 49bce73cc36..5e3dbdd0003 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactory.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo.builder; +import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.DefaultBetaConstraints; import org.drools.core.common.DoubleBetaConstraints; import org.drools.core.common.QuadroupleBetaConstraints; import org.drools.core.common.SingleBetaConstraints; import org.drools.core.common.TripleBetaConstraints; -import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.kie.api.internal.utils.KieService; public interface BetaNodeConstraintFactory extends KieService { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactoryImpl.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactoryImpl.java index 201604bf6a2..ddcf2cf8ab1 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactoryImpl.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/BetaNodeConstraintFactoryImpl.java @@ -18,13 +18,13 @@ */ package org.drools.core.reteoo.builder; +import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.DefaultBetaConstraints; import org.drools.core.common.DoubleBetaConstraints; import org.drools.core.common.QuadroupleBetaConstraints; import org.drools.core.common.SingleBetaConstraints; import org.drools.core.common.TripleBetaConstraints; -import org.drools.base.rule.constraint.BetaNodeFieldConstraint; public class BetaNodeConstraintFactoryImpl implements BetaNodeConstraintFactory { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildContext.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildContext.java index 0f218da3a7b..03ada1be5d5 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildContext.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildContext.java @@ -18,6 +18,13 @@ */ package org.drools.core.reteoo.builder; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.List; + import org.drools.base.RuleBuildContext; import org.drools.base.common.NetworkNode; import org.drools.base.common.RuleBasePartitionId; @@ -40,13 +47,6 @@ import org.drools.core.reteoo.TerminalNode; import org.drools.core.time.TemporalDependencyMatrix; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Deque; -import java.util.List; - import static org.drools.base.rule.TypeDeclaration.NEVER_EXPIRES; /** diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java index ec2336b1ea1..0edca81cddb 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java @@ -23,16 +23,10 @@ import java.util.List; import java.util.Map; -import org.drools.core.common.BaseNode; -import org.drools.core.common.BetaConstraints; -import org.drools.core.common.EmptyBetaConstraints; +import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.core.reteoo.AlphaNode; -import org.drools.core.reteoo.BetaNode; -import org.drools.core.reteoo.EntryPointNode; import org.drools.base.reteoo.NodeTypeEnums; -import org.drools.core.reteoo.ObjectTypeNode; import org.drools.base.rule.Declaration; import org.drools.base.rule.GroupElement; import org.drools.base.rule.IntervalProviderConstraint; @@ -40,10 +34,16 @@ import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; -import org.drools.base.base.ObjectType; import org.drools.base.time.Interval; -import org.drools.core.time.TemporalDependencyMatrix; import org.drools.base.time.TimeUtils; +import org.drools.core.common.BaseNode; +import org.drools.core.common.BetaConstraints; +import org.drools.core.common.EmptyBetaConstraints; +import org.drools.core.reteoo.AlphaNode; +import org.drools.core.reteoo.BetaNode; +import org.drools.core.reteoo.EntryPointNode; +import org.drools.core.reteoo.ObjectTypeNode; +import org.drools.core.time.TemporalDependencyMatrix; import org.kie.api.definition.rule.Rule; /** diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/CollectBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/CollectBuilder.java index e613321e8aa..7b5af6a4228 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/CollectBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/CollectBuilder.java @@ -21,13 +21,6 @@ import java.util.ArrayList; import java.util.List; -import org.drools.core.base.accumulators.CollectAccumulator; -import org.drools.core.common.BetaConstraints; -import org.drools.core.common.TupleStartEqualsConstraint; -import org.drools.core.reteoo.AccumulateNode; -import org.drools.core.reteoo.CoreComponentFactory; -import org.drools.core.reteoo.LeftTupleSource; -import org.drools.core.reteoo.RightInputAdapterNode; import org.drools.base.rule.Accumulate; import org.drools.base.rule.Collect; import org.drools.base.rule.Pattern; @@ -35,6 +28,13 @@ import org.drools.base.rule.SingleAccumulate; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; +import org.drools.core.base.accumulators.CollectAccumulator; +import org.drools.core.common.BetaConstraints; +import org.drools.core.common.TupleStartEqualsConstraint; +import org.drools.core.reteoo.AccumulateNode; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.reteoo.LeftTupleSource; +import org.drools.core.reteoo.RightInputAdapterNode; public class CollectBuilder implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/ConditionalBranchBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/ConditionalBranchBuilder.java index e834646babf..142e8bdbb27 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/ConditionalBranchBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/ConditionalBranchBuilder.java @@ -18,14 +18,14 @@ */ package org.drools.core.reteoo.builder; +import org.drools.base.rule.ConditionalBranch; +import org.drools.base.rule.GroupElement; +import org.drools.base.rule.RuleConditionElement; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.ConditionalBranchEvaluator; import org.drools.core.reteoo.ConditionalBranchNode; import org.drools.core.reteoo.CoreComponentFactory; import org.drools.core.reteoo.RuleTerminalNode; -import org.drools.base.rule.ConditionalBranch; -import org.drools.base.rule.GroupElement; -import org.drools.base.rule.RuleConditionElement; public class ConditionalBranchBuilder implements ReteooComponentBuilder { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/EntryPointBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/EntryPointBuilder.java index 6fd1fe976a1..60a387ba3cf 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/EntryPointBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/EntryPointBuilder.java @@ -18,10 +18,10 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.reteoo.CoreComponentFactory; -import org.drools.core.reteoo.EntryPointNode; import org.drools.base.rule.EntryPointId; import org.drools.base.rule.RuleConditionElement; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.reteoo.EntryPointNode; /** * This is a builder for the entry point pattern diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/EvalBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/EvalBuilder.java index f13ba32f381..7e2a17cd7be 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/EvalBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/EvalBuilder.java @@ -18,9 +18,9 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.EvalCondition; import org.drools.base.rule.RuleConditionElement; +import org.drools.core.reteoo.CoreComponentFactory; public class EvalBuilder implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/FromBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/FromBuilder.java index 9c6dd4397e6..ee654c48dc2 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/FromBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/FromBuilder.java @@ -18,12 +18,12 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.common.BetaConstraints; -import org.drools.core.reteoo.CoreComponentFactory; -import org.drools.core.reteoo.FromNode; import org.drools.base.rule.From; import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; +import org.drools.core.common.BetaConstraints; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.reteoo.FromNode; public class FromBuilder implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/GroupElementBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/GroupElementBuilder.java index 956d5628e92..6df4f4782ad 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/GroupElementBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/GroupElementBuilder.java @@ -24,6 +24,12 @@ import java.util.Map; import org.drools.base.InitialFact; +import org.drools.base.reteoo.NodeTypeEnums; +import org.drools.base.rule.GroupElement; +import org.drools.base.rule.GroupElement.Type; +import org.drools.base.rule.Pattern; +import org.drools.base.rule.RuleConditionElement; +import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.core.RuleBaseConfiguration; import org.drools.core.common.BetaConstraints; import org.drools.core.common.TupleStartEqualsConstraint; @@ -31,16 +37,10 @@ import org.drools.core.reteoo.ExistsNode; import org.drools.core.reteoo.JoinNode; import org.drools.core.reteoo.LeftTupleSource; -import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.reteoo.NotNode; import org.drools.core.reteoo.ObjectSource; import org.drools.core.reteoo.ObjectTypeNode; import org.drools.core.reteoo.RightInputAdapterNode; -import org.drools.base.rule.GroupElement; -import org.drools.base.rule.GroupElement.Type; -import org.drools.base.rule.Pattern; -import org.drools.base.rule.RuleConditionElement; -import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.kie.api.definition.rule.Propagation; public class GroupElementBuilder diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/NodeFactory.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/NodeFactory.java index a1194e0c844..c02d6a8fa65 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/NodeFactory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/NodeFactory.java @@ -19,6 +19,8 @@ package org.drools.core.reteoo.builder; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.rule.impl.RuleImpl; @@ -59,8 +61,6 @@ import org.drools.core.reteoo.WindowNode; import org.drools.core.rule.BehaviorRuntime; -import java.util.List; - public interface NodeFactory { EntryPointNode buildEntryPointNode( int id, diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/PatternBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/PatternBuilder.java index 4405e66ce61..421ca3ce239 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/PatternBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/PatternBuilder.java @@ -18,6 +18,10 @@ */ package org.drools.core.reteoo.builder; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + import org.drools.base.base.ClassObjectType; import org.drools.base.base.DroolsQuery; import org.drools.base.base.ObjectType; @@ -48,10 +52,6 @@ import org.kie.api.conf.EventProcessingOption; import org.kie.api.definition.type.Expires.Policy; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import static org.drools.base.rule.TypeDeclaration.NEVER_EXPIRES; import static org.drools.core.reteoo.builder.GroupElementBuilder.AndBuilder.buildJoinNode; import static org.drools.core.reteoo.builder.GroupElementBuilder.AndBuilder.buildTupleSource; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/PhreakNodeFactory.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/PhreakNodeFactory.java index ed919e02092..9a912664d98 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/PhreakNodeFactory.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/PhreakNodeFactory.java @@ -19,6 +19,9 @@ package org.drools.core.reteoo.builder; +import java.io.Serializable; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.base.definitions.rule.impl.RuleImpl; @@ -62,9 +65,6 @@ import org.drools.core.reteoo.WindowNode; import org.drools.core.rule.BehaviorRuntime; -import java.io.Serializable; -import java.util.List; - public class PhreakNodeFactory implements NodeFactory, Serializable { private static final NodeFactory INSTANCE = new PhreakNodeFactory(); diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/QueryElementBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/QueryElementBuilder.java index 3a862a59e0a..edda701d27d 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/QueryElementBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/QueryElementBuilder.java @@ -18,10 +18,10 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.Pattern; import org.drools.base.rule.QueryElement; import org.drools.base.rule.RuleConditionElement; +import org.drools.core.reteoo.CoreComponentFactory; public class QueryElementBuilder diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/ReactiveFromBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/ReactiveFromBuilder.java index 113ba740e76..be45455a201 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/ReactiveFromBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/ReactiveFromBuilder.java @@ -20,13 +20,13 @@ import java.util.List; -import org.drools.core.common.BetaConstraints; -import org.drools.core.reteoo.CoreComponentFactory; -import org.drools.core.reteoo.ReactiveFromNode; import org.drools.base.rule.From; import org.drools.base.rule.RuleConditionElement; -import org.drools.base.rule.constraint.XpathConstraint; import org.drools.base.rule.constraint.AlphaNodeFieldConstraint; +import org.drools.base.rule.constraint.XpathConstraint; +import org.drools.core.common.BetaConstraints; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.reteoo.ReactiveFromNode; public class ReactiveFromBuilder implements ReteooComponentBuilder { diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/ReteooRuleBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/ReteooRuleBuilder.java index b19df29d347..2431318aced 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/ReteooRuleBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/ReteooRuleBuilder.java @@ -18,6 +18,10 @@ */ package org.drools.core.reteoo.builder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import org.drools.base.base.ClassObjectType; import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.base.rule.Accumulate; @@ -53,10 +57,6 @@ import org.drools.core.time.TemporalDependencyMatrix; import org.kie.api.conf.EventProcessingOption; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - public class ReteooRuleBuilder implements RuleBuilder { protected BuildUtils utils; diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/TimerBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/TimerBuilder.java index 78233f57c02..5e6f2570681 100755 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/TimerBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/TimerBuilder.java @@ -18,11 +18,11 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.Declaration; import org.drools.base.rule.RuleConditionElement; -import org.drools.core.time.impl.BaseTimer; import org.drools.base.time.impl.Timer; +import org.drools.core.reteoo.CoreComponentFactory; +import org.drools.core.time.impl.BaseTimer; public class TimerBuilder implements diff --git a/drools-core/src/main/java/org/drools/core/reteoo/builder/WindowReferenceBuilder.java b/drools-core/src/main/java/org/drools/core/reteoo/builder/WindowReferenceBuilder.java index c1a342395b3..aaf35658325 100644 --- a/drools-core/src/main/java/org/drools/core/reteoo/builder/WindowReferenceBuilder.java +++ b/drools-core/src/main/java/org/drools/core/reteoo/builder/WindowReferenceBuilder.java @@ -18,9 +18,9 @@ */ package org.drools.core.reteoo.builder; -import org.drools.core.reteoo.WindowNode; import org.drools.base.rule.RuleConditionElement; import org.drools.base.rule.WindowReference; +import org.drools.core.reteoo.WindowNode; /** * This is a builder for named window references diff --git a/drools-core/src/main/java/org/drools/core/rule/BehaviorContext.java b/drools-core/src/main/java/org/drools/core/rule/BehaviorContext.java index 10817aa726b..d618e5c7d1e 100644 --- a/drools-core/src/main/java/org/drools/core/rule/BehaviorContext.java +++ b/drools-core/src/main/java/org/drools/core/rule/BehaviorContext.java @@ -18,11 +18,11 @@ */ package org.drools.core.rule; -import org.drools.core.common.DefaultEventHandle; -import org.drools.base.time.JobHandle; - import java.util.Collection; +import org.drools.base.time.JobHandle; +import org.drools.core.common.DefaultEventHandle; + public interface BehaviorContext { Collection getFactHandles(); diff --git a/drools-core/src/main/java/org/drools/core/rule/BehaviorManager.java b/drools-core/src/main/java/org/drools/core/rule/BehaviorManager.java index caa73ab8cc1..5de9f1d90f6 100644 --- a/drools-core/src/main/java/org/drools/core/rule/BehaviorManager.java +++ b/drools-core/src/main/java/org/drools/core/rule/BehaviorManager.java @@ -25,8 +25,8 @@ import java.util.List; import org.drools.core.common.InternalFactHandle; -import org.drools.core.common.ReteEvaluator; import org.drools.core.common.PropagationContext; +import org.drools.core.common.ReteEvaluator; import org.kie.api.runtime.rule.FactHandle; /** diff --git a/drools-core/src/main/java/org/drools/core/rule/JavaDialectRuntimeData.java b/drools-core/src/main/java/org/drools/core/rule/JavaDialectRuntimeData.java index bef6fa7a4ca..a5dae0475b8 100644 --- a/drools-core/src/main/java/org/drools/core/rule/JavaDialectRuntimeData.java +++ b/drools-core/src/main/java/org/drools/core/rule/JavaDialectRuntimeData.java @@ -18,24 +18,6 @@ */ package org.drools.core.rule; -import org.drools.base.definitions.impl.KnowledgePackageImpl; -import org.drools.base.definitions.rule.impl.QueryImpl; -import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.base.rule.ConditionalElement; -import org.drools.base.rule.DialectRuntimeData; -import org.drools.base.rule.DialectRuntimeRegistry; -import org.drools.base.rule.EvalCondition; -import org.drools.base.rule.Function; -import org.drools.base.rule.GroupElement; -import org.drools.base.rule.accessor.Wireable; -import org.drools.core.util.KeyStoreHelper; -import org.drools.util.StringUtils; -import org.drools.wiring.api.ComponentsFactory; -import org.drools.wiring.api.classloader.ProjectClassLoader; -import org.kie.internal.concurrent.ExecutorProviderFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Externalizable; @@ -58,6 +40,24 @@ import java.util.concurrent.CompletionService; import java.util.concurrent.ConcurrentHashMap; +import org.drools.base.definitions.impl.KnowledgePackageImpl; +import org.drools.base.definitions.rule.impl.QueryImpl; +import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.ConditionalElement; +import org.drools.base.rule.DialectRuntimeData; +import org.drools.base.rule.DialectRuntimeRegistry; +import org.drools.base.rule.EvalCondition; +import org.drools.base.rule.Function; +import org.drools.base.rule.GroupElement; +import org.drools.base.rule.accessor.Wireable; +import org.drools.core.util.KeyStoreHelper; +import org.drools.util.StringUtils; +import org.drools.wiring.api.ComponentsFactory; +import org.drools.wiring.api.classloader.ProjectClassLoader; +import org.kie.internal.concurrent.ExecutorProviderFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.drools.util.ClassUtils.convertClassToResourcePath; import static org.drools.util.ClassUtils.convertResourceToClassName; diff --git a/drools-core/src/main/java/org/drools/core/rule/SlidingTimeWindow.java b/drools-core/src/main/java/org/drools/core/rule/SlidingTimeWindow.java index 1dac5907e3d..f04ae01a1d1 100644 --- a/drools-core/src/main/java/org/drools/core/rule/SlidingTimeWindow.java +++ b/drools-core/src/main/java/org/drools/core/rule/SlidingTimeWindow.java @@ -25,9 +25,11 @@ import java.util.Collection; import java.util.PriorityQueue; +import org.drools.base.time.JobHandle; import org.drools.core.common.DefaultEventHandle; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.PhreakPropagationContextFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.WorkingMemoryAction; import org.drools.core.marshalling.MarshallerReaderContext; @@ -35,10 +37,8 @@ import org.drools.core.reteoo.ObjectTypeNode; import org.drools.core.reteoo.WindowNode; import org.drools.core.reteoo.WindowNode.WindowMemory; -import org.drools.core.common.PropagationContext; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; import org.drools.core.time.TimerService; import org.drools.core.time.impl.PointInTimeTrigger; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/rule/accessor/FactHandleFactory.java b/drools-core/src/main/java/org/drools/core/rule/accessor/FactHandleFactory.java index 32c4773839d..8235922ee44 100644 --- a/drools-core/src/main/java/org/drools/core/rule/accessor/FactHandleFactory.java +++ b/drools-core/src/main/java/org/drools/core/rule/accessor/FactHandleFactory.java @@ -21,8 +21,8 @@ import java.util.Collection; import org.drools.core.WorkingMemoryEntryPoint; -import org.drools.core.common.DefaultFactHandle; import org.drools.core.common.DefaultEventHandle; +import org.drools.core.common.DefaultFactHandle; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.ReteEvaluator; import org.drools.core.reteoo.ObjectTypeConf; diff --git a/drools-core/src/main/java/org/drools/core/rule/consequence/InternalMatch.java b/drools-core/src/main/java/org/drools/core/rule/consequence/InternalMatch.java index 648e684c0ac..064f8d5a42e 100644 --- a/drools-core/src/main/java/org/drools/core/rule/consequence/InternalMatch.java +++ b/drools-core/src/main/java/org/drools/core/rule/consequence/InternalMatch.java @@ -25,6 +25,8 @@ import java.util.Map; import org.drools.base.InitialFact; +import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.Declaration; import org.drools.base.rule.consequence.Consequence; import org.drools.core.common.ActivationGroupNode; import org.drools.core.common.ActivationNode; @@ -33,12 +35,10 @@ import org.drools.core.common.PropagationContext; import org.drools.core.common.QueryElementFactHandle; import org.drools.core.common.ReteEvaluator; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.phreak.RuleAgendaItem; import org.drools.core.reteoo.LeftTuple; import org.drools.core.reteoo.TerminalNode; import org.drools.core.reteoo.Tuple; -import org.drools.base.rule.Declaration; import org.drools.core.util.Queue.QueueEntry; import org.kie.api.runtime.process.ProcessInstance; import org.kie.api.runtime.rule.FactHandle; diff --git a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/LiveQueryImpl.java b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/LiveQueryImpl.java index fd205642cb5..d5f056e5414 100644 --- a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/LiveQueryImpl.java +++ b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/LiveQueryImpl.java @@ -18,9 +18,9 @@ */ package org.drools.core.runtime.rule.impl; -import org.kie.api.runtime.rule.FactHandle; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.InternalWorkingMemory; +import org.kie.api.runtime.rule.FactHandle; import org.kie.api.runtime.rule.LiveQuery; public class LiveQueryImpl diff --git a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/OpenQueryViewChangedEventListenerAdapter.java b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/OpenQueryViewChangedEventListenerAdapter.java index 23c7322b1e7..7eb0e4fbc49 100644 --- a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/OpenQueryViewChangedEventListenerAdapter.java +++ b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/OpenQueryViewChangedEventListenerAdapter.java @@ -20,9 +20,9 @@ import java.util.List; +import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.base.InternalViewChangedEventListener; import org.drools.core.common.ReteEvaluator; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.reteoo.LeftTuple; import org.kie.api.runtime.rule.ViewChangedEventListener; diff --git a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/RowAdapter.java b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/RowAdapter.java index e66fbca7a1a..949b1c7373c 100644 --- a/drools-core/src/main/java/org/drools/core/runtime/rule/impl/RowAdapter.java +++ b/drools-core/src/main/java/org/drools/core/runtime/rule/impl/RowAdapter.java @@ -89,18 +89,23 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } RowAdapter other = (RowAdapter) obj; if (this.tuple == null) { - if (other.tuple != null) + if (other.tuple != null) { return false; - } else if (!this.tuple.equals(other.tuple )) + } + } else if (!this.tuple.equals(other.tuple )) { return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/TimerExpressionUtil.java b/drools-core/src/main/java/org/drools/core/time/TimerExpressionUtil.java index e010cd7f7a0..f2a3a3f8175 100644 --- a/drools-core/src/main/java/org/drools/core/time/TimerExpressionUtil.java +++ b/drools-core/src/main/java/org/drools/core/time/TimerExpressionUtil.java @@ -18,14 +18,14 @@ */ package org.drools.core.time; +import java.util.Date; + import org.drools.base.base.ValueResolver; import org.drools.base.reteoo.BaseTuple; import org.drools.base.rule.Declaration; import org.drools.base.time.TimeUtils; import org.drools.util.DateUtils; -import java.util.Date; - public class TimerExpressionUtil { public static long evalTimeExpression(TimerExpression expr, BaseTuple leftTuple, Declaration[] declrs, ValueResolver valueResolver) { Object d = expr.getValue( leftTuple, declrs, valueResolver ); diff --git a/drools-core/src/main/java/org/drools/core/time/impl/BaseTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/BaseTimer.java index aa063daaf1a..969e2d0c59b 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/BaseTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/BaseTimer.java @@ -18,16 +18,16 @@ */ package org.drools.core.time.impl; -import org.drools.base.reteoo.SortDeclarations; -import org.drools.base.rule.ConditionalElement; -import org.drools.base.rule.Declaration; -import org.drools.base.rule.RuleConditionElement; - import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; +import org.drools.base.reteoo.SortDeclarations; +import org.drools.base.rule.ConditionalElement; +import org.drools.base.rule.Declaration; +import org.drools.base.rule.RuleConditionElement; + public abstract class BaseTimer extends ConditionalElement{ diff --git a/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTimer.java index 96c1cc29945..c5e2799f828 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTimer.java @@ -27,14 +27,14 @@ import java.util.Map; import org.drools.base.base.ValueResolver; -import org.drools.base.time.impl.Timer; -import org.drools.core.common.InternalWorkingMemory; import org.drools.base.reteoo.BaseTuple; import org.drools.base.rule.ConditionalElement; import org.drools.base.rule.Declaration; -import org.drools.core.rule.consequence.InternalMatch; import org.drools.base.time.JobHandle; import org.drools.base.time.Trigger; +import org.drools.base.time.impl.Timer; +import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.rule.consequence.InternalMatch; import org.kie.api.runtime.Calendars; /** diff --git a/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTrigger.java b/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTrigger.java index 5a617cacb94..8840daeb668 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTrigger.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/CompositeMaxDurationTrigger.java @@ -18,14 +18,14 @@ */ package org.drools.core.time.impl; -import org.drools.base.time.Trigger; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Date; +import org.drools.base.time.Trigger; + public class CompositeMaxDurationTrigger implements Trigger, Externalizable { diff --git a/drools-core/src/main/java/org/drools/core/time/impl/CronExpression.java b/drools-core/src/main/java/org/drools/core/time/impl/CronExpression.java index eff662f7cab..11212025df2 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/CronExpression.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/CronExpression.java @@ -765,8 +765,9 @@ public Object clone() { CronExpression copy; try { copy = new CronExpression(getCronExpression()); - if(getTimeZone() != null) + if(getTimeZone() != null) { copy.setTimeZone((TimeZone) getTimeZone().clone()); + } } catch (ParseException ex) { // never happens since the source is valid... throw new IncompatibleClassChangeError("Not Cloneable."); } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/CronTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/CronTimer.java index 7c1e598daf6..2ff9e668edd 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/CronTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/CronTimer.java @@ -26,13 +26,13 @@ import java.util.Map; import org.drools.base.base.ValueResolver; -import org.drools.base.time.impl.Timer; import org.drools.base.reteoo.BaseTuple; import org.drools.base.rule.ConditionalElement; import org.drools.base.rule.Declaration; import org.drools.base.time.JobHandle; -import org.drools.core.time.TimerExpression; import org.drools.base.time.Trigger; +import org.drools.base.time.impl.Timer; +import org.drools.core.time.TimerExpression; import org.kie.api.runtime.Calendars; import static org.drools.core.time.TimerExpressionUtil.evalDateExpression; @@ -143,20 +143,40 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } CronTimer other = (CronTimer) obj; - if ( repeatLimit != other.repeatLimit ) return false; + if ( repeatLimit != other.repeatLimit ) { + return false; + } if ( cronExpression.getCronExpression() == null ) { - if ( other.cronExpression.getCronExpression() != null ) return false; - } else if ( !cronExpression.getCronExpression().equals( other.cronExpression.getCronExpression() ) ) return false; + if ( other.cronExpression.getCronExpression() != null ) { + return false; + } + } else if ( !cronExpression.getCronExpression().equals( other.cronExpression.getCronExpression() ) ) { + return false; + } if ( endTime == null ) { - if ( other.endTime != null ) return false; - } else if ( !endTime.equals( other.endTime ) ) return false; + if ( other.endTime != null ) { + return false; + } + } else if ( !endTime.equals( other.endTime ) ) { + return false; + } if ( startTime == null ) { - if ( other.startTime != null ) return false; - } else if ( !startTime.equals( other.startTime ) ) return false; + if ( other.startTime != null ) { + return false; + } + } else if ( !startTime.equals( other.startTime ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/CronTrigger.java b/drools-core/src/main/java/org/drools/core/time/impl/CronTrigger.java index 9e6d199eb86..4f49aabdaee 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/CronTrigger.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/CronTrigger.java @@ -18,13 +18,13 @@ */ package org.drools.core.time.impl; -import org.drools.base.time.Trigger; -import org.kie.api.runtime.Calendars; - import java.util.Calendar; import java.util.Date; import java.util.TimeZone; +import org.drools.base.time.Trigger; +import org.kie.api.runtime.Calendars; + public class CronTrigger implements Trigger { diff --git a/drools-core/src/main/java/org/drools/core/time/impl/DefaultJobHandle.java b/drools-core/src/main/java/org/drools/core/time/impl/DefaultJobHandle.java index 24734b3664d..e87fc731ed9 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/DefaultJobHandle.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/DefaultJobHandle.java @@ -76,13 +76,23 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } final DefaultJobHandle other = (DefaultJobHandle) obj; if ( getJob() == null ) { - if ( other.getJob() != null ) return false; - } else if ( !getJob().equals( other.getJob() ) ) return false; + if ( other.getJob() != null ) { + return false; + } + } else if ( !getJob().equals( other.getJob() ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobFactoryManager.java b/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobFactoryManager.java index aa4ec5eeddb..27fce5d4b48 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobFactoryManager.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobFactoryManager.java @@ -21,11 +21,11 @@ import java.util.Collection; import java.util.Collections; +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.core.time.InternalSchedulerService; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; -import org.drools.base.time.Trigger; public class DefaultTimerJobFactoryManager implements diff --git a/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobInstance.java b/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobInstance.java index f7bb73b7ad8..0711af5fa4d 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobInstance.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/DefaultTimerJobInstance.java @@ -18,18 +18,18 @@ */ package org.drools.core.time.impl; +import java.io.Serializable; +import java.util.Date; +import java.util.concurrent.Callable; + +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.core.time.InternalSchedulerService; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; -import org.drools.base.time.Trigger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Serializable; -import java.util.Date; -import java.util.concurrent.Callable; - public class DefaultTimerJobInstance implements Callable, Comparable, TimerJobInstance, Serializable { private static final long serialVersionUID = -4441139572159254264L; diff --git a/drools-core/src/main/java/org/drools/core/time/impl/DurationTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/DurationTimer.java index 9f455aac368..8b8fffd53a1 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/DurationTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/DurationTimer.java @@ -28,16 +28,16 @@ import java.util.Map; import org.drools.base.base.ValueResolver; -import org.drools.base.time.impl.Timer; -import org.drools.core.common.DefaultEventHandle; -import org.drools.core.common.InternalWorkingMemory; import org.drools.base.reteoo.BaseTuple; import org.drools.base.rule.ConditionalElement; import org.drools.base.rule.Declaration; -import org.drools.core.rule.consequence.InternalMatch; -import org.drools.core.reteoo.Tuple; import org.drools.base.time.JobHandle; import org.drools.base.time.Trigger; +import org.drools.base.time.impl.Timer; +import org.drools.core.common.DefaultEventHandle; +import org.drools.core.common.InternalWorkingMemory; +import org.drools.core.reteoo.Tuple; +import org.drools.core.rule.consequence.InternalMatch; import org.drools.util.MathUtils; import org.kie.api.runtime.Calendars; import org.kie.api.time.Calendar; @@ -129,11 +129,19 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } DurationTimer other = (DurationTimer) obj; - if ( duration != other.duration ) return false; + if ( duration != other.duration ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/ExpressionIntervalTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/ExpressionIntervalTimer.java index ace0d34ec31..50e73232f75 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/ExpressionIntervalTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/ExpressionIntervalTimer.java @@ -26,13 +26,13 @@ import java.util.Map; import org.drools.base.base.ValueResolver; -import org.drools.base.time.impl.Timer; import org.drools.base.reteoo.BaseTuple; import org.drools.base.rule.ConditionalElement; import org.drools.base.rule.Declaration; import org.drools.base.time.JobHandle; -import org.drools.core.time.TimerExpression; import org.drools.base.time.Trigger; +import org.drools.base.time.impl.Timer; +import org.drools.core.time.TimerExpression; import org.kie.api.runtime.Calendars; import static org.drools.core.time.TimerExpressionUtil.evalDateExpression; @@ -184,19 +184,39 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } ExpressionIntervalTimer other = (ExpressionIntervalTimer) obj; - if ( delay != other.delay ) return false; - if ( repeatLimit != other.repeatLimit ) return false; + if ( delay != other.delay ) { + return false; + } + if ( repeatLimit != other.repeatLimit ) { + return false; + } if ( endTime == null ) { - if ( other.endTime != null ) return false; - } else if ( !endTime.equals( other.endTime ) ) return false; - if ( period != other.period ) return false; + if ( other.endTime != null ) { + return false; + } + } else if ( !endTime.equals( other.endTime ) ) { + return false; + } + if ( period != other.period ) { + return false; + } if ( startTime == null ) { - if ( other.startTime != null ) return false; - } else if ( !startTime.equals( other.startTime ) ) return false; + if ( other.startTime != null ) { + return false; + } + } else if ( !startTime.equals( other.startTime ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/IntervalTimer.java b/drools-core/src/main/java/org/drools/core/time/impl/IntervalTimer.java index b08df303f74..da1075a9a2b 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/IntervalTimer.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/IntervalTimer.java @@ -30,9 +30,9 @@ import org.drools.base.rule.ConditionalElement; import org.drools.base.rule.Declaration; import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.base.time.impl.Timer; import org.drools.core.time.TimerExpression; -import org.drools.base.time.Trigger; import org.kie.api.runtime.Calendars; import static org.drools.core.time.TimerExpressionUtil.evalDateExpression; @@ -169,19 +169,39 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } IntervalTimer other = (IntervalTimer) obj; - if ( delay != other.delay ) return false; - if ( repeatLimit != other.repeatLimit ) return false; + if ( delay != other.delay ) { + return false; + } + if ( repeatLimit != other.repeatLimit ) { + return false; + } if ( endTime == null ) { - if ( other.endTime != null ) return false; - } else if ( !endTime.equals( other.endTime ) ) return false; - if ( period != other.period ) return false; + if ( other.endTime != null ) { + return false; + } + } else if ( !endTime.equals( other.endTime ) ) { + return false; + } + if ( period != other.period ) { + return false; + } if ( startTime == null ) { - if ( other.startTime != null ) return false; - } else if ( !startTime.equals( other.startTime ) ) return false; + if ( other.startTime != null ) { + return false; + } + } else if ( !startTime.equals( other.startTime ) ) { + return false; + } return true; } diff --git a/drools-core/src/main/java/org/drools/core/time/impl/JDKTimerService.java b/drools-core/src/main/java/org/drools/core/time/impl/JDKTimerService.java index e78ab658010..b1139347745 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/JDKTimerService.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/JDKTimerService.java @@ -18,14 +18,6 @@ */ package org.drools.core.time.impl; -import org.drools.core.time.InternalSchedulerService; -import org.drools.core.time.Job; -import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; -import org.drools.core.time.TimerService; -import org.drools.base.time.Trigger; -import org.kie.api.time.SessionClock; - import java.util.Collection; import java.util.Date; import java.util.concurrent.Callable; @@ -34,6 +26,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; +import org.drools.core.time.InternalSchedulerService; +import org.drools.core.time.Job; +import org.drools.core.time.JobContext; +import org.drools.core.time.TimerService; +import org.kie.api.time.SessionClock; + /** * A default Scheduler implementation that uses the * JDK built-in ScheduledThreadPoolExecutor as the diff --git a/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java b/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java index 7eb01770283..5be7a8f171f 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java @@ -18,16 +18,6 @@ */ package org.drools.core.time.impl; -import org.drools.core.time.InternalSchedulerService; -import org.drools.core.time.Job; -import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; -import org.drools.core.time.SessionPseudoClock; -import org.drools.core.time.TimerService; -import org.drools.base.time.Trigger; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -40,6 +30,16 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; +import org.drools.core.time.InternalSchedulerService; +import org.drools.core.time.Job; +import org.drools.core.time.JobContext; +import org.drools.core.time.SessionPseudoClock; +import org.drools.core.time.TimerService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * A PseudoClockScheduler is a scheduler based on a user controlled clock * that allows the user to explicitly control current time. diff --git a/drools-core/src/main/java/org/drools/core/time/impl/ThreadSafeTrackableTimeJobFactoryManager.java b/drools-core/src/main/java/org/drools/core/time/impl/ThreadSafeTrackableTimeJobFactoryManager.java index a560ba38d97..7f49953865d 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/ThreadSafeTrackableTimeJobFactoryManager.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/ThreadSafeTrackableTimeJobFactoryManager.java @@ -18,11 +18,11 @@ */ package org.drools.core.time.impl; +import java.util.concurrent.ConcurrentHashMap; + import org.drools.core.time.JobContext; import org.drools.core.time.SelfRemovalJobContext; -import java.util.concurrent.ConcurrentHashMap; - public class ThreadSafeTrackableTimeJobFactoryManager extends TrackableTimeJobFactoryManager { public ThreadSafeTrackableTimeJobFactoryManager() { super(new ConcurrentHashMap<>()); diff --git a/drools-core/src/main/java/org/drools/core/time/impl/TimerJobFactoryManager.java b/drools-core/src/main/java/org/drools/core/time/impl/TimerJobFactoryManager.java index 06d97ec59b3..a10c1560550 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/TimerJobFactoryManager.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/TimerJobFactoryManager.java @@ -18,13 +18,13 @@ */ package org.drools.core.time.impl; +import java.util.Collection; + +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.core.time.InternalSchedulerService; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; -import org.drools.base.time.Trigger; - -import java.util.Collection; public interface TimerJobFactoryManager { TimerJobInstance createTimerJobInstance(Job job, diff --git a/drools-core/src/main/java/org/drools/core/time/impl/TimerJobInstance.java b/drools-core/src/main/java/org/drools/core/time/impl/TimerJobInstance.java index 3ef2f02c63e..fe8bcb5e00f 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/TimerJobInstance.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/TimerJobInstance.java @@ -18,10 +18,10 @@ */ package org.drools.core.time.impl; -import org.drools.core.time.Job; -import org.drools.core.time.JobContext; import org.drools.base.time.JobHandle; import org.drools.base.time.Trigger; +import org.drools.core.time.Job; +import org.drools.core.time.JobContext; public interface TimerJobInstance { JobHandle getJobHandle(); diff --git a/drools-core/src/main/java/org/drools/core/time/impl/TrackableTimeJobFactoryManager.java b/drools-core/src/main/java/org/drools/core/time/impl/TrackableTimeJobFactoryManager.java index 5cfcb6869dd..5a7dfc353e0 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/TrackableTimeJobFactoryManager.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/TrackableTimeJobFactoryManager.java @@ -18,18 +18,18 @@ */ package org.drools.core.time.impl; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.core.time.EnqueuedSelfRemovalJobContext; import org.drools.core.time.InternalSchedulerService; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; import org.drools.core.time.SelfRemovalJob; import org.drools.core.time.SelfRemovalJobContext; -import org.drools.base.time.Trigger; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; public class TrackableTimeJobFactoryManager implements diff --git a/drools-core/src/main/java/org/drools/core/util/AbstractHashTable.java b/drools-core/src/main/java/org/drools/core/util/AbstractHashTable.java index a6dbd12c980..a9b71182578 100644 --- a/drools-core/src/main/java/org/drools/core/util/AbstractHashTable.java +++ b/drools-core/src/main/java/org/drools/core/util/AbstractHashTable.java @@ -435,8 +435,12 @@ public int hashCode() { @Override public boolean equals( Object o ) { - if ( this == o ) return true; - if ( o == null || getClass() != o.getClass() ) return false; + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } SingleHashEntry that = ( SingleHashEntry ) o; return hashCode == that.hashCode && Objects.equals( obj1, that.obj1 ); } @@ -488,8 +492,12 @@ public int hashCode() { @Override public boolean equals( Object o ) { - if ( this == o ) return true; - if ( o == null || getClass() != o.getClass() ) return false; + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } DoubleHashEntry that = ( DoubleHashEntry ) o; return hashCode == that.hashCode && Objects.equals( obj1, that.obj1 ) && Objects.equals( obj2, that.obj2 ); } @@ -546,8 +554,12 @@ public int hashCode() { @Override public boolean equals( Object o ) { - if ( this == o ) return true; - if ( o == null || getClass() != o.getClass() ) return false; + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } TripleHashEntry that = ( TripleHashEntry ) o; return hashCode == that.hashCode && Objects.equals( obj1, that.obj1 ) && Objects.equals( obj2, that.obj2 ) && Objects.equals( obj3, that.obj3 ); } diff --git a/drools-core/src/main/java/org/drools/core/util/ArrayQueue.java b/drools-core/src/main/java/org/drools/core/util/ArrayQueue.java index 8521978453c..768ef751947 100644 --- a/drools-core/src/main/java/org/drools/core/util/ArrayQueue.java +++ b/drools-core/src/main/java/org/drools/core/util/ArrayQueue.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.lang.reflect.Array; import java.util.ArrayDeque; import java.util.Collection; diff --git a/drools-core/src/main/java/org/drools/core/util/BinaryHeapQueue.java b/drools-core/src/main/java/org/drools/core/util/BinaryHeapQueue.java index e14f513aab1..3168f91b1ef 100644 --- a/drools-core/src/main/java/org/drools/core/util/BinaryHeapQueue.java +++ b/drools-core/src/main/java/org/drools/core/util/BinaryHeapQueue.java @@ -22,15 +22,14 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.List; import java.util.NoSuchElementException; import java.util.Objects; import java.util.stream.Stream; + import org.drools.core.util.Queue.QueueEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/drools-core/src/main/java/org/drools/core/util/KieFunctions.java b/drools-core/src/main/java/org/drools/core/util/KieFunctions.java index cabfe47c327..ec8d217ffd7 100644 --- a/drools-core/src/main/java/org/drools/core/util/KieFunctions.java +++ b/drools-core/src/main/java/org/drools/core/util/KieFunctions.java @@ -41,21 +41,29 @@ public static boolean isNull(Object object) { } public static boolean equalsTo(Number number, String value) { - if (number == null) return value == null; + if (number == null) { + return value == null; + } - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } return compareTo(number, value) == 0; } public static boolean equalsTo(String string, String value) { - if (string == null) return value == null; + if (string == null) { + return value == null; + } return string.equals(value); } public static boolean equalsToIgnoreCase(String string, String value) { - if (string == null) return value == null; + if (string == null) { + return value == null; + } return string.equalsIgnoreCase(value); } @@ -65,61 +73,89 @@ public static boolean isEmpty(String string) { } public static boolean contains(String string, String value) { - if (string == null) return value == null; + if (string == null) { + return value == null; + } return value != null && string.contains(value); } public static boolean startsWith(String string, String value) { - if (string == null) return value == null; + if (string == null) { + return value == null; + } return value != null && string.startsWith(value); } public static boolean endsWith(String string, String value) { - if (string == null) return value == null; + if (string == null) { + return value == null; + } return value != null && string.endsWith(value); } public static boolean greaterThan(Number number, String value) { - if (number == null) return false; + if (number == null) { + return false; + } - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } return compareTo(number, value) > 0; } public static boolean greaterOrEqualThan(Number number, String value) { - if (number == null) return false; + if (number == null) { + return false; + } - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } return compareTo(number, value) >= 0; } public static boolean lessThan(Number number, String value) { - if (number == null) return false; + if (number == null) { + return false; + } - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } return compareTo(number, value) < 0; } public static boolean lessOrEqualThan(Number number, String value) { - if (number == null) return false; + if (number == null) { + return false; + } - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } return compareTo(number, value) <= 0; } public static boolean between(Number number, String minValue, String maxValue) { - if (number == null) return false; + if (number == null) { + return false; + } - if (minValue == null) throw new RuntimeException("Number: " + number + " can not be compared with minValue null."); + if (minValue == null) { + throw new RuntimeException("Number: " + number + " can not be compared with minValue null."); + } - if (maxValue == null) throw new RuntimeException("Number: " + number + " can not be compared with maxValue null."); + if (maxValue == null) { + throw new RuntimeException("Number: " + number + " can not be compared with maxValue null."); + } return compareTo(number, minValue) >= 0 && compareTo(number, maxValue) <= 0; } @@ -134,8 +170,12 @@ public static boolean isFalse(Boolean value) { private static int compareTo(Number number, String value) { - if (number == null) throw new RuntimeException("Number parameter can not be null."); - if (value == null) throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + if (number == null) { + throw new RuntimeException("Number parameter can not be null."); + } + if (value == null) { + throw new RuntimeException("Number: " + number + " can not be compared with a null value."); + } if (number instanceof Short) { return Short.valueOf(number.shortValue()).compareTo(Short.valueOf(value)); diff --git a/drools-core/src/main/java/org/drools/core/util/LinkedList.java b/drools-core/src/main/java/org/drools/core/util/LinkedList.java index 22b7e0b1abc..03f8abc245c 100644 --- a/drools-core/src/main/java/org/drools/core/util/LinkedList.java +++ b/drools-core/src/main/java/org/drools/core/util/LinkedList.java @@ -18,17 +18,14 @@ */ package org.drools.core.util; -import org.drools.core.reteoo.AbstractTuple; -import org.drools.core.reteoo.RightTuple; -import org.drools.core.reteoo.RightTupleImpl; -import org.drools.core.reteoo.Tuple; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.NoSuchElementException; +import org.drools.core.reteoo.AbstractTuple; + /** * This is a simple linked linked implementation. Each node must implement LinkedListNode so that it references * the node before and after it. This way a node can be removed without having to scan the list to find it. This class diff --git a/drools-core/src/main/java/org/drools/core/util/TupleRBTree.java b/drools-core/src/main/java/org/drools/core/util/TupleRBTree.java index 01a60af266a..a9dc9f5af2f 100644 --- a/drools-core/src/main/java/org/drools/core/util/TupleRBTree.java +++ b/drools-core/src/main/java/org/drools/core/util/TupleRBTree.java @@ -18,7 +18,6 @@ */ package org.drools.core.util; -import org.drools.core.reteoo.Tuple; import org.drools.core.util.index.TupleList; public class TupleRBTree> { @@ -41,7 +40,9 @@ public void verifyProperties() { private static void verifyProperty1(Node< ? > n) { assert nodeColor( n ) == Color.RED || nodeColor( n ) == Color.BLACK; - if ( n == null ) return; + if ( n == null ) { + return; + } verifyProperty1( n.left ); verifyProperty1( n.right ); } @@ -60,7 +61,9 @@ private static void verifyProperty4(Node< ? > n) { assert nodeColor( n.right ) == Color.BLACK; assert nodeColor( n.parent ) == Color.BLACK; } - if ( n == null ) return; + if ( n == null ) { + return; + } verifyProperty4( n.left ); verifyProperty4( n.right ); } @@ -291,8 +294,12 @@ private void replaceNode(Node oldn, if ( oldn.parent == null ) { root = newn; } else { - if ( oldn == oldn.parent.left ) oldn.parent.left = newn; - else oldn.parent.right = newn; + if ( oldn == oldn.parent.left ) { + oldn.parent.left = newn; + } + else { + oldn.parent.right = newn; + } } if ( newn != null ) { newn.parent = oldn.parent; @@ -342,13 +349,21 @@ public Node insert(K key) { } private void insertCase1(Node n) { - if ( n.parent == null ) n.color = Color.BLACK; - else insertCase2( n ); + if ( n.parent == null ) { + n.color = Color.BLACK; + } + else { + insertCase2( n ); + } } private void insertCase2(Node n) { - if ( nodeColor( n.parent ) == Color.BLACK ) return; // Tree is still valid - else insertCase3( n ); + if ( nodeColor( n.parent ) == Color.BLACK ) { + return; // Tree is still valid + } + else { + insertCase3( n ); + } } void insertCase3(Node n) { @@ -385,7 +400,9 @@ void insertCase5(Node n) { public void delete(K key) { Node n = lookup(key); - if ( n == null ) return; // Key not found, do nothing + if ( n == null ) { + return; // Key not found, do nothing + } if ( n.left != null && n.right != null ) { // Copy key/value from predecessor and then delete it instead Node pred = maximumNode( n.left ); @@ -419,16 +436,24 @@ public void delete(K key) { } private void deleteCase1(Node n) { - if ( n.parent == null ) return; - else deleteCase2( n ); + if ( n.parent == null ) { + return; + } + else { + deleteCase2( n ); + } } private void deleteCase2(Node n) { if ( nodeColor( n.sibling() ) == Color.RED ) { n.parent.color = Color.RED; n.sibling().color = Color.BLACK; - if ( n == n.parent.left ) rotateLeft( n.parent ); - else rotateRight( n.parent ); + if ( n == n.parent.left ) { + rotateLeft( n.parent ); + } + else { + rotateRight( n.parent ); + } } deleteCase3( n ); } @@ -437,32 +462,33 @@ private void deleteCase3(Node n) { if ( nodeColor( n.parent ) == Color.BLACK && nodeColor( n.sibling() ) == Color.BLACK && nodeColor( n.sibling().left ) == Color.BLACK && - nodeColor( n.sibling().right ) == Color.BLACK ) - { + nodeColor( n.sibling().right ) == Color.BLACK ) { n.sibling().color = Color.RED; deleteCase1( n.parent ); } - else deleteCase4( n ); + else { + deleteCase4( n ); + } } private void deleteCase4(Node n) { if ( nodeColor( n.parent ) == Color.RED && nodeColor( n.sibling() ) == Color.BLACK && nodeColor( n.sibling().left ) == Color.BLACK && - nodeColor( n.sibling().right ) == Color.BLACK ) - { + nodeColor( n.sibling().right ) == Color.BLACK ) { n.sibling().color = Color.RED; n.parent.color = Color.BLACK; } - else deleteCase5( n ); + else { + deleteCase5( n ); + } } private void deleteCase5(Node n) { if ( n == n.parent.left && nodeColor( n.sibling() ) == Color.BLACK && nodeColor( n.sibling().left ) == Color.RED && - nodeColor( n.sibling().right ) == Color.BLACK ) - { + nodeColor( n.sibling().right ) == Color.BLACK ) { n.sibling().color = Color.RED; n.sibling().left.color = Color.BLACK; rotateRight( n.sibling() ); @@ -470,8 +496,7 @@ private void deleteCase5(Node n) { else if ( n == n.parent.right && nodeColor( n.sibling() ) == Color.BLACK && nodeColor( n.sibling().right ) == Color.RED && - nodeColor( n.sibling().left ) == Color.BLACK ) - { + nodeColor( n.sibling().left ) == Color.BLACK ) { n.sibling().color = Color.RED; n.sibling().right.color = Color.BLACK; rotateLeft( n.sibling() ); @@ -486,8 +511,7 @@ private void deleteCase6(Node n) { n.sibling().right.color = Color.BLACK; rotateLeft( n.parent ); } - else - { + else { n.sibling().left.color = Color.BLACK; rotateRight( n.parent ); } diff --git a/drools-core/src/main/java/org/drools/core/util/index/AbstractTupleIndexTree.java b/drools-core/src/main/java/org/drools/core/util/index/AbstractTupleIndexTree.java index fa5ce96e3a2..d5c6d4d0a8d 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/AbstractTupleIndexTree.java +++ b/drools-core/src/main/java/org/drools/core/util/index/AbstractTupleIndexTree.java @@ -18,9 +18,9 @@ */ package org.drools.core.util.index; +import org.drools.base.util.FieldIndex; import org.drools.base.util.index.ConstraintTypeOperator; import org.drools.core.reteoo.Tuple; -import org.drools.base.util.FieldIndex; public abstract class AbstractTupleIndexTree { protected FieldIndex index; diff --git a/drools-core/src/main/java/org/drools/core/util/index/AlphaRangeIndex.java b/drools-core/src/main/java/org/drools/core/util/index/AlphaRangeIndex.java index ba200dd171e..dccad70be85 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/AlphaRangeIndex.java +++ b/drools-core/src/main/java/org/drools/core/util/index/AlphaRangeIndex.java @@ -26,11 +26,11 @@ import java.util.Collections; import org.drools.base.base.ValueType; +import org.drools.base.rule.IndexableConstraint; +import org.drools.base.rule.accessor.FieldValue; import org.drools.base.util.index.ConstraintTypeOperator; import org.drools.core.reteoo.AlphaNode; import org.drools.core.reteoo.CompositeObjectSinkAdapter; -import org.drools.base.rule.IndexableConstraint; -import org.drools.base.rule.accessor.FieldValue; import org.drools.core.util.index.RangeIndex.IndexType; /** diff --git a/drools-core/src/main/java/org/drools/core/util/index/IndexFactory.java b/drools-core/src/main/java/org/drools/core/util/index/IndexFactory.java index c9866b28a4b..5769458d340 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/IndexFactory.java +++ b/drools-core/src/main/java/org/drools/core/util/index/IndexFactory.java @@ -18,12 +18,12 @@ */ package org.drools.core.util.index; +import org.drools.base.rule.ContextEntry; +import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.base.util.index.ConstraintTypeOperator; import org.drools.core.RuleBaseConfiguration; import org.drools.core.reteoo.BetaMemory; import org.drools.core.reteoo.TupleMemory; -import org.drools.base.rule.ContextEntry; -import org.drools.base.rule.constraint.BetaNodeFieldConstraint; public interface IndexFactory { diff --git a/drools-core/src/main/java/org/drools/core/util/index/IndexSpec.java b/drools-core/src/main/java/org/drools/core/util/index/IndexSpec.java index 23e965d5c26..36f094d7916 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/IndexSpec.java +++ b/drools-core/src/main/java/org/drools/core/util/index/IndexSpec.java @@ -18,6 +18,9 @@ */ package org.drools.core.util.index; +import java.util.ArrayList; +import java.util.List; + import org.drools.base.rule.IndexableConstraint; import org.drools.base.rule.constraint.BetaNodeFieldConstraint; import org.drools.base.util.FieldIndex; @@ -25,9 +28,6 @@ import org.drools.core.RuleBaseConfiguration; import org.kie.internal.conf.IndexPrecedenceOption; -import java.util.ArrayList; -import java.util.List; - import static org.drools.base.util.index.IndexUtil.isEqualIndexable; public class IndexSpec { diff --git a/drools-core/src/main/java/org/drools/core/util/index/RangeIndex.java b/drools-core/src/main/java/org/drools/core/util/index/RangeIndex.java index a5af9b8eb76..1dcaa9b5de4 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/RangeIndex.java +++ b/drools-core/src/main/java/org/drools/core/util/index/RangeIndex.java @@ -87,20 +87,26 @@ public int hashCode() { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } IndexKey other = (IndexKey) obj; - if (indexType != other.indexType) + if (indexType != other.indexType) { return false; + } if (key == null) { - if (other.key != null) + if (other.key != null) { return false; - } else if (!key.equals(other.key)) + } + } else if (!key.equals(other.key)) { return false; + } return true; } } diff --git a/drools-core/src/main/java/org/drools/core/util/index/TupleIndexHashTable.java b/drools-core/src/main/java/org/drools/core/util/index/TupleIndexHashTable.java index 5f82e9adaa6..ae35385ee8a 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/TupleIndexHashTable.java +++ b/drools-core/src/main/java/org/drools/core/util/index/TupleIndexHashTable.java @@ -18,9 +18,12 @@ */ package org.drools.core.util.index; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + import org.drools.base.util.FieldIndex; import org.drools.core.reteoo.AbstractTuple; -import org.drools.core.reteoo.RightTupleImpl; import org.drools.core.reteoo.Tuple; import org.drools.core.reteoo.TupleMemory; import org.drools.core.util.AbstractHashTable; @@ -28,10 +31,6 @@ import org.drools.core.util.Iterator; import org.drools.core.util.LinkedList; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - public class TupleIndexHashTable extends AbstractHashTable implements TupleMemory { private static final long serialVersionUID = 510l; diff --git a/drools-core/src/main/java/org/drools/core/util/index/TupleList.java b/drools-core/src/main/java/org/drools/core/util/index/TupleList.java index c4230560f62..2bb514931c9 100644 --- a/drools-core/src/main/java/org/drools/core/util/index/TupleList.java +++ b/drools-core/src/main/java/org/drools/core/util/index/TupleList.java @@ -22,9 +22,8 @@ import org.drools.core.common.InternalFactHandle; import org.drools.core.reteoo.AbstractTuple; -import org.drools.core.reteoo.RightTupleImpl; -import org.drools.core.reteoo.TupleMemory; import org.drools.core.reteoo.Tuple; +import org.drools.core.reteoo.TupleMemory; import org.drools.core.util.Entry; import org.drools.core.util.FastIterator; import org.drools.core.util.Iterator; diff --git a/drools-core/src/test/java/org/drools/core/base/ClassTypeResolverTest.java b/drools-core/src/test/java/org/drools/core/base/ClassTypeResolverTest.java index 742da0e3bb8..55cfd83dc62 100644 --- a/drools-core/src/test/java/org/drools/core/base/ClassTypeResolverTest.java +++ b/drools-core/src/test/java/org/drools/core/base/ClassTypeResolverTest.java @@ -20,11 +20,11 @@ import java.util.HashSet; -import org.drools.util.ClassTypeResolver; -import org.drools.util.TypeResolver; import org.drools.core.test.model.Cheese; import org.drools.core.test.model.FirstClass; import org.drools.core.test.model.SecondClass; +import org.drools.util.ClassTypeResolver; +import org.drools.util.TypeResolver; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/base/accumulators/VarianceNaNTest.java b/drools-core/src/test/java/org/drools/core/base/accumulators/VarianceNaNTest.java index 324a7353a32..a17cb635787 100644 --- a/drools-core/src/test/java/org/drools/core/base/accumulators/VarianceNaNTest.java +++ b/drools-core/src/test/java/org/drools/core/base/accumulators/VarianceNaNTest.java @@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.within; public class VarianceNaNTest { - + @Test public void shouldNotProduceNaNAfterBackout(){ VarianceAccumulateFunction varianceAccumulateFunction = new VarianceAccumulateFunction(); @@ -36,15 +36,15 @@ public void shouldNotProduceNaNAfterBackout(){ assertThat(varianceAccumulateFunction.getResult(data)).isCloseTo(Double.NaN, within(0.0)); Double value = 1.5; - + //With single value variance should be 0 varianceAccumulateFunction.accumulate(data, value); assertThat(varianceAccumulateFunction.getResult(data)).isCloseTo(0.0d, within(.001d)); - + //should be back to NaN after backout varianceAccumulateFunction.reverse(data, value); assertThat(varianceAccumulateFunction.getResult(data)).isCloseTo(Double.NaN, within(0.0)); - + //should be zero after adding number back varianceAccumulateFunction.accumulate(data, value); assertThat(varianceAccumulateFunction.getResult(data)).isCloseTo(0.0d, within(.001d)); diff --git a/drools-core/src/test/java/org/drools/core/common/DroolsObjectIOTest.java b/drools-core/src/test/java/org/drools/core/common/DroolsObjectIOTest.java index c156e0623d6..b396ff02dcf 100644 --- a/drools-core/src/test/java/org/drools/core/common/DroolsObjectIOTest.java +++ b/drools-core/src/test/java/org/drools/core/common/DroolsObjectIOTest.java @@ -36,8 +36,8 @@ import org.drools.base.common.DroolsObjectOutputStream; import org.drools.base.definitions.InternalKnowledgePackage; import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.GroupElement; +import org.drools.core.reteoo.CoreComponentFactory; import org.drools.core.util.DroolsStreamUtils; import org.junit.Test; diff --git a/drools-core/src/test/java/org/drools/core/facttemplates/FactTemplateFieldExtractorTest.java b/drools-core/src/test/java/org/drools/core/facttemplates/FactTemplateFieldExtractorTest.java index 1d49e2e239e..ec769f24275 100644 --- a/drools-core/src/test/java/org/drools/core/facttemplates/FactTemplateFieldExtractorTest.java +++ b/drools-core/src/test/java/org/drools/core/facttemplates/FactTemplateFieldExtractorTest.java @@ -26,10 +26,10 @@ import org.drools.base.facttemplates.FactTemplateObjectType; import org.drools.base.facttemplates.FieldTemplate; import org.drools.base.facttemplates.FieldTemplateImpl; -import org.drools.core.reteoo.CoreComponentFactory; import org.drools.base.rule.Declaration; import org.drools.base.rule.Pattern; import org.drools.base.rule.accessor.ReadAccessor; +import org.drools.core.reteoo.CoreComponentFactory; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceSerializationTest.java b/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceSerializationTest.java index 9e553bd2a04..1d26ecd2f01 100644 --- a/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceSerializationTest.java +++ b/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceSerializationTest.java @@ -32,24 +32,24 @@ public class ByteArrayResourceSerializationTest { - //FIX https://issues.redhat.com/browse/DROOLS-5681 - @Test - public void bytesAttributesIsStillSerializedDeserializedCorrectly() throws IOException, ClassNotFoundException { - - final byte[] content = "some content".getBytes(StandardCharsets.UTF_8); - - ByteArrayResource bar = new ByteArrayResource(content, StandardCharsets.UTF_8.toString()); - byte[] serializedBar; - try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos)){ - oos.writeObject(bar); - serializedBar = baos.toByteArray(); - } - ByteArrayResource desBar; - try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serializedBar))){ - desBar = (ByteArrayResource) ois.readObject(); - } - assertThat(desBar.getBytes()).isEqualTo(content); - } + //FIX https://issues.redhat.com/browse/DROOLS-5681 + @Test + public void bytesAttributesIsStillSerializedDeserializedCorrectly() throws IOException, ClassNotFoundException { + + final byte[] content = "some content".getBytes(StandardCharsets.UTF_8); + + ByteArrayResource bar = new ByteArrayResource(content, StandardCharsets.UTF_8.toString()); + byte[] serializedBar; + try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos)){ + oos.writeObject(bar); + serializedBar = baos.toByteArray(); + } + ByteArrayResource desBar; + try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serializedBar))){ + desBar = (ByteArrayResource) ois.readObject(); + } + assertThat(desBar.getBytes()).isEqualTo(content); + } } diff --git a/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceToStringTest.java b/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceToStringTest.java index 290919c148f..2bb1143a0ad 100644 --- a/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceToStringTest.java +++ b/drools-core/src/test/java/org/drools/core/io/impl/ByteArrayResourceToStringTest.java @@ -18,17 +18,17 @@ */ package org.drools.core.io.impl; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + import org.apache.commons.lang3.ArrayUtils; import org.drools.io.ByteArrayResource; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - import static org.assertj.core.api.Assertions.assertThat; @RunWith(Parameterized.class) diff --git a/drools-core/src/test/java/org/drools/core/reteoo/BaseNodeTest.java b/drools-core/src/test/java/org/drools/core/reteoo/BaseNodeTest.java index e969990baf9..fa3cad6d5fe 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/BaseNodeTest.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/BaseNodeTest.java @@ -18,12 +18,12 @@ */ package org.drools.core.reteoo; +import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.BaseNode; import org.drools.core.common.InternalWorkingMemory; -import org.drools.base.common.RuleBasePartitionId; +import org.drools.core.common.PropagationContext; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.core.common.PropagationContext; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/reteoo/DefaultFactHandleFactoryTest.java b/drools-core/src/test/java/org/drools/core/reteoo/DefaultFactHandleFactoryTest.java index b9a85c5fe11..9344e08a906 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/DefaultFactHandleFactoryTest.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/DefaultFactHandleFactoryTest.java @@ -18,10 +18,10 @@ */ package org.drools.core.reteoo; +import org.drools.core.common.DefaultFactHandle; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; -import org.drools.core.common.DefaultFactHandle; public class DefaultFactHandleFactoryTest { diff --git a/drools-core/src/test/java/org/drools/core/reteoo/MockLeftTupleSink.java b/drools-core/src/test/java/org/drools/core/reteoo/MockLeftTupleSink.java index fa18e14aa4c..d2fa95d16c7 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/MockLeftTupleSink.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/MockLeftTupleSink.java @@ -26,10 +26,10 @@ import org.drools.core.common.InternalFactHandle; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; +import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; import org.drools.core.common.UpdateContext; import org.drools.core.reteoo.builder.BuildContext; -import org.drools.core.common.PropagationContext; public class MockLeftTupleSink extends LeftTupleSource implements diff --git a/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSink.java b/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSink.java index 1f7489d52f0..b7ca5d7f846 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSink.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSink.java @@ -21,13 +21,13 @@ import java.util.ArrayList; import java.util.List; +import org.drools.base.common.NetworkNode; +import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.BaseTerminalNode; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.InternalFactHandle; -import org.drools.base.common.NetworkNode; import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.kie.api.definition.rule.Rule; public class MockObjectSink diff --git a/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSource.java b/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSource.java index 72ece6e9378..47881ab27de 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSource.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/MockObjectSource.java @@ -18,6 +18,10 @@ */ package org.drools.core.reteoo; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.drools.base.base.ObjectType; import org.drools.base.common.RuleBasePartitionId; import org.drools.core.common.InternalFactHandle; @@ -26,10 +30,6 @@ import org.drools.core.reteoo.builder.BuildContext; import org.drools.util.bitmask.BitMask; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - public class MockObjectSource extends ObjectSource { private static final long serialVersionUID = 510l; diff --git a/drools-core/src/test/java/org/drools/core/reteoo/MockRightTupleSink.java b/drools-core/src/test/java/org/drools/core/reteoo/MockRightTupleSink.java index be4150d45d9..117ec1e9cc1 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/MockRightTupleSink.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/MockRightTupleSink.java @@ -22,11 +22,11 @@ import java.util.List; import org.drools.base.common.NetworkNode; +import org.drools.base.common.RuleBasePartitionId; import org.drools.base.reteoo.BaseTerminalNode; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.PropagationContext; import org.drools.core.common.ReteEvaluator; -import org.drools.base.common.RuleBasePartitionId; import org.kie.api.definition.rule.Rule; public class MockRightTupleSink diff --git a/drools-core/src/test/java/org/drools/core/reteoo/NodeTypeEnumTest.java b/drools-core/src/test/java/org/drools/core/reteoo/NodeTypeEnumTest.java index 432dbfdf76c..719e49f436c 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/NodeTypeEnumTest.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/NodeTypeEnumTest.java @@ -21,7 +21,11 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; -import static org.drools.base.reteoo.NodeTypeEnums.*; +import static org.drools.base.reteoo.NodeTypeEnums.isBetaNode; +import static org.drools.base.reteoo.NodeTypeEnums.isLeftTupleSink; +import static org.drools.base.reteoo.NodeTypeEnums.isLeftTupleSource; +import static org.drools.base.reteoo.NodeTypeEnums.isObjectSink; +import static org.drools.base.reteoo.NodeTypeEnums.isObjectSource; public class NodeTypeEnumTest { EntryPointNode epNode = new EntryPointNode(); diff --git a/drools-core/src/test/java/org/drools/core/reteoo/ReteComparator.java b/drools-core/src/test/java/org/drools/core/reteoo/ReteComparator.java index 1695fb220e4..123ecc24e25 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/ReteComparator.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/ReteComparator.java @@ -21,8 +21,8 @@ import java.util.Arrays; import java.util.Comparator; -import org.drools.core.common.BaseNode; import org.drools.base.common.NetworkNode; +import org.drools.core.common.BaseNode; import org.drools.core.impl.InternalRuleBase; import org.kie.api.KieBase; import org.kie.api.runtime.KieRuntime; diff --git a/drools-core/src/test/java/org/drools/core/reteoo/ReteMemoryChecker.java b/drools-core/src/test/java/org/drools/core/reteoo/ReteMemoryChecker.java index 9db086b645d..6adaffc7cf0 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/ReteMemoryChecker.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/ReteMemoryChecker.java @@ -18,12 +18,12 @@ */ package org.drools.core.reteoo; +import org.drools.base.common.NetworkNode; import org.drools.base.reteoo.NodeTypeEnums; import org.drools.core.common.BaseNode; import org.drools.core.common.InternalWorkingMemory; import org.drools.core.common.Memory; import org.drools.core.common.MemoryFactory; -import org.drools.base.common.NetworkNode; import org.drools.core.impl.InternalRuleBase; import org.kie.api.runtime.KieSession; diff --git a/drools-core/src/test/java/org/drools/core/reteoo/TupleIterationTest.java b/drools-core/src/test/java/org/drools/core/reteoo/TupleIterationTest.java index 7324f62cca7..99ed7c9e046 100644 --- a/drools-core/src/test/java/org/drools/core/reteoo/TupleIterationTest.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/TupleIterationTest.java @@ -22,9 +22,8 @@ import java.util.Arrays; import java.util.List; -import org.drools.core.reteoo.TupleIterator.OnLeaf; - import org.drools.core.common.PropagationContext; +import org.drools.core.reteoo.TupleIterator.OnLeaf; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/reteoo/builder/ReteooRuleBuilderTest.java b/drools-core/src/test/java/org/drools/core/reteoo/builder/ReteooRuleBuilderTest.java index ff625a1d5f9..9a670077dc8 100755 --- a/drools-core/src/test/java/org/drools/core/reteoo/builder/ReteooRuleBuilderTest.java +++ b/drools-core/src/test/java/org/drools/core/reteoo/builder/ReteooRuleBuilderTest.java @@ -24,16 +24,16 @@ import java.util.Collections; import java.util.List; -import org.drools.base.base.ValueResolver; import org.drools.base.base.ClassObjectType; +import org.drools.base.base.ValueResolver; import org.drools.base.definitions.rule.impl.RuleImpl; -import org.drools.core.impl.KnowledgeBaseImpl; -import org.drools.core.impl.RuleBaseFactory; -import org.drools.core.reteoo.RuleTerminalNode; import org.drools.base.rule.GroupElement; import org.drools.base.rule.GroupElementFactory; import org.drools.base.rule.Pattern; import org.drools.base.rule.consequence.Consequence; +import org.drools.core.impl.KnowledgeBaseImpl; +import org.drools.core.impl.RuleBaseFactory; +import org.drools.core.reteoo.RuleTerminalNode; import org.drools.core.rule.consequence.KnowledgeHelper; import org.junit.Before; import org.junit.Test; diff --git a/drools-core/src/test/java/org/drools/core/test/model/Address.java b/drools-core/src/test/java/org/drools/core/test/model/Address.java index 4a19ffeac73..44b8b86f8e5 100644 --- a/drools-core/src/test/java/org/drools/core/test/model/Address.java +++ b/drools-core/src/test/java/org/drools/core/test/model/Address.java @@ -65,19 +65,37 @@ public int hashCode() { } public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } Address other = (Address) obj; if ( number == null ) { - if ( other.number != null ) return false; - } else if ( !number.equals( other.number ) ) return false; + if ( other.number != null ) { + return false; + } + } else if ( !number.equals( other.number ) ) { + return false; + } if ( phone == null ) { - if ( other.phone != null ) return false; - } else if ( !phone.equals( other.phone ) ) return false; + if ( other.phone != null ) { + return false; + } + } else if ( !phone.equals( other.phone ) ) { + return false; + } if ( street == null ) { - if ( other.street != null ) return false; - } else if ( !street.equals( other.street ) ) return false; + if ( other.street != null ) { + return false; + } + } else if ( !street.equals( other.street ) ) { + return false; + } return true; } diff --git a/drools-core/src/test/java/org/drools/core/test/model/Person.java b/drools-core/src/test/java/org/drools/core/test/model/Person.java index c6d9a0bc479..17eb6175583 100755 --- a/drools-core/src/test/java/org/drools/core/test/model/Person.java +++ b/drools-core/src/test/java/org/drools/core/test/model/Person.java @@ -169,34 +169,72 @@ public int hashCode() { } public boolean equals(Object obj) { - if ( this == obj ) return true; - if ( obj == null ) return false; - if ( getClass() != obj.getClass() ) return false; + if ( this == obj ) { + return true; + } + if ( obj == null ) { + return false; + } + if ( getClass() != obj.getClass() ) { + return false; + } Person other = (Person) obj; if ( !Arrays.equals( addressArray, - other.addressArray ) ) return false; + other.addressArray ) ) { + return false; + } if ( addressList == null ) { - if ( other.addressList != null ) return false; - } else if ( !addressList.equals( other.addressList ) ) return false; + if ( other.addressList != null ) { + return false; + } + } else if ( !addressList.equals( other.addressList ) ) { + return false; + } if ( addresses == null ) { - if ( other.addresses != null ) return false; - } else if ( !addresses.equals( other.addresses ) ) return false; - if ( age != other.age ) return false; + if ( other.addresses != null ) { + return false; + } + } else if ( !addresses.equals( other.addresses ) ) { + return false; + } + if ( age != other.age ) { + return false; + } if ( city == null ) { - if ( other.city != null ) return false; - } else if ( !city.equals( other.city ) ) return false; + if ( other.city != null ) { + return false; + } + } else if ( !city.equals( other.city ) ) { + return false; + } if ( country == null ) { - if ( other.country != null ) return false; - } else if ( !country.equals( other.country ) ) return false; + if ( other.country != null ) { + return false; + } + } else if ( !country.equals( other.country ) ) { + return false; + } if ( name == null ) { - if ( other.name != null ) return false; - } else if ( !name.equals( other.name ) ) return false; + if ( other.name != null ) { + return false; + } + } else if ( !name.equals( other.name ) ) { + return false; + } if ( state == null ) { - if ( other.state != null ) return false; - } else if ( !state.equals( other.state ) ) return false; + if ( other.state != null ) { + return false; + } + } else if ( !state.equals( other.state ) ) { + return false; + } if ( street == null ) { - if ( other.street != null ) return false; - } else if ( !street.equals( other.street ) ) return false; + if ( other.street != null ) { + return false; + } + } else if ( !street.equals( other.street ) ) { + return false; + } return true; } diff --git a/drools-core/src/test/java/org/drools/core/time/impl/CompositeMaxDurationTimerTest.java b/drools-core/src/test/java/org/drools/core/time/impl/CompositeMaxDurationTimerTest.java index abd10b08591..e8e44f66469 100644 --- a/drools-core/src/test/java/org/drools/core/time/impl/CompositeMaxDurationTimerTest.java +++ b/drools-core/src/test/java/org/drools/core/time/impl/CompositeMaxDurationTimerTest.java @@ -18,11 +18,11 @@ */ package org.drools.core.time.impl; +import java.util.Date; + import org.drools.base.time.Trigger; import org.junit.Test; -import java.util.Date; - import static org.assertj.core.api.Assertions.assertThat; public class CompositeMaxDurationTimerTest { diff --git a/drools-core/src/test/java/org/drools/core/time/impl/JDKTimerServiceTest.java b/drools-core/src/test/java/org/drools/core/time/impl/JDKTimerServiceTest.java index 763865ca668..66854a69c2a 100644 --- a/drools-core/src/test/java/org/drools/core/time/impl/JDKTimerServiceTest.java +++ b/drools-core/src/test/java/org/drools/core/time/impl/JDKTimerServiceTest.java @@ -29,6 +29,8 @@ import java.util.List; import java.util.Stack; +import org.drools.base.time.JobHandle; +import org.drools.base.time.Trigger; import org.drools.core.ClockType; import org.drools.core.SessionConfiguration; import org.drools.core.common.InternalWorkingMemory; @@ -37,9 +39,7 @@ import org.drools.core.phreak.PropagationEntry; import org.drools.core.time.Job; import org.drools.core.time.JobContext; -import org.drools.base.time.JobHandle; import org.drools.core.time.TimerService; -import org.drools.base.time.Trigger; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/time/impl/PseudoClockSchedulerTest.java b/drools-core/src/test/java/org/drools/core/time/impl/PseudoClockSchedulerTest.java index de6440b803c..4295f434578 100644 --- a/drools-core/src/test/java/org/drools/core/time/impl/PseudoClockSchedulerTest.java +++ b/drools-core/src/test/java/org/drools/core/time/impl/PseudoClockSchedulerTest.java @@ -22,10 +22,10 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; -import org.drools.core.time.Job; -import org.drools.core.time.JobContext; import org.drools.base.time.JobHandle; import org.drools.base.time.Trigger; +import org.drools.core.time.Job; +import org.drools.core.time.JobContext; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/drools-core/src/test/java/org/drools/core/util/BinaryHeapQueueTest.java b/drools-core/src/test/java/org/drools/core/util/BinaryHeapQueueTest.java index 58beab84933..ee0add11289 100644 --- a/drools-core/src/test/java/org/drools/core/util/BinaryHeapQueueTest.java +++ b/drools-core/src/test/java/org/drools/core/util/BinaryHeapQueueTest.java @@ -22,19 +22,19 @@ import java.util.Collection; import java.util.List; +import org.drools.base.definitions.rule.impl.RuleImpl; +import org.drools.base.rule.consequence.ConflictResolver; +import org.drools.base.rule.consequence.Consequence; import org.drools.core.common.ActivationGroupNode; import org.drools.core.common.ActivationNode; import org.drools.core.common.InternalAgendaGroup; import org.drools.core.common.InternalFactHandle; import org.drools.core.common.InternalRuleFlowGroup; import org.drools.core.common.PropagationContext; -import org.drools.base.definitions.rule.impl.RuleImpl; import org.drools.core.phreak.RuleAgendaItem; import org.drools.core.reteoo.TerminalNode; import org.drools.core.reteoo.Tuple; import org.drools.core.rule.consequence.InternalMatch; -import org.drools.base.rule.consequence.ConflictResolver; -import org.drools.base.rule.consequence.Consequence; import org.junit.Before; import org.junit.Test; import org.kie.api.runtime.rule.FactHandle; @@ -103,7 +103,9 @@ public void testShuffled() { for (int i = max - 1; i >= 0; i--) { int sal = group.getNext().getSalience(); sb.append(" ").append(sal); - if (sal != i) ok = false; + if (sal != i) { + ok = false; + } } assertThat(ok).as("incorrect order in " + sb.toString()).isTrue(); // System.out.println( sb.toString() ); @@ -182,7 +184,7 @@ public String toString() { return "AgendaGroup '" + this.name + "'"; } - public boolean equal(final Object object) { + public boolean equals(final Object object) { if (!(object instanceof Group)) { return false; } diff --git a/drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java b/drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java index 0bd85c5f409..2d6355704c5 100644 --- a/drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java +++ b/drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java @@ -202,8 +202,9 @@ public static Object streamIn(InputStream in, ClassLoader classLoader) */ public static Object streamIn(InputStream in, ClassLoader classLoader, boolean compressed) throws IOException, ClassNotFoundException { - if (compressed) + if (compressed) { in = new GZIPInputStream(in); + } return new DroolsObjectInputStream(in, classLoader).readObject(); } } diff --git a/drools-core/src/test/java/org/drools/core/util/HeapDump.java b/drools-core/src/test/java/org/drools/core/util/HeapDump.java index a2d176b698d..32dafc3bae5 100644 --- a/drools-core/src/test/java/org/drools/core/util/HeapDump.java +++ b/drools-core/src/test/java/org/drools/core/util/HeapDump.java @@ -18,10 +18,11 @@ */ package org.drools.core.util; -import javax.management.MBeanServer; import java.lang.management.ManagementFactory; import java.lang.reflect.Method; +import javax.management.MBeanServer; + @SuppressWarnings("restriction") public class HeapDump { diff --git a/drools-core/src/test/java/org/drools/core/util/IndexedHashtableIteratorTest.java b/drools-core/src/test/java/org/drools/core/util/IndexedHashtableIteratorTest.java index a0de58e3e4a..65d2f7851f5 100644 --- a/drools-core/src/test/java/org/drools/core/util/IndexedHashtableIteratorTest.java +++ b/drools-core/src/test/java/org/drools/core/util/IndexedHashtableIteratorTest.java @@ -18,6 +18,9 @@ */ package org.drools.core.util; +import java.util.ArrayList; +import java.util.List; + import org.drools.core.reteoo.AbstractTuple; import org.drools.core.reteoo.JoinNodeLeftTuple; import org.drools.core.reteoo.RightTuple; @@ -26,9 +29,6 @@ import org.drools.core.util.index.TupleList; import org.junit.Test; -import java.util.ArrayList; -import java.util.List; - import static org.assertj.core.api.Assertions.assertThat; public class IndexedHashtableIteratorTest { diff --git a/drools-core/src/test/java/org/drools/core/util/IoUtilsTest.java b/drools-core/src/test/java/org/drools/core/util/IoUtilsTest.java index c21a2287865..b04f5d28d39 100644 --- a/drools-core/src/test/java/org/drools/core/util/IoUtilsTest.java +++ b/drools-core/src/test/java/org/drools/core/util/IoUtilsTest.java @@ -18,13 +18,13 @@ */ package org.drools.core.util; +import java.io.IOException; +import java.io.StringReader; + import org.drools.io.ReaderInputStream; import org.drools.util.IoUtils; import org.junit.Test; -import java.io.IOException; -import java.io.StringReader; - import static org.assertj.core.api.Assertions.assertThat; public class IoUtilsTest { @@ -35,8 +35,8 @@ public void testReadEmptyStream() throws IOException { byte[] bytes = IoUtils.readBytesFromInputStream( new ReaderInputStream( new StringReader( "" ) ) ); assertThat(bytes).isEmpty(); } - - @Test + + @Test public void testAsSystemSpecificPath() { String urlPath = "c:\\workdir\\server-local\\instance\\tmp\\vfs\\deployment\\deploymentf7b5abe7c4c1cb56\\rules-with-kjar-1.0.jar-57cc270a5729d6b2\\rules-with-kjar-1.0.jar"; String specificPath = IoUtils.asSystemSpecificPath(urlPath, 1); diff --git a/drools-core/src/test/java/org/drools/core/util/KeyStoreHelperTest.java b/drools-core/src/test/java/org/drools/core/util/KeyStoreHelperTest.java index 3546ec82c06..aa8b95b33a7 100755 --- a/drools-core/src/test/java/org/drools/core/util/KeyStoreHelperTest.java +++ b/drools-core/src/test/java/org/drools/core/util/KeyStoreHelperTest.java @@ -30,6 +30,7 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.security.spec.InvalidKeySpecException; + import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; diff --git a/drools-core/src/test/java/org/drools/core/util/KieFunctionsTest.java b/drools-core/src/test/java/org/drools/core/util/KieFunctionsTest.java index ef24047e6b5..75a9a77207a 100644 --- a/drools-core/src/test/java/org/drools/core/util/KieFunctionsTest.java +++ b/drools-core/src/test/java/org/drools/core/util/KieFunctionsTest.java @@ -21,9 +21,10 @@ import java.math.BigDecimal; import java.math.BigInteger; -import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; + public class KieFunctionsTest { @Test diff --git a/drools-core/src/test/java/org/drools/core/util/LeftTupleRBTreeTest.java b/drools-core/src/test/java/org/drools/core/util/LeftTupleRBTreeTest.java index 06145713e91..0942747f4c9 100644 --- a/drools-core/src/test/java/org/drools/core/util/LeftTupleRBTreeTest.java +++ b/drools-core/src/test/java/org/drools/core/util/LeftTupleRBTreeTest.java @@ -18,11 +18,11 @@ */ package org.drools.core.util; +import java.util.Random; + import org.drools.core.util.TupleRBTree.Node; import org.junit.Test; -import java.util.Random; - import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; diff --git a/drools-core/src/test/java/org/drools/core/util/index/IndexUtilTest.java b/drools-core/src/test/java/org/drools/core/util/index/IndexUtilTest.java index 36f191f4705..61a6b336387 100644 --- a/drools-core/src/test/java/org/drools/core/util/index/IndexUtilTest.java +++ b/drools-core/src/test/java/org/drools/core/util/index/IndexUtilTest.java @@ -18,6 +18,11 @@ */ package org.drools.core.util.index; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.lang.reflect.Method; + import org.drools.base.base.ValueResolver; import org.drools.base.base.ValueType; import org.drools.base.reteoo.BaseTuple; @@ -44,11 +49,6 @@ import org.kie.internal.conf.IndexPrecedenceOption; import org.kie.internal.utils.ChainedProperties; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.lang.reflect.Method; - import static org.assertj.core.api.Assertions.assertThat; public class IndexUtilTest {