You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/09/17 03:56:12 UTC
[isis] branch master updated: ISIS-2428: batch rename
org.apache.isis.core.commons -> org.apache.isis.commons
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new 7ec5986 ISIS-2428: batch rename org.apache.isis.core.commons -> org.apache.isis.commons
7ec5986 is described below
commit 7ec5986b6d39dd423e9c5c59e733bf412b37ef91
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Sep 17 05:55:49 2020 +0200
ISIS-2428: batch rename org.apache.isis.core.commons ->
org.apache.isis.commons
---
.../examples/events/EventObjectBase.java | 4 +-
.../events/domain/AbstractDomainEvent.java | 2 +-
.../examples/graph/tree/LazyTreeNode.java | 4 +-
.../examples/graph/tree/TreeNode.java | 2 +-
.../examples/layout/grid/bootstrap3/BS3Col.java | 4 +-
.../layout/menubars/bootstrap3/BS3MenuBars.java | 2 +-
.../mixins/metamodel/Object_objectIdentifier.java | 2 +-
.../examples/spec/AbstractSpecification2.java | 2 +-
.../applib-classes/examples/util/Enums.java | 2 +-
.../applib-classes/examples/util/Equality.java | 4 +-
.../applib-classes/examples/util/Hashing.java | 2 +-
.../applib-classes/examples/util/JaxbAdapters.java | 4 +-
.../applib-classes/examples/util/JaxbUtil.java | 6 +-
.../examples/util/ObjectContract_Parser.java | 4 +-
.../examples/util/ObjectContracts.java | 4 +-
.../examples/util/ReasonBuffer2.java | 2 +-
.../applib-classes/examples/util/TitleBuffer.java | 2 +-
.../applib-classes/examples/util/ToString.java | 2 +-
.../applib-classes/examples/util/ZipWriter.java | 2 +-
.../examples/util/schema/ChangesDtoUtils.java | 2 +-
.../examples/util/schema/CommandDtoUtils.java | 2 +-
.../examples/util/schema/CommonDtoUtils.java | 12 +-
.../examples/util/schema/InteractionDtoUtils.java | 6 +-
.../util/schema/MemberExecutionDtoUtils.java | 2 +-
.../applib-classes/examples/value/Blob.java | 2 +-
.../applib-classes/examples/value/Clob.java | 2 +-
.../examples/value/NamedWithMimeType.java | 2 +-
.../services/appfeat/ApplicationMemberType.java | 2 +-
.../services/bookmark/BookmarkService.java | 4 +-
.../services/confview/ConfigurationProperty.java | 2 +-
.../services/conmap/ContentMappingService.java | 2 +-
.../exceprecog/ExceptionRecognizerAbstract.java | 4 +-
.../exceprecog/ExceptionRecognizerForType.java | 6 +-
.../exceprecog/ExceptionRecognizerService.java | 2 +-
.../examples/services/factory/FactoryService.java | 2 +-
.../examples/services/i18n/TranslatableString.java | 2 +-
.../examples/services/iactn/Interaction.java | 4 +-
.../jaxb/CatalogingSchemaOutputResolver.java | 6 +-
.../examples/services/jaxb/JaxbService.java | 6 +-
.../services/layout/LayoutServiceMenu.java | 2 +-
.../services/metamodel/MetaModelService.java | 2 +-
.../services/metamodel/MetaModelServiceMenu.java | 6 +-
.../services/registry/ServiceRegistry.java | 12 +-
.../examples/services/scratchpad/Scratchpad.java | 2 +-
.../services/urlencoding/UrlEncodingService.java | 4 +-
...rlEncodingServiceUsingBaseEncodingAbstract.java | 4 +-
.../examples/services/wrapper/WrapperFactory.java | 2 +-
.../examples/services/wrapper/WrappingObject.java | 2 +-
.../services/wrapper/control/ControlAbstract.java | 4 +-
.../services/wrapper/control/ExecutionMode.java | 2 +-
.../services/wrapper/control/SyncControl.java | 2 +-
.../java/org/apache/isis/applib/Identifier.java | 4 +-
.../isis/applib/NonRecoverableException.java | 4 +-
.../apache/isis/applib/RecoverableException.java | 4 +-
.../apache/isis/applib/client/SuppressionType.java | 4 +-
.../apache/isis/applib/events/EventObjectBase.java | 4 +-
.../applib/events/domain/AbstractDomainEvent.java | 2 +-
.../isis/applib/graph/tree/LazyTreeNode.java | 4 +-
.../apache/isis/applib/graph/tree/TreeNode.java | 2 +-
.../isis/applib/jaxb/PrimitiveJaxbAdapters.java | 4 +-
.../isis/applib/layout/grid/bootstrap3/BS3Col.java | 4 +-
.../layout/menubars/bootstrap3/BS3MenuBars.java | 2 +-
.../mixins/metamodel/Object_objectIdentifier.java | 2 +-
.../apache/isis/applib/query/QueryAbstract.java | 2 +-
.../services/appfeat/ApplicationMemberType.java | 2 +-
.../applib/services/bookmark/BookmarkService.java | 4 +-
.../services/confview/ConfigurationProperty.java | 2 +-
.../services/conmap/ContentMappingService.java | 2 +-
.../exceprecog/ExceptionRecognizerAbstract.java | 4 +-
.../exceprecog/ExceptionRecognizerForType.java | 6 +-
.../exceprecog/ExceptionRecognizerService.java | 2 +-
.../applib/services/factory/FactoryService.java | 2 +-
.../applib/services/i18n/TranslatableString.java | 2 +-
.../isis/applib/services/iactn/Interaction.java | 4 +-
.../jaxb/CatalogingSchemaOutputResolver.java | 6 +-
.../isis/applib/services/jaxb/JaxbService.java | 6 +-
.../applib/services/layout/LayoutServiceMenu.java | 2 +-
.../services/metamodel/MetaModelService.java | 2 +-
.../services/metamodel/MetaModelServiceMenu.java | 6 +-
.../applib/services/registry/ServiceRegistry.java | 12 +-
.../applib/services/scratchpad/Scratchpad.java | 2 +-
.../services/urlencoding/UrlEncodingService.java | 4 +-
...rlEncodingServiceUsingBaseEncodingAbstract.java | 4 +-
.../applib/services/wrapper/WrapperFactory.java | 2 +-
.../applib/services/wrapper/WrappingObject.java | 2 +-
.../services/wrapper/control/ControlAbstract.java | 4 +-
.../services/wrapper/control/ExecutionMode.java | 2 +-
.../services/wrapper/control/SyncControl.java | 2 +-
.../isis/applib/spec/AbstractSpecification2.java | 2 +-
.../java/org/apache/isis/applib/util/Enums.java | 2 +-
.../java/org/apache/isis/applib/util/Equality.java | 4 +-
.../java/org/apache/isis/applib/util/Hashing.java | 2 +-
.../java/org/apache/isis/applib/util/JaxbUtil.java | 6 +-
.../isis/applib/util/ObjectContract_Parser.java | 4 +-
.../apache/isis/applib/util/ObjectContracts.java | 4 +-
.../org/apache/isis/applib/util/ReasonBuffer2.java | 2 +-
.../org/apache/isis/applib/util/TitleBuffer.java | 2 +-
.../java/org/apache/isis/applib/util/ToString.java | 2 +-
.../org/apache/isis/applib/util/ZipWriter.java | 2 +-
.../isis/applib/util/schema/ChangesDtoUtils.java | 2 +-
.../isis/applib/util/schema/CommandDtoUtils.java | 2 +-
.../isis/applib/util/schema/CommonDtoUtils.java | 12 +-
.../applib/util/schema/InteractionDtoUtils.java | 6 +-
.../util/schema/MemberExecutionDtoUtils.java | 2 +-
.../java/org/apache/isis/applib/value/Blob.java | 2 +-
.../java/org/apache/isis/applib/value/Clob.java | 2 +-
.../java/org/apache/isis/applib/value/Markup.java | 2 +-
.../isis/applib/value/NamedWithMimeType.java | 2 +-
.../ObjectContractsTest_equals_and_hashCode.java | 2 +-
.../apache/isis/commons/IsisModuleCoreCommons.java | 32 +
.../org/apache/isis/commons/binding/Bindable.java | 36 ++
.../isis/commons/binding/ChangeListener.java | 28 +
.../isis/commons/binding/InvalidationListener.java | 28 +
.../apache/isis/commons/binding/Observable.java | 34 ++
.../org/apache/isis/commons/binding/Writable.java | 29 +
.../org/apache/isis/commons/collections/Can.java | 582 ++++++++++++++++++
.../apache/isis/commons/collections/CanVector.java | 104 ++++
.../apache/isis/commons/collections/Can_Empty.java | 175 ++++++
.../isis/commons/collections/Can_Multiple.java | 210 +++++++
.../isis/commons/collections/Can_Singleton.java | 200 +++++++
.../isis/commons/collections/Cardinality.java | 54 ++
.../isis/commons/collections/ImmutableEnumSet.java | 88 +++
.../isis/commons/concurrent/AwaitableLatch.java | 66 ++
.../isis/commons/exceptions/ExceptionUtils.java | 350 +++++++++++
.../exceptions/IsisApplicationException.java | 54 ++
.../isis/commons/exceptions/IsisException.java | 49 ++
.../exceptions/UnexpectedCallException.java | 33 +
.../commons/exceptions/UnknownTypeException.java | 33 +
.../isis/commons/exceptions/package-info.java | 25 +
.../commons/handler/ChainOfResponsibility.java | 81 +++
.../apache/isis/commons/internal/_Constants.java | 98 +++
.../isis/commons/internal/assertions/_Assert.java | 184 ++++++
.../isis/commons/internal/base/_Blackhole.java | 80 +++
.../apache/isis/commons/internal/base/_Bytes.java | 283 +++++++++
.../internal/base/_Bytes_GZipCompressor.java | 65 ++
.../internal/base/_Bytes_GZipCompressorSmart.java | 74 +++
.../apache/isis/commons/internal/base/_Casts.java | 150 +++++
.../apache/isis/commons/internal/base/_Either.java | 161 +++++
.../apache/isis/commons/internal/base/_Files.java | 125 ++++
.../apache/isis/commons/internal/base/_Lazy.java | 92 +++
.../isis/commons/internal/base/_Lazy_Simple.java | 71 +++
.../commons/internal/base/_Lazy_ThreadSafe.java | 79 +++
.../isis/commons/internal/base/_NullSafe.java | 332 +++++++++++
.../isis/commons/internal/base/_Oneshot.java | 64 ++
.../isis/commons/internal/base/_Reduction.java | 102 ++++
.../isis/commons/internal/base/_Strings.java | 664 +++++++++++++++++++++
.../commons/internal/base/_Strings_FastSplit.java | 66 ++
.../internal/base/_Strings_HtmlEscaper.java | 54 ++
.../internal/base/_Strings_KeyValuePair.java | 86 +++
.../internal/base/_Strings_NaturalNames.java | 91 +++
.../internal/base/_Strings_SplitIterator.java | 83 +++
.../apache/isis/commons/internal/base/_Timing.java | 147 +++++
.../apache/isis/commons/internal/base/_Tuples.java | 139 +++++
.../apache/isis/commons/internal/base/_With.java | 340 +++++++++++
.../isis/commons/internal/base/package-info.java | 28 +
.../binding/InternalBidirectionalBinding.java | 214 +++++++
.../commons/internal/binding/InternalUtil.java | 450 ++++++++++++++
.../internal/binding/_BindableAbstract.java | 174 ++++++
.../isis/commons/internal/binding/_Bindables.java | 47 ++
.../commons/internal/binding/_Observables.java | 64 ++
.../commons/internal/binding/package-info.java | 28 +
.../commons/internal/codec/_DocumentFactories.java | 67 +++
.../commons/internal/codec/_UrlDecoderUtil.java | 55 ++
.../isis/commons/internal/collections/_Arrays.java | 445 ++++++++++++++
.../internal/collections/_Arrays_Collector.java | 99 +++
.../collections/_Arrays_CollectorUnknownSize.java | 82 +++
.../commons/internal/collections/_Collections.java | 342 +++++++++++
.../collections/_Collections_Collector.java | 81 +++
.../collections/_Collections_SortedSetOfList.java | 152 +++++
.../isis/commons/internal/collections/_Inbox.java | 84 +++
.../isis/commons/internal/collections/_Lists.java | 199 ++++++
.../isis/commons/internal/collections/_Maps.java | 357 +++++++++++
.../commons/internal/collections/_Multimaps.java | 392 ++++++++++++
.../isis/commons/internal/collections/_Sets.java | 368 ++++++++++++
.../commons/internal/collections/_Streams.java | 105 ++++
.../commons/internal/collections/package-info.java | 28 +
.../collections/snapshot/_VersionedList.java | 217 +++++++
.../commons/internal/compare/_Comparators.java | 53 ++
.../compare/_Comparators_SequenceCompare.java | 114 ++++
.../commons/internal/compare/package-info.java | 28 +
.../internal/concurrent/_ConcurrentContext.java | 55 ++
.../internal/concurrent/_ConcurrentTask.java | 188 ++++++
.../internal/concurrent/_ConcurrentTaskList.java | 203 +++++++
.../commons/internal/concurrent/_ThreadSleep.java | 56 ++
.../isis/commons/internal/context/_Context.java | 374 ++++++++++++
.../internal/context/_Context_ThreadLocal.java | 151 +++++
.../isis/commons/internal/context/_Plugin.java | 187 ++++++
.../commons/internal/context/package-info.java | 28 +
.../apache/isis/commons/internal/debug/_Probe.java | 258 ++++++++
.../isis/commons/internal/debug/package-info.java | 28 +
.../internal/environment/DeploymentType.java | 39 ++
.../environment/IsisSystemEnvironment.java | 202 +++++++
.../commons/internal/exceptions/_Exceptions.java | 466 +++++++++++++++
.../commons/internal/exceptions/package-info.java | 28 +
.../factory/InstanceCreationClassException.java | 34 ++
.../factory/InstanceCreationException.java | 34 ++
.../commons/internal/factory/InstanceUtil.java | 174 ++++++
.../factory/UnavailableClassException.java | 42 ++
.../commons/internal/factory/package-info.java | 28 +
.../commons/internal/functions/_Functions.java | 210 +++++++
.../_Functions_IndexAwareFunctionAdapter.java | 44 ++
.../commons/internal/functions/_Predicates.java | 88 +++
.../commons/internal/functions/package-info.java | 28 +
.../apache/isis/commons/internal/hash/_Hashes.java | 92 +++
.../isis/commons/internal/ioc/IocContainer.java | 100 ++++
.../commons/internal/ioc/ManagedBeanAdapter.java | 34 ++
.../commons/internal/ioc/PriorityConstants.java | 53 ++
.../commons/internal/ioc/cdi/BeanAdapterCDI.java | 54 ++
.../isis/commons/internal/ioc/cdi/CdiPlugin.java | 52 ++
.../apache/isis/commons/internal/ioc/cdi/_CDI.java | 243 ++++++++
.../commons/internal/ioc/cdi/_CDI_Lifecycle.java | 44 ++
.../internal/ioc/spring/BeanAdapterSpring.java | 52 ++
.../commons/internal/ioc/spring/EventSpring.java | 75 +++
.../internal/ioc/spring/IocContainerSpring.java | 133 +++++
.../isis/commons/internal/ioc/spring/_Spring.java | 228 +++++++
.../isis/commons/internal/memento/_Mementos.java | 195 ++++++
.../internal/memento/_Mementos_MementoDefault.java | 132 ++++
.../commons/internal/memento/package-info.java | 28 +
.../apache/isis/commons/internal/package-info.java | 28 +
.../internal/plugins/PluginResolveException.java | 37 ++
.../internal/plugins/codegen/ProxyFactory.java | 77 +++
.../plugins/codegen/ProxyFactoryService.java | 46 ++
.../codegen/ProxyFactoryServiceAbstract.java | 66 ++
.../plugins/ioc/ConversationContextHandle.java | 30 +
.../plugins/ioc/ConversationContextService.java | 32 +
.../ioc/ConversationContextServiceDefault.java | 38 ++
.../isis/commons/internal/primitives/_Ints.java | 327 ++++++++++
.../isis/commons/internal/primitives/_Longs.java | 198 ++++++
.../commons/internal/reflection/_Annotations.java | 230 +++++++
.../internal/reflection/_AnnotationsLegacy.java | 360 +++++++++++
.../reflection/_Annotations_AttributeMethods.java | 314 ++++++++++
.../reflection/_Annotations_SyntCache.java | 78 +++
...nthesizedMergedAnnotationInvocationHandler.java | 235 ++++++++
.../commons/internal/reflection/_MethodCache.java | 106 ++++
.../isis/commons/internal/reflection/_Reflect.java | 564 +++++++++++++++++
.../commons/internal/reflection/package-info.java | 28 +
.../isis/commons/internal/resources/_Json.java | 360 +++++++++++
.../commons/internal/resources/_Resources.java | 157 +++++
.../commons/internal/resources/package-info.java | 28 +
.../isis/core/commons/IsisModuleCoreCommons.java | 32 -
.../apache/isis/core/commons/binding/Bindable.java | 36 --
.../isis/core/commons/binding/ChangeListener.java | 28 -
.../core/commons/binding/InvalidationListener.java | 28 -
.../isis/core/commons/binding/Observable.java | 34 --
.../apache/isis/core/commons/binding/Writable.java | 29 -
.../apache/isis/core/commons/collections/Can.java | 583 ------------------
.../isis/core/commons/collections/CanVector.java | 104 ----
.../isis/core/commons/collections/Can_Empty.java | 175 ------
.../core/commons/collections/Can_Multiple.java | 210 -------
.../core/commons/collections/Can_Singleton.java | 200 -------
.../isis/core/commons/collections/Cardinality.java | 54 --
.../core/commons/collections/ImmutableEnumSet.java | 88 ---
.../core/commons/concurrent/AwaitableLatch.java | 66 --
.../core/commons/exceptions/ExceptionUtils.java | 350 -----------
.../exceptions/IsisApplicationException.java | 54 --
.../core/commons/exceptions/IsisException.java | 49 --
.../exceptions/UnexpectedCallException.java | 33 -
.../commons/exceptions/UnknownTypeException.java | 33 -
.../isis/core/commons/exceptions/package-info.java | 25 -
.../commons/handler/ChainOfResponsibility.java | 81 ---
.../isis/core/commons/internal/_Constants.java | 98 ---
.../core/commons/internal/assertions/_Assert.java | 184 ------
.../core/commons/internal/base/_Blackhole.java | 80 ---
.../isis/core/commons/internal/base/_Bytes.java | 283 ---------
.../internal/base/_Bytes_GZipCompressor.java | 65 --
.../internal/base/_Bytes_GZipCompressorSmart.java | 74 ---
.../isis/core/commons/internal/base/_Casts.java | 150 -----
.../isis/core/commons/internal/base/_Either.java | 161 -----
.../isis/core/commons/internal/base/_Files.java | 125 ----
.../isis/core/commons/internal/base/_Lazy.java | 92 ---
.../core/commons/internal/base/_Lazy_Simple.java | 71 ---
.../commons/internal/base/_Lazy_ThreadSafe.java | 79 ---
.../isis/core/commons/internal/base/_NullSafe.java | 332 -----------
.../isis/core/commons/internal/base/_Oneshot.java | 64 --
.../core/commons/internal/base/_Reduction.java | 102 ----
.../isis/core/commons/internal/base/_Strings.java | 664 ---------------------
.../commons/internal/base/_Strings_FastSplit.java | 66 --
.../internal/base/_Strings_HtmlEscaper.java | 54 --
.../internal/base/_Strings_KeyValuePair.java | 86 ---
.../internal/base/_Strings_NaturalNames.java | 91 ---
.../internal/base/_Strings_SplitIterator.java | 83 ---
.../isis/core/commons/internal/base/_Timing.java | 147 -----
.../isis/core/commons/internal/base/_Tuples.java | 139 -----
.../isis/core/commons/internal/base/_With.java | 340 -----------
.../core/commons/internal/base/package-info.java | 28 -
.../binding/InternalBidirectionalBinding.java | 214 -------
.../commons/internal/binding/InternalUtil.java | 450 --------------
.../internal/binding/_BindableAbstract.java | 174 ------
.../core/commons/internal/binding/_Bindables.java | 47 --
.../commons/internal/binding/_Observables.java | 64 --
.../commons/internal/binding/package-info.java | 28 -
.../commons/internal/codec/_DocumentFactories.java | 67 ---
.../commons/internal/codec/_UrlDecoderUtil.java | 55 --
.../core/commons/internal/collections/_Arrays.java | 445 --------------
.../internal/collections/_Arrays_Collector.java | 99 ---
.../collections/_Arrays_CollectorUnknownSize.java | 82 ---
.../commons/internal/collections/_Collections.java | 342 -----------
.../collections/_Collections_Collector.java | 81 ---
.../collections/_Collections_SortedSetOfList.java | 152 -----
.../core/commons/internal/collections/_Inbox.java | 84 ---
.../core/commons/internal/collections/_Lists.java | 199 ------
.../core/commons/internal/collections/_Maps.java | 357 -----------
.../commons/internal/collections/_Multimaps.java | 392 ------------
.../core/commons/internal/collections/_Sets.java | 368 ------------
.../commons/internal/collections/_Streams.java | 105 ----
.../commons/internal/collections/package-info.java | 28 -
.../collections/snapshot/_VersionedList.java | 217 -------
.../commons/internal/compare/_Comparators.java | 53 --
.../compare/_Comparators_SequenceCompare.java | 114 ----
.../commons/internal/compare/package-info.java | 28 -
.../internal/concurrent/_ConcurrentContext.java | 55 --
.../internal/concurrent/_ConcurrentTask.java | 188 ------
.../internal/concurrent/_ConcurrentTaskList.java | 203 -------
.../commons/internal/concurrent/_ThreadSleep.java | 56 --
.../core/commons/internal/context/_Context.java | 374 ------------
.../internal/context/_Context_ThreadLocal.java | 151 -----
.../core/commons/internal/context/_Plugin.java | 187 ------
.../commons/internal/context/package-info.java | 28 -
.../isis/core/commons/internal/debug/_Probe.java | 258 --------
.../core/commons/internal/debug/package-info.java | 28 -
.../internal/environment/DeploymentType.java | 39 --
.../environment/IsisSystemEnvironment.java | 202 -------
.../commons/internal/exceptions/_Exceptions.java | 466 ---------------
.../commons/internal/exceptions/package-info.java | 28 -
.../factory/InstanceCreationClassException.java | 34 --
.../factory/InstanceCreationException.java | 34 --
.../commons/internal/factory/InstanceUtil.java | 174 ------
.../factory/UnavailableClassException.java | 42 --
.../commons/internal/factory/package-info.java | 28 -
.../commons/internal/functions/_Functions.java | 210 -------
.../_Functions_IndexAwareFunctionAdapter.java | 44 --
.../commons/internal/functions/_Predicates.java | 88 ---
.../commons/internal/functions/package-info.java | 28 -
.../isis/core/commons/internal/hash/_Hashes.java | 92 ---
.../core/commons/internal/ioc/IocContainer.java | 100 ----
.../commons/internal/ioc/ManagedBeanAdapter.java | 34 --
.../commons/internal/ioc/PriorityConstants.java | 53 --
.../commons/internal/ioc/cdi/BeanAdapterCDI.java | 54 --
.../core/commons/internal/ioc/cdi/CdiPlugin.java | 52 --
.../isis/core/commons/internal/ioc/cdi/_CDI.java | 243 --------
.../commons/internal/ioc/cdi/_CDI_Lifecycle.java | 44 --
.../internal/ioc/spring/BeanAdapterSpring.java | 52 --
.../commons/internal/ioc/spring/EventSpring.java | 75 ---
.../internal/ioc/spring/IocContainerSpring.java | 133 -----
.../core/commons/internal/ioc/spring/_Spring.java | 228 -------
.../core/commons/internal/memento/_Mementos.java | 195 ------
.../internal/memento/_Mementos_MementoDefault.java | 132 ----
.../commons/internal/memento/package-info.java | 28 -
.../isis/core/commons/internal/package-info.java | 28 -
.../internal/plugins/PluginResolveException.java | 37 --
.../internal/plugins/codegen/ProxyFactory.java | 77 ---
.../plugins/codegen/ProxyFactoryService.java | 46 --
.../codegen/ProxyFactoryServiceAbstract.java | 66 --
.../plugins/ioc/ConversationContextHandle.java | 30 -
.../plugins/ioc/ConversationContextService.java | 32 -
.../ioc/ConversationContextServiceDefault.java | 38 --
.../core/commons/internal/primitives/_Ints.java | 327 ----------
.../core/commons/internal/primitives/_Longs.java | 198 ------
.../commons/internal/reflection/_Annotations.java | 230 -------
.../internal/reflection/_AnnotationsLegacy.java | 360 -----------
.../reflection/_Annotations_AttributeMethods.java | 314 ----------
.../reflection/_Annotations_SyntCache.java | 78 ---
...nthesizedMergedAnnotationInvocationHandler.java | 235 --------
.../commons/internal/reflection/_MethodCache.java | 106 ----
.../core/commons/internal/reflection/_Reflect.java | 564 -----------------
.../commons/internal/reflection/package-info.java | 28 -
.../core/commons/internal/resources/_Json.java | 360 -----------
.../commons/internal/resources/_Resources.java | 157 -----
.../commons/internal/resources/package-info.java | 28 -
.../apache/isis/commons/SerializationTester.java | 86 +++
.../apache/isis/commons/collections/CanTest.java | 58 ++
.../isis/commons/collections/CanVectorTest.java | 54 ++
.../handlers/ChainOfResponsibilityTest.java | 121 ++++
.../isis/commons/internal/base/BytesTest.java | 204 +++++++
.../isis/commons/internal/base/NullSafeTest.java | 160 +++++
.../isis/commons/internal/base/ReductionTest.java | 75 +++
.../isis/commons/internal/base/StringsTest.java | 308 ++++++++++
.../commons/internal/binding/BindableTest.java | 238 ++++++++
.../apache/isis/commons/internal/cdi/CDITest.java | 128 ++++
.../internal/cdi/ValidQualifierForTesting.java | 35 ++
.../isis/commons/internal/collections/Samples.java | 86 +++
.../commons/internal/collections/_ArraysTest.java | 397 ++++++++++++
.../commons/internal/collections/_MapsTest.java | 128 ++++
.../commons/internal/collections/_SetsTest.java | 414 +++++++++++++
.../collections/snapshot/VersionedListTest.java | 71 +++
.../commons/internal/compare/ComparatorsTest.java | 158 +++++
.../concurrent/ConcurrentTaskListTest.java | 56 ++
.../isis/commons/internal/context/ContextTest.java | 241 ++++++++
.../isis/commons/internal/primitives/IntsTest.java | 108 ++++
.../commons/internal/resources/ResourcesTest.java | 68 +++
.../isis/commons/internal/strings/FormatTest.java | 84 +++
.../isis/core/commons/SerializationTester.java | 86 ---
.../isis/core/commons/collections/CanTest.java | 57 --
.../core/commons/collections/CanVectorTest.java | 52 --
.../handlers/ChainOfResponsibilityTest.java | 121 ----
.../isis/core/commons/internal/base/BytesTest.java | 202 -------
.../core/commons/internal/base/NullSafeTest.java | 157 -----
.../core/commons/internal/base/ReductionTest.java | 74 ---
.../core/commons/internal/base/StringsTest.java | 306 ----------
.../commons/internal/binding/BindableTest.java | 237 --------
.../isis/core/commons/internal/cdi/CDITest.java | 128 ----
.../internal/cdi/ValidQualifierForTesting.java | 35 --
.../core/commons/internal/collections/Samples.java | 86 ---
.../commons/internal/collections/_ArraysTest.java | 395 ------------
.../commons/internal/collections/_MapsTest.java | 127 ----
.../commons/internal/collections/_SetsTest.java | 410 -------------
.../collections/snapshot/VersionedListTest.java | 69 ---
.../commons/internal/compare/ComparatorsTest.java | 157 -----
.../concurrent/ConcurrentTaskListTest.java | 53 --
.../core/commons/internal/context/ContextTest.java | 239 --------
.../core/commons/internal/primitives/IntsTest.java | 106 ----
.../commons/internal/resources/ResourcesTest.java | 66 --
.../core/commons/internal/strings/FormatTest.java | 84 ---
.../bytebuddy/IsisModuleCoreCodegenByteBuddy.java | 2 +-
.../services/ProxyFactoryServiceByteBuddy.java | 14 +-
.../apache/isis/core/config/IsisConfiguration.java | 2 +-
.../isis/core/config/IsisModuleCoreConfig.java | 2 +-
.../core/config/beans/IsisBeanTypeClassifier.java | 4 +-
.../core/config/beans/IsisBeanTypeRegistry.java | 12 +-
.../isis/core/config/beans/TypeMetaData.java | 4 +-
.../core/config/converters/PatternsConverter.java | 4 +-
.../isis/core/config/messages/MessageRegistry.java | 2 +-
.../metamodel/specloader/IntrospectionMode.java | 4 +-
.../isis/core/config/presets/IsisPresets.java | 2 +-
.../isis/core/config/util/ValueMaskingUtil.java | 4 +-
.../config/viewer/wicket/WebAppContextPath.java | 4 +-
.../contract/ComparableContractTester.java | 2 +-
.../jmocking/ImposteriserUsingCodegenPlugin.java | 2 +-
.../jmocking/JUnitRuleMockery2.java | 10 +-
.../internaltestsupport/jmocking/MyMockomatic.java | 2 +-
.../_testing/MetaModelContext_forTesting.java | 8 +-
.../metamodel/_testing/ServiceInjectorLegacy.java | 12 +-
.../_testing/ServiceRegistry_forTesting.java | 18 +-
.../adapter/oid/ObjectPersistenceException.java | 2 +-
.../core/metamodel/adapter/oid/Oid_Marshaller.java | 12 +-
.../core/metamodel/adapter/oid/Oid_Parented.java | 2 +-
.../isis/core/metamodel/adapter/oid/Oid_Root.java | 4 +-
.../isis/core/metamodel/adapter/oid/RootOid.java | 2 +-
.../core/metamodel/commons/ArrayExtensions.java | 2 +-
.../metamodel/commons/CanonicalParameterUtil.java | 16 +-
.../core/metamodel/commons/ClassExtensions.java | 12 +-
.../isis/core/metamodel/commons/ClassUtil.java | 12 +-
.../core/metamodel/commons/ListExtensions.java | 6 +-
.../isis/core/metamodel/commons/LocaleUtil.java | 2 +-
.../isis/core/metamodel/commons/MethodUtil.java | 2 +-
.../core/metamodel/commons/ObjectExtensions.java | 2 +-
.../isis/core/metamodel/commons/ResourceUtil.java | 2 +-
.../core/metamodel/commons/StringExtensions.java | 4 +-
.../metamodel/commons/ThrowableExtensions.java | 2 +-
.../core/metamodel/consent/InteractionAdvisor.java | 2 +-
.../apache/isis/core/metamodel/consent/Veto.java | 2 +-
.../core/metamodel/context/MetaModelContext.java | 2 +-
.../context/MetaModelContext_usingIoc.java | 10 +-
.../core/metamodel/context/MetaModelContexts.java | 2 +-
.../metamodel/exceptions/MetaModelException.java | 2 +-
.../persistence/ObjectPersistenceException.java | 2 +-
.../core/metamodel/facetapi/FacetAbstract.java | 6 +-
.../isis/core/metamodel/facetapi/FacetHolder.java | 2 +-
.../core/metamodel/facetapi/FacetHolderImpl.java | 10 +-
.../isis/core/metamodel/facetapi/FeatureType.java | 2 +-
.../isis/core/metamodel/facets/ActionSupport.java | 4 +-
.../isis/core/metamodel/facets/Annotations.java | 8 +-
.../core/metamodel/facets/DomainEventHelper.java | 18 +-
.../isis/core/metamodel/facets/FacetFactory.java | 6 +-
.../metamodel/facets/FacetFactoryAbstract.java | 2 +-
.../isis/core/metamodel/facets/FacetedMethod.java | 2 +-
.../core/metamodel/facets/ImperativeFacet.java | 2 +-
.../isis/core/metamodel/facets/MethodFinder2.java | 4 +-
.../core/metamodel/facets/MethodFinderUtils.java | 10 +-
.../metamodel/facets/MethodLiteralConstants.java | 2 +-
.../facets/MethodPrefixBasedFacetFactory.java | 2 +-
.../MethodPrefixBasedFacetFactoryAbstract.java | 4 +-
.../facets/OrphanedSupportingMethodValidator.java | 6 +-
.../core/metamodel/facets/ParameterSupport.java | 4 +-
...rCollectionIdentifyingFacetFactoryAbstract.java | 6 +-
.../facets/actcoll/typeof/TypeOfFacet.java | 4 +-
.../action/ActionAnnotationFacetFactory.java | 4 +-
.../invocation/ActionDomainEventFacetAbstract.java | 4 +-
.../action/invocation/ActionInvocationFacet.java | 2 +-
...ctionInvocationFacetForDomainEventAbstract.java | 14 +-
.../actions/action/invocation/CommandUtil.java | 4 +-
.../PrototypeFacetForActionAnnotation.java | 2 +-
.../ActionDefaultsFacetViaMethodFactory.java | 2 +-
.../FileAcceptFacetForActionAnnotation.java | 2 +-
.../annotation/HomePageFacetAnnotationFactory.java | 4 +-
.../CssClassFaFacetForActionLayoutAnnotation.java | 2 +-
.../layout/CssClassFaFacetForActionXml.java | 2 +-
.../CssClassFacetForActionLayoutAnnotation.java | 2 +-
.../actions/layout/CssClassFacetForActionXml.java | 2 +-
.../DescribedAsFacetForActionLayoutAnnotation.java | 2 +-
.../layout/DescribedAsFacetForActionXml.java | 2 +-
.../NamedFacetForActionLayoutAnnotation.java | 2 +-
.../actions/layout/NamedFacetForActionXml.java | 2 +-
.../actions/prototype/PrototypeFacetAbstract.java | 2 +-
.../actions/validate/ActionValidationFacet.java | 2 +-
.../method/ActionValidationFacetViaMethod.java | 2 +-
.../ActionValidationFacetViaMethodFactory.java | 2 +-
.../facets/all/deficiencies/DeficiencyFacet.java | 4 +-
.../facets/all/i18n/TranslationFacetFactory.java | 2 +-
.../facets/collections/CollectionFacet.java | 13 +-
.../CollectionAccessorFacetViaAccessorFactory.java | 2 +-
.../clear/CollectionClearFacetFactory.java | 2 +-
.../CollectionAnnotationFacetFactory.java | 2 +-
...ectionAddToFacetForDomainEventFromAbstract.java | 2 +-
.../modify/CollectionDomainEventFacetAbstract.java | 2 +-
...nRemoveFromFacetForDomainEventFromAbstract.java | 4 +-
.../javautilcollection/CollectionFacetFactory.java | 4 +-
.../javautilcollection/JavaArrayFacet.java | 4 +-
.../javautilcollection/JavaCollectionFacet.java | 2 +-
...CssClassFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/CssClassFacetForCollectionXml.java | 2 +-
...aultViewFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/DefaultViewFacetForCollectionXml.java | 2 +-
...cribedAsFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/DescribedAsFacetForCollectionXml.java | 2 +-
.../NamedFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/NamedFacetForCollectionXml.java | 2 +-
...SortedByFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/SortedByFacetForCollectionXml.java | 2 +-
...tionAddToRemoveFromAndValidateFacetFactory.java | 2 +-
.../collparam/semantics/CollectionSemantics.java | 2 +-
.../facets/fallback/ActionChoicesFacetNone.java | 2 +-
.../metamodel/facets/jaxb/JaxbFacetFactory.java | 8 +-
.../facets/members/cssclassfa/CssClassFaFacet.java | 4 +-
.../cssclassfa/CssClassFaFacetAbstract.java | 10 +-
.../cssclassfa/annotprop/MixinInterceptor.java | 2 +-
.../disabled/DisabledFacetAbstractImpl.java | 2 +-
.../DisableForContextFacetViaMethodFactory.java | 2 +-
.../HiddenFacetFromLayoutPropertiesAbstract.java | 2 +-
.../HideForContextFacetViaMethodFactory.java | 2 +-
.../members/order/MemberOrderFacetAbstract.java | 2 +-
.../object/autocomplete/AutoCompleteFacet.java | 2 +-
.../autocomplete/AutoCompleteFacetAbstract.java | 2 +-
.../callbacks/CreatedCallbackFacetFactory.java | 2 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../object/callbacks/LoadCallbackFacetFactory.java | 4 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../callbacks/PersistCallbackFacetFactory.java | 4 +-
.../PersistCallbackViaSaveMethodFacetFactory.java | 4 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../callbacks/RemoveCallbackFacetFactory.java | 4 +-
.../RemoveCallbackViaDeleteMethodFacetFactory.java | 4 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../callbacks/UpdateCallbackFacetFactory.java | 4 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../callbacks/UpdatingCallbackFacetViaMethod.java | 2 +-
...fecycleEventFacetForDomainObjectAnnotation.java | 2 +-
.../choices/ChoicesFacetFromBoundedAbstract.java | 2 +-
.../object/choices/enums/ChoicesFacetEnum.java | 2 +-
...ingValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../method/CssClassFacetMethodFactory.java | 2 +-
...ssClassFaFacetForDomainObjectLayoutFactory.java | 2 +-
.../CssClassFaFacetForViewModelLayoutFactory.java | 2 +-
.../object/defaults/DefaultsProviderUtil.java | 2 +-
.../annotcfg/DefaultedFacetAnnotation.java | 2 +-
...tedFacetAnnotationElseConfigurationFactory.java | 2 +-
.../DisabledObjectFacetViaMethodFactory.java | 2 +-
.../DomainObjectAnnotationFacetFactory.java | 2 +-
.../AuditableFacetForDomainObjectAnnotation.java | 2 +-
.../ImmutableFacetForDomainObjectAnnotation.java | 4 +-
.../editing/ImmutableFacetFromConfiguration.java | 2 +-
...ObjectSpecIdFacetForDomainObjectAnnotation.java | 2 +-
...lassFaFacetForDomainObjectLayoutAnnotation.java | 2 +-
.../CssClassFaFacetForDomainObjectXml.java | 2 +-
...ssClassFaFacetForViewModelLayoutAnnotation.java | 2 +-
...sClassFacetForDomainObjectLayoutAnnotation.java | 2 +-
.../CssClassFacetForDomainObjectXml.java | 2 +-
.../CssClassFacetForViewModelLayoutAnnotation.java | 2 +-
...ObjectLayoutAnnotationUsingCssClassUiEvent.java | 2 +-
...wModelLayoutAnnotationUsingCssClassUiEvent.java | 2 +-
...ibedAsFacetForDomainObjectLayoutAnnotation.java | 2 +-
.../DescribedAsFacetForDomainObjectXml.java | 2 +-
...scribedAsFacetForViewModelLayoutAnnotation.java | 2 +-
.../DomainObjectLayoutFacetFactory.java | 2 +-
...mainObjectLayoutAnnotationUsingIconUiEvent.java | 2 +-
...aViewModelLayoutAnnotationUsingIconUiEvent.java | 2 +-
.../NamedFacetForDomainObjectLayoutAnnotation.java | 2 +-
.../NamedFacetForDomainObjectXml.java | 2 +-
.../NamedFacetForViewModelLayoutAnnotation.java | 2 +-
.../PluralFacetForDomainObjectXml.java | 2 +-
.../PluralFacetForViewModelLayoutAnnotation.java | 2 +-
...ainObjectLayoutAnnotationUsingTitleUiEvent.java | 2 +-
...ViewModelLayoutAnnotationUsingTitleUiEvent.java | 2 +-
.../DomainServiceLayoutFacetFactory.java | 2 +-
.../encoder/EncodableFacetUsingEncoderDecoder.java | 2 +-
.../facets/object/entity/EntityFacet.java | 2 +-
.../facets/object/facets/FacetsFacetAbstract.java | 4 +-
.../facets/object/grid/GridFacetFactory.java | 2 +-
.../method/HiddenObjectFacetViaMethodFactory.java | 2 +-
.../object/icon/method/IconFacetMethodFactory.java | 2 +-
.../RemoveAnnotatedMethodsFacetFactory.java | 6 +-
...oveDatanucleusPersistableTypesFacetFactory.java | 4 +-
.../ignore/javalang/RemoveMethodsFacetFactory.java | 4 +-
.../jdo/RemoveJdoEnhancementTypesFacetFactory.java | 4 +-
.../facets/object/layout/LayoutFacetFactory.java | 2 +-
.../mixin/MetaModelValidatorForMixinTypes.java | 4 +-
.../facets/object/mixin/MixinFacetAbstract.java | 4 +-
.../mixin/MixinFacetForDomainObjectAnnotation.java | 4 +-
.../object/mixin/MixinFacetForMixinAnnotation.java | 4 +-
.../NavigableParentAnnotationFacetFactory.java | 2 +-
.../method/NavigableParentFacetMethod.java | 2 +-
.../object/parseable/InvalidEntryException.java | 2 +-
.../facets/object/parseable/ParserUtil.java | 2 +-
.../object/parseable/TextEntryParseException.java | 2 +-
.../RecreatableObjectFacetAbstract.java | 2 +-
...ObjectFacetDeclarativeInitializingAbstract.java | 4 +-
.../recreatable/RecreatableObjectFacetFactory.java | 2 +-
.../annotation/TitleAnnotationFacetFactory.java | 4 +-
.../annotation/TitleFacetViaTitleAnnotation.java | 4 +-
.../title/methods/TitleFacetViaMethodsFactory.java | 4 +-
.../object/title/parser/TitleFacetUsingParser.java | 2 +-
.../method/ValidateObjectFacetMethodFactory.java | 2 +-
.../value/annotcfg/ValueFacetAnnotation.java | 2 +-
...ValueFacetAnnotationOrConfigurationFactory.java | 2 +-
.../ValueSemanticsProviderAndFacetAbstract.java | 4 +-
.../value/vsp/ValueSemanticsProviderUtil.java | 4 +-
.../facets/objectvalue/choices/ChoicesFacet.java | 2 +-
.../mandatory/MandatoryFacetAbstract.java | 2 +-
.../objectvalue/typicallen/TypicalLengthFacet.java | 4 +-
.../ActionParameterAutoCompleteFacet.java | 2 +-
.../ActionParameterAutoCompleteFacetViaMethod.java | 2 +-
...ParameterAutoCompleteFacetViaMethodFactory.java | 2 +-
.../facets/param/choices/ActionChoicesFacet.java | 2 +-
.../param/choices/ActionParameterChoicesFacet.java | 2 +-
.../choices/ActionParameterChoicesFacetNone.java | 2 +-
...rameterChoicesFacetDerivedFromChoicesFacet.java | 2 +-
.../method/ActionChoicesFacetViaMethod.java | 4 +-
.../method/ActionChoicesFacetViaMethodFactory.java | 2 +-
.../ActionParameterChoicesFacetViaMethod.java | 2 +-
...ctionParameterChoicesFacetViaMethodFactory.java | 2 +-
...tionParameterDefaultsFacetViaMethodFactory.java | 2 +-
.../disable/ActionParameterDisabledFacet.java | 2 +-
.../ActionParameterDisabledFacetViaMethod.java | 2 +-
...tionParameterDisabledFacetViaMethodFactory.java | 2 +-
.../param/hide/ActionParameterHiddenFacet.java | 2 +-
.../ActionParameterHiddenFacetViaMethod.java | 2 +-
...ActionParameterHiddenFacetViaMethodFactory.java | 2 +-
.../CssClassFacetForParameterLayoutAnnotation.java | 2 +-
...scribedAsFacetForParameterLayoutAnnotation.java | 2 +-
.../NamedFacetForParameterLayoutAnnotation.java | 2 +-
.../FileAcceptFacetForParameterAnnotation.java | 2 +-
.../regex/RegExFacetForParameterAnnotation.java | 2 +-
.../RegExFacetForPatternAnnotationOnParameter.java | 2 +-
.../validate/ActionParameterValidationFacet.java | 2 +-
.../ActionParameterValidationFacetViaMethod.java | 2 +-
...onParameterValidationFacetViaMethodFactory.java | 2 +-
.../PropertyAccessorFacetViaAccessorFactory.java | 2 +-
.../PropertyAutoCompleteFacetMethodFactory.java | 2 +-
.../properties/choices/PropertyChoicesFacet.java | 2 +-
...ropertyChoicesFacetDerivedFromChoicesFacet.java | 2 +-
.../method/PropertyChoicesFacetViaMethod.java | 2 +-
.../PropertyChoicesFacetViaMethodFactory.java | 2 +-
.../method/PropertyDefaultFacetViaMethod.java | 2 +-
.../PropertyDefaultFacetViaMethodFactory.java | 2 +-
...isabledFacetOnPropertyDerivedFromImmutable.java | 2 +-
.../FileAcceptFacetForPropertyAnnotation.java | 2 +-
.../modify/PropertyDomainEventFacetAbstract.java | 2 +-
...tySetterOrClearFacetForDomainEventAbstract.java | 4 +-
.../RegExFacetForPatternAnnotationOnProperty.java | 2 +-
.../regex/RegExFacetForPropertyAnnotation.java | 2 +-
.../CssClassFacetForPropertyLayoutAnnotation.java | 2 +-
.../CssClassFacetForPropertyXml.java | 2 +-
...escribedAsFacetForPropertyLayoutAnnotation.java | 2 +-
.../DescribedAsFacetForPropertyXml.java | 2 +-
.../NamedFacetForPropertyLayoutAnnotation.java | 2 +-
.../propertylayout/NamedFacetForPropertyXml.java | 2 +-
.../update/PropertyModifyFacetFactory.java | 2 +-
.../update/PropertySetAndClearFacetFactory.java | 2 +-
.../PropertyValidateFacetViaMethodFactory.java | 2 +-
.../ValueSemanticsProviderAbstractTemporal.java | 2 +-
.../BigDecimalValueSemanticsProvider.java | 2 +-
.../value/blobs/BlobValueSemanticsProvider.java | 4 +-
.../BooleanValueSemanticsProviderAbstract.java | 2 +-
.../value/datejodalocal/JodaLocalDateUtil.java | 2 +-
.../JodaLocalDateValueSemanticsProvider.java | 4 +-
.../datesql/JavaSqlDateValueSemanticsProvider.java | 2 +-
.../JodaDateTimeValueSemanticsProvider.java | 2 +-
.../datetimejodalocal/JodaLocalDateTimeUtil.java | 2 +-
.../JodaLocalDateTimeValueSemanticsProvider.java | 4 +-
.../JavaUtilDateValueSemanticsProvider.java | 2 +-
.../image/ImageValueSemanticsProviderAbstract.java | 4 +-
.../facets/value/temporal/TemporalAdjust.java | 2 +-
.../TemporalValueSemanticsProviderAbstract.java | 8 +-
.../localdate/LocalDateValueSemanticsProvider.java | 2 +-
.../LocalDateTimeValueSemanticsProvider.java | 2 +-
.../localtime/LocalTimeValueSemanticsProvider.java | 2 +-
.../OffsetDateTimeValueSemanticsProvider.java | 2 +-
.../OffsetTimeValueSemanticsProvider.java | 2 +-
.../ZonedDateTimeValueSemanticsProvider.java | 2 +-
.../timesql/JavaSqlTimeValueSemanticsProvider.java | 2 +-
.../JavaSqlTimeStampValueSemanticsProvider.java | 2 +-
.../treenode/TreeNodeValueSemanticsProvider.java | 6 +-
.../metamodel/inspect/Object_inspectMetamodel.java | 2 +-
.../metamodel/inspect/model/FacetGroupNode.java | 2 +-
.../core/metamodel/inspect/model/FacetNode.java | 2 +-
.../isis/core/metamodel/inspect/model/MMNode.java | 2 +-
.../metamodel/inspect/model/MMTreeAdapter.java | 2 +-
.../core/metamodel/inspect/model/TypeNode.java | 2 +-
.../interactions/ActionArgUsabilityContext.java | 2 +-
.../interactions/ActionArgValidityContext.java | 2 +-
.../interactions/ActionArgVisibilityContext.java | 2 +-
.../interactions/ActionValidityContext.java | 2 +-
.../metamodel/interactions/InteractionHead.java | 2 +-
.../interactions/managed/ActionInteraction.java | 6 +-
.../managed/ActionInteractionHead.java | 2 +-
.../managed/CollectionInteraction.java | 2 +-
.../interactions/managed/ManagedAction.java | 8 +-
.../interactions/managed/ManagedFeature.java | 2 +-
.../interactions/managed/ManagedMember.java | 2 +-
.../interactions/managed/ManagedParameter.java | 2 +-
.../interactions/managed/ManagedProperty.java | 8 +-
.../interactions/managed/ManagedValue.java | 6 +-
.../interactions/managed/MemberInteraction.java | 4 +-
.../managed/ParameterNegotiationModel.java | 14 +-
.../interactions/managed/PropertyInteraction.java | 2 +-
.../managed/PropertyNegotiationModel.java | 14 +-
.../isis/core/metamodel/layout/DeweyOrderSet.java | 6 +-
.../core/metamodel/layout/LayoutFacetUtil.java | 2 +-
.../MemberOrderFacetComparator.java | 2 +-
.../metamodel/objectmanager/ObjectManager.java | 2 +-
.../objectmanager/create/ObjectCreator.java | 6 +-
.../create/ObjectCreator_builtinHandlers.java | 6 +-
.../objectmanager/detach/ObjectDetacher.java | 4 +-
.../detach/ObjectDetacher_builtinHandlers.java | 2 +-
.../objectmanager/identify/ObjectIdentifier.java | 6 +-
.../identify/ObjectIdentifier_builtinHandlers.java | 2 +-
.../metamodel/objectmanager/load/ObjectLoader.java | 6 +-
.../load/ObjectLoader_builtinHandlers.java | 6 +-
.../objectmanager/query/ObjectBulkLoader.java | 8 +-
.../query/ObjectBulkLoader_builtinHandlers.java | 4 +-
.../objectmanager/refresh/ObjectRefresher.java | 4 +-
.../refresh/ObjectRefresher_builtinHandlers.java | 2 +-
.../objectmanager/serialize/ObjectSerializer.java | 4 +-
.../ObjectSerializer_builtinHandlers.java | 6 +-
...arameterChoicesFacetFromParentedCollection.java | 2 +-
...meterDefaultsFacetFromAssociatedCollection.java | 2 +-
.../param/DeriveFacetsPostProcessor.java | 4 +-
.../core/metamodel/progmodel/ProgrammingModel.java | 2 +-
.../progmodel/ProgrammingModelAbstract.java | 8 +-
.../progmodel/ProgrammingModelInitFilter.java | 4 +-
.../isis/core/metamodel/services/ServiceUtil.java | 2 +-
.../services/appfeat/ApplicationFeature.java | 2 +-
.../services/appfeat/ApplicationFeatureId.java | 4 +-
.../ApplicationFeatureRepositoryDefault.java | 6 +-
.../classsubstitutor/ClassSubstitutorAbstract.java | 6 +-
.../classsubstitutor/ClassSubstitutorDefault.java | 2 +-
.../classsubstitutor/ClassSubstitutorRegistry.java | 4 +-
.../command/CommandDtoServiceInternal.java | 2 +-
.../events/MetamodelEventSupport_Spring.java | 2 +-
.../services/grid/GridLoaderServiceDefault.java | 8 +-
.../services/grid/GridReaderUsingJaxb.java | 4 +-
.../services/grid/GridServiceDefault.java | 6 +-
.../services/grid/GridSystemServiceAbstract.java | 6 +-
.../services/grid/bootstrap3/GridModel.java | 4 +-
.../grid/bootstrap3/GridSystemServiceBS3.java | 14 +-
.../ixn/InteractionDtoServiceInternal.java | 2 +-
.../services/layout/LayoutServiceDefault.java | 4 +-
.../services/metamodel/DomainMemberDefault.java | 6 +-
.../services/metamodel/DomainModelDefault.java | 2 +-
.../services/metamodel/MetaModelExporter.java | 6 +-
.../metamodel/MetaModelServiceDefault.java | 2 +-
.../services/registry/ServiceRegistryDefault.java | 14 +-
.../title/TitlesAndTranslationsValidator.java | 2 +-
.../isis/core/metamodel/spec/ActionType.java | 2 +-
.../core/metamodel/spec/DomainModelException.java | 2 +-
.../isis/core/metamodel/spec/ManagedObject.java | 4 +-
.../metamodel/spec/ManagedObjectInternalUtil.java | 2 +-
.../isis/core/metamodel/spec/ManagedObjects.java | 16 +-
.../isis/core/metamodel/spec/ObjectSpecId.java | 2 +-
.../core/metamodel/spec/ObjectSpecification.java | 8 +-
.../core/metamodel/spec/feature/ObjectAction.java | 12 +-
.../spec/feature/ObjectActionContainer.java | 8 +-
.../spec/feature/ObjectActionParameter.java | 2 +-
.../metamodel/spec/feature/ObjectAssociation.java | 8 +-
.../spec/feature/ObjectAssociationContainer.java | 2 +-
.../core/metamodel/spec/feature/ObjectMember.java | 4 +-
.../core/metamodel/specloader/CollectionUtils.java | 4 +-
.../specloader/ProgrammingModelServiceDefault.java | 2 +-
.../specloader/ReflectiveActionException.java | 2 +-
.../specloader/SpecificationCacheDefault.java | 4 +-
.../specloader/SpecificationLoaderDefault.java | 16 +-
.../specloader/facetprocessor/FacetProcessor.java | 12 +-
.../specloader/specimpl/FacetedMethodsBuilder.java | 8 +-
.../specloader/specimpl/ObjectActionDefault.java | 10 +-
.../specloader/specimpl/ObjectActionMixedIn.java | 8 +-
.../specimpl/ObjectActionParameterAbstract.java | 6 +-
.../specimpl/ObjectSpecificationAbstract.java | 20 +-
.../specimpl/OneToManyAssociationDefault.java | 2 +-
.../specimpl/OneToManyAssociationMixedIn.java | 4 +-
.../specimpl/OneToOneAssociationDefault.java | 4 +-
.../specimpl/OneToOneAssociationMixedIn.java | 4 +-
.../core/metamodel/specloader/specimpl/Utils.java | 4 +-
.../specimpl/dflt/ObjectSpecificationDefault.java | 8 +-
.../validator/MetaModelInvalidException.java | 2 +-
.../specloader/validator/ValidationFailures.java | 4 +-
.../core/metamodel/util/DeweyOrderComparator.java | 2 +-
.../core/metamodel/util/snapshot/XmlSnapshot.java | 6 +-
.../valuetypes/ValueTypeProviderForBuiltin.java | 2 +-
.../ValueTypeProviderForCollections.java | 2 +-
.../metamodel/commons/ListUtilsTest_insert.java | 2 +-
.../facets/AbstractFacetFactoryJUnit4TestCase.java | 2 +-
.../metamodel/facets/AbstractFacetFactoryTest.java | 2 +-
.../Annotations_getAnnotations_on_Class_Test.java | 2 +-
.../Annotations_getAnnotations_on_Field_Test.java | 2 +-
.../Annotations_getAnnotations_on_Method_Test.java | 2 +-
...notations_getAnnotations_on_Parameter_Test.java | 2 +-
.../metamodel/facets/CollectionFacetUtilsTest.java | 2 +-
.../metamodel/facets/MethodFinderUtilsTest.java | 2 +-
.../apache/isis/core/metamodel/facets/Utils.java | 4 +-
...ctionAnnotationFacetFactoryTest_Publishing.java | 2 +-
.../prototype/PrototypeFacetAbstractTest.java | 2 +-
...etForCollectionLayoutAnnotationFactoryTest.java | 2 +-
.../facets/FacetsFacetAnnotationFactoryTest.java | 2 +-
.../TitleFacetViaTitleAnnotationTest.java | 2 +-
.../NavigableParentAnnotationFacetFactoryTest.java | 2 +-
.../ordering/memberorder/DeweyOrderSetTest.java | 4 +-
.../memberorder/MemberOrderComparatorTest.java | 2 +-
.../facets/param/name/ParameterNameFacetTest.java | 2 +-
...jectAssociationPredicatesTest_visibleWhere.java | 2 +-
.../interactions/InteractionUtils_isA_Test.java | 2 +-
...erviceInjectorDefaultTest_validateServices.java | 2 +-
.../ApplicationFeatureRepositoryDefaultTest.java | 2 +-
.../core/metamodel/services/grid/BS3GridTest.java | 4 +-
.../services/menubars/BS3MenuBarsTest.java | 2 +-
.../metamodel/MetaModelServiceDefaultTest.java | 6 +-
.../ClassSubstitutorTest_getClass.java | 2 +-
...ionParameterAbstractTest_getId_and_getName.java | 4 +-
.../specimpl/ObjectAssociationAbstractTest.java | 2 +-
...ObjectAssociationAbstractTest_alwaysHidden.java | 2 +-
.../testspec/ObjectSpecificationStub.java | 4 +-
.../isis/core/runtime/context/IsisContext.java | 2 +-
.../runtime/context/memento/ObjectMemento.java | 4 +-
.../context/memento/ObjectMementoCollection.java | 2 +-
.../isis/core/runtime/iactn/IsisInteraction.java | 4 +-
.../runtime/iactn/scope/IsisInteractionScope.java | 6 +-
...isInteractionScopeBeanFactoryPostProcessor.java | 2 +-
.../transaction/AuditerDispatchService.java | 2 +-
.../transaction/ChangedObjectsService.java | 4 +-
.../transaction/IsisTransactionAspectSupport.java | 4 +-
.../transaction/IsisTransactionFlushException.java | 2 +-
.../IsisTransactionManagerException.java | 2 +-
.../runtimeservices/InitialisationException.java | 2 +-
.../core/runtimeservices/ServiceException.java | 2 +-
.../background/BackgroundCommandExecution.java | 2 +-
.../bookmarks/BookmarkServiceDefault.java | 8 +-
.../command/CommandDtoServiceInternalDefault.java | 2 +-
.../command/CommandExecutorServiceDefault.java | 6 +-
.../confmenu/ConfigurationViewServiceDefault.java | 8 +-
.../runtimeservices/email/EmailServiceDefault.java | 2 +-
.../core/runtimeservices/error/EmailTicket.java | 2 +-
.../core/runtimeservices/error/SimpleTicket.java | 4 +-
.../ExceptionRecognizerServiceDefault.java | 6 +-
.../factory/FactoryServiceDefault.java | 14 +-
.../homepage/HomePageResolverServiceDefault.java | 2 +-
.../isis/core/runtimeservices/i18n/po/Block.java | 2 +-
.../core/runtimeservices/i18n/po/PoReader.java | 10 +-
.../core/runtimeservices/i18n/po/PoWriter.java | 4 +-
.../i18n/po/TranslationServicePo.java | 6 +-
.../ixn/InteractionDtoServiceInternalDefault.java | 6 +-
.../menubars/MenuBarsLoaderServiceDefault.java | 4 +-
.../menubars/bootstrap3/MenuBarsServiceBS3.java | 12 +-
.../publish/PublishedObjectsDefault.java | 8 +-
.../publish/PublisherDispatchServiceDefault.java | 2 +-
.../QueryResultsCacheDefault.java | 6 +-
.../repository/RepositoryServiceDefault.java | 4 +-
.../scratchpad/ScratchpadDefault.java | 2 +-
.../session/IsisInteractionFactoryDefault.java | 10 +-
.../UrlEncodingServiceWithCompression.java | 4 +-
.../runtimeservices/user/UserServiceDefault.java | 4 +-
.../userreg/EmailNotificationServiceDefault.java | 2 +-
.../wrapper/WrapperFactoryDefault.java | 10 +-
.../InteractionEventDispatcherTypeSafe.java | 2 +-
.../AbstractCollectionInvocationHandler.java | 2 +-
.../DelegatingInvocationHandlerDefault.java | 2 +-
.../handlers/DomainObjectInvocationHandler.java | 10 +-
.../wrapper/proxy/ProxyCreator.java | 8 +-
.../xactn/TransactionServiceSpring.java | 2 +-
.../runtimeservices/xml/XmlServiceDefault.java | 4 +-
.../xmlsnapshot/XmlSnapshotBuilder.java | 2 +-
.../commons/internal/reflection/ReflectTest.java | 12 +-
.../email/EmailServiceDefaultTest_actually.java | 2 +-
.../core/runtimeservices/i18n/po/PoReaderTest.java | 4 +-
.../runtimeservices/urlencoding/MementosTest.java | 8 +-
.../wrapper/WrapperFactoryDefaultTest.java | 4 +-
.../WrapperFactoryDefault_wrappedObject_Test.java | 2 +-
...actoryDefault_wrappedObject_transient_Test.java | 2 +-
.../XmlSnapshotServiceDefault_Test.java | 2 +-
.../authentication/AuthenticationRequest.java | 2 +-
.../AuthenticationRequestAbstract.java | 4 +-
.../authentication/AuthenticationSession.java | 2 +-
.../AuthenticationSessionAbstract.java | 8 +-
.../AuthenticationSessionTracker.java | 4 +-
.../security/authentication/MessageBroker.java | 2 +-
.../AuthenticationRequestLogonFixture.java | 2 +-
.../security/authentication/logout/LogoutMenu.java | 2 +-
.../manager/AuthenticationManager.java | 6 +-
.../standard/NoAuthenticatorException.java | 2 +-
.../authentication/standard/SimpleSession.java | 2 +-
.../apache/isis/core/webapp/modules/WebModule.java | 2 +-
.../core/webapp/modules/WebModuleAbstract.java | 2 +-
.../isis/core/webapp/modules/WebModuleContext.java | 4 +-
.../modules/logonlog/IsisLogOnExceptionFilter.java | 2 +-
.../logonlog/WebModuleLogOnExceptionLogger.java | 2 +-
.../TemplateResourceCachingFilter.java | 2 +-
.../templresources/TemplateResourceServlet.java | 8 +-
...plateResourceServlet_HtmlTemplateVariables.java | 6 +-
.../templresources/WebModuleTemplateResources.java | 2 +-
.../webappctx/IsisWebAppContextInitializer.java | 4 +-
.../demoapp/dom/_infra/DefaultTitleProvider.java | 2 +-
.../dom/_infra/LibraryPreloadingService.java | 4 +-
.../resources/MarkupVariableResolverService.java | 2 +-
.../UrlEncodingServiceNaiveInMemory.java | 12 +-
.../java/demoapp/dom/actions/async/DemoTask.java | 2 +-
.../DependentArgsActionDemo_bulkAction.java | 4 +-
.../types/isis/blobs/samples/IsisBlobsSamples.java | 4 +-
.../types/isis/clobs/samples/IsisClobsSamples.java | 4 +-
.../images/samples/JavaAwtImagesSamples.java | 4 +-
.../types/tuple/ComplexNumberValueSemantics.java | 4 +-
.../main/java/demoapp/javafx/DemoAppJavaFx.java | 2 +-
.../java/demoapp/webapp/vaadin/DemoAppVaadin.java | 2 +-
.../SupportingMethodValidatorRefinerFactory.java | 6 +-
.../secman/api/SecurityModuleConfig.java | 2 +-
.../api/permission/ApplicationPermissionMode.java | 2 +-
.../api/permission/ApplicationPermissionRule.java | 2 +-
.../permission/ApplicationPermissionValueSet.java | 4 +-
.../PermissionsEvaluationServiceAbstract.java | 2 +-
...PermissionsEvaluationServiceVetoBeatsAllow.java | 2 +-
.../app/feature/ApplicationFeatureViewModel.java | 4 +-
.../app/feature/ApplicationFeatureViewModels.java | 2 +-
.../user/ApplicationUser_filterPermissions.java | 2 +-
.../app/user/ApplicationUser_permissions.java | 2 +-
.../model/app/user/UserPermissionViewModel.java | 4 +-
.../model/dom/role/ApplicationRole_addUser.java | 2 +-
.../dom/role/ApplicationRole_removePermission.java | 2 +-
.../role/ApplicationRole_removePermissions.java | 2 +-
.../dom/role/ApplicationRole_removeUsers.java | 2 +-
.../dom/tenancy/ApplicationTenancy_addUser.java | 2 +-
.../model/dom/user/ApplicationUser_addRole.java | 2 +-
.../dom/user/ApplicationUser_removeRoles.java | 2 +-
.../dom/user/ApplicationUser_updatePassword.java | 2 +-
.../jdo/dom/permission/ApplicationPermission.java | 4 +-
.../ApplicationPermissionRepository.java | 14 +-
.../jdo/dom/role/ApplicationRoleRepository.java | 4 +-
.../dom/tenancy/ApplicationTenancyRepository.java | 4 +-
.../secman/jdo/dom/user/ApplicationUser.java | 4 +-
.../jdo/dom/user/ApplicationUserRepository.java | 8 +-
.../secman/jdo/seed/SeedSecurityModuleService.java | 2 +-
.../AbstractRoleAndPermissionsFixtureScript.java | 2 +-
.../scripts/AbstractUserAndRolesFixtureScript.java | 4 +-
.../IsisModuleSecurityAdminRoleAndPermissions.java | 2 +-
...tyModuleAppUserRegistrationServiceAbstract.java | 2 +-
.../secman/shiro/AuthInfoForApplicationUser.java | 2 +-
.../shiro/IsisModuleExtSecmanShiroRealm.java | 2 +-
...lCollectionForApplicationUserOnSingleRealm.java | 2 +-
.../secman/shiro/PrincipalForApplicationUser.java | 2 +-
.../shirorealmldap/realm/impl/IsisLdapRealm.java | 6 +-
.../ui/components/ExcelFileModel.java | 2 +-
.../ui/components/ScalarPanelAbstractLegacy.java | 2 +-
.../jee_support/IsisCDIBeanScanInterceptor.java | 4 +-
.../viewer/javafx/model/binding/BindingsFx.java | 8 +-
.../javafx/ui/components/UiComponentFactoryFx.java | 6 +-
.../ui/components/collections/TableViewFx.java | 6 +-
.../viewer/javafx/ui/components/form/FormPane.java | 2 +-
.../ui/components/number/NumberFieldFactory.java | 2 +-
.../javafx/ui/components/object/ObjectViewFx.java | 2 +-
.../javafx/ui/components/panel/TitledPanel.java | 2 +-
.../ui/decorator/icon/IconServiceDefault.java | 2 +-
.../prototyping/PrototypingInfoPopupProvider.java | 4 +-
.../viewer/javafx/ui/main/UiActionHandlerFx.java | 2 +-
.../viewer/javafx/ui/main/UiBuilderFx.java | 2 +-
.../javafx/viewer/JavafxViewerApplication.java | 2 +-
.../viewer/vaadin/ui/binding/BindingsVaa.java | 10 +-
.../ui/components/UiComponentFactoryVaa.java | 4 +-
.../vaadin/ui/components/action/ActionDialog.java | 2 +-
.../ui/components/collection/TableViewVaa.java | 6 +-
.../vaadin/ui/components/object/ObjectViewVaa.java | 2 +-
.../ui/components/other/FallbackFieldFactory.java | 2 +-
.../components/temporal/TemporalFieldFactory.java | 2 +-
.../vaadin/ui/pages/main/UiActionHandlerVaa.java | 2 +-
.../viewer/vaadin/ui/util/LocalResourceUtil.java | 2 +-
.../isis/legacy/applib/DomainObjectContainer.java | 2 +-
.../commons/internal/encoding/FieldType.java | 2 +-
.../internal/threadpool/ThreadPoolSupport.java | 12 +-
.../internal/threadpool/ThreadPoolSupportTest.java | 2 +-
.../value/money/MoneyValueSemanticsProvider.java | 2 +-
.../isis/legacy/restclient/RestfulClient.java | 2 +-
.../isis/extensions/restclient/ResponseDigest.java | 8 +-
.../isis/extensions/restclient/RestfulClient.java | 6 +-
.../restclient/auth/BasicAuthFilter.java | 5 +-
.../restclient/log/RestfulLoggingFilter.java | 4 +-
.../applib/exceptions/NotPersistableException.java | 2 +-
.../exceptions/UnsupportedFindException.java | 2 +-
.../CreateSchemaObjectFromClassMetadata.java | 2 +-
.../PersistenceQueryFindAllInstancesProcessor.java | 2 +-
...sistenceQueryFindUsingApplibQueryProcessor.java | 6 +-
.../queries/PersistenceQueryProcessor.java | 2 +-
.../queries/PersistenceQueryProcessorAbstract.java | 6 +-
.../persistence/spi/JdoObjectIdDecoder.java | 4 +-
.../persistence/spi/JdoObjectIdEncoder.java | 2 +-
.../persistence/spi/JdoObjectIdSerializer.java | 8 +-
.../service/JdoPersistenceLifecycleService.java | 2 +-
.../entities/IsisBeanTypeClassifierForJdo.java | 2 +-
.../entities/JdoEntityTypeRegistry.java | 4 +-
.../exceprecog/JdoNestedExceptionResolver.java | 2 +-
.../datanucleus5/jdosupport/IsisJdoSupportDN5.java | 6 +-
.../mixins/Persistable_downloadJdoMetadata.java | 2 +-
.../datanucleus5/metamodel/JdoMetamodelUtil.java | 4 +-
.../metamodel/JdoProgrammingModelPlugin.java | 6 +-
.../JdoDiscriminatorAnnotationFacetFactory.java | 2 +-
...cIdFacetForJdoPersistenceCapableAnnotation.java | 2 +-
...doPersistenceCapableAnnotationFacetFactory.java | 4 +-
.../JdoPersistenceCapableFacetImpl.java | 4 +-
.../object/query/VisitorForClauseAbstract.java | 2 +-
...ndatoryFromJdoColumnAnnotationFacetFactory.java | 2 +-
.../objectadapter/ObjectAdapterContext.java | 4 +-
.../ObjectAdapterContext_Factories.java | 4 +-
...ObjectAdapterContext_LifecycleEventSupport.java | 2 +-
.../datanucleus5/objectadapter/PojoAdapter.java | 6 +-
.../DataNucleusApplicationComponents5.java | 11 +-
.../persistence/IsisLifecycleListener.java | 2 +-
.../persistence/IsisPersistenceSessionJdoBase.java | 2 +-
.../IsisPlatformTransactionManagerForJdo.java | 2 +-
.../persistence/IsisTransactionJdo.java | 8 +-
.../persistence/IsisTransactionManagerJdo.java | 4 +-
.../persistence/PersistenceSession.java | 2 +-
.../persistence/PersistenceSession5.java | 10 +-
.../persistence/PersistenceSessionFactory5.java | 8 +-
.../persistence/query/PersistenceQueryFactory.java | 2 +-
.../transaction/PojoAdapterBuilder.java | 2 +-
.../testing/AbstractFacetFactoryTest.java | 2 +-
.../jdo/datanucleus5/testing/Utils.java | 4 +-
.../jpa/metamodel/JpaEntityFacetFactory.java | 12 +-
.../testdomain/auditing/AuditerServiceTest.java | 2 +-
.../isis/testdomain/domainmodel/MetamodelUtil.java | 2 +-
.../domainmodel/SpecloaderPerformanceTest.java | 8 +-
.../isis/testdomain/shiro/AbstractShiroTest.java | 2 +-
.../testdomain/conf/Configuration_headless.java | 2 +-
.../org/apache/isis/testdomain/jdo/JdoBookDto.java | 4 +-
.../isis/testdomain/jdo/JdoInventoryResource.java | 4 +-
.../org/apache/isis/testdomain/jpa/JpaBookDto.java | 4 +-
.../isis/testdomain/jpa/JpaInventoryResource.java | 4 +-
.../testdomain/model/actnsemantics/BlobDemo.java | 4 +-
.../model/interaction/InteractionDemo.java | 2 +-
.../interaction/InteractionDemo_negotiate.java | 4 +-
.../isis/testdomain/util/kv/KVStoreForTesting.java | 4 +-
.../bootstrapping/AutoConfigurationTest.java | 2 +-
.../SpringServiceProvisioningTest.java | 12 +-
.../domainmodel/AnnotationSyntesizerTest.java | 2 +-
.../DomainModelTest_usingBadDomain.java | 2 +-
...nModelTest_usingBadDomain_noActionEnforced.java | 2 +-
.../eventhandling/SpringEventPublishingTest.java | 2 +-
.../injecting/JdoEntityInjectingTest.java | 6 +-
.../testdomain/interact/ActionInteractionTest.java | 2 +-
.../testdomain/interact/HasActionValidation.java | 4 +-
.../testdomain/interact/HasValueValidation.java | 4 +-
.../interact/InteractionTestAbstract.java | 6 +-
.../testdomain/interact/NewParameterModelTest.java | 2 +-
.../interact/SimulatedUiAutoComplete.java | 4 +-
.../testdomain/interact/SimulatedUiChoices.java | 6 +-
.../testdomain/interact/SimulatedUiComponent.java | 4 +-
.../testdomain/interact/SimulatedUiSubmit.java | 2 +-
.../testdomain/rest/DomainObjectResourceTest.java | 2 +-
.../isis/testdomain/rest/MenuBarsResourceTest.java | 2 +-
.../transactions/TransactionRollbackTest.java | 2 +-
.../keycloak/webmodule/WebModuleKeycloak.java | 2 +-
.../shiro/authentication/AuthenticatorShiro.java | 2 +-
.../shiro/authorization/IsisPermission.java | 4 +-
.../PermissionToRoleMapperFromString.java | 2 +-
.../isis/security/shiro/permrolemapper/Util.java | 4 +-
.../security/shiro/webmodule/WebModuleShiro.java | 6 +-
.../PermissionToRoleMapperFromIniTest.java | 2 +-
.../PermissionToRoleMapperFromStringTest.java | 2 +-
.../applib/testing/PrivateConstructorTester.java | 2 +-
.../subdomains/excel/applib/dom/ExcelService.java | 2 +-
.../excel/applib/dom/util/ExcelConverter.java | 2 +-
.../excel/applib/dom/util/ExcelServiceImpl.java | 2 +-
.../spring/applib/service/BeanDescriptor.java | 2 +-
.../applib/services/FakeDataServiceTest.java | 4 +-
.../fixturescripts/BuilderScriptAbstract.java | 2 +-
.../applib/fixturescripts/ExecutionParameters.java | 6 +-
.../applib/fixturescripts/FixtureResultList.java | 6 +-
.../applib/fixturescripts/FixtureScript.java | 12 +-
.../applib/fixturescripts/FixtureScripts.java | 4 +-
.../applib/services/FixturesLifecycleService.java | 4 +-
.../applib/setup/PersonaEnumPersistAll.java | 2 +-
.../applib/teardown/TeardownFixtureAbstract.java | 2 +-
.../h2console/ui/webmodule/WebModuleH2Console.java | 6 +-
.../hsqldbmgr/dom/services/HsqlDbManagerMenu.java | 4 +-
.../integtestsupport/applib/ThrowableMatchers.java | 2 +-
.../applib/validate/DomainModelValidator.java | 4 +-
.../integration/ObjectFactoryForIntegration.java | 2 +-
.../core/AbstractApplyToAllContractTest.java | 2 +-
...irectionalRelationshipContractTestAbstract.java | 10 +-
.../core/comparable/ComparableContractTester.java | 2 +-
.../unittestsupport/applib/core/files/Files.java | 2 +-
.../applib/core/jaxb/JaxbMatchers.java | 4 +-
.../jmocking/ImposteriserUsingCodegenPlugin.java | 2 +-
.../applib/core/jmocking/JUnitRuleMockery2.java | 8 +-
.../applib/core/jmocking/MyMockomatic.java | 2 +-
.../applib/core/soap/PublishedEndpoints.java | 4 +-
.../core/soap/SoapEndpointPublishingRule.java | 2 +-
.../sortedsets/SortedSetsContractTestAbstract.java | 6 +-
.../applib/core/utils/ReflectUtils.java | 2 +-
.../dom/privatecons/PrivateConstructorTester.java | 2 +-
.../applib/dom/reflect/ReflectUtils.java | 2 +-
.../BidirectionalRelationshipContractTestAll.java | 2 +-
.../core/comparable/CategorizedDomainObject.java | 2 +-
.../ImposteriserTestUsingCodegenPlugin_Test.java | 6 +-
.../tooling/javamodel/AnalyzerConfigFactory.java | 2 +-
.../isis/tooling/javamodel/test/AnalyzerTest.java | 2 +-
.../isis/tooling/model4adoc/AsciiDocWriter.java | 2 +-
.../model4adoc/ast/ContentNodeAbstract.java | 2 +-
.../tooling/projectmodel/ProjectNodeFactory.java | 2 +-
.../projectmodel/maven/SimpleModelResolver.java | 2 +-
.../asciidoc/applib/jaxb/AsciiDocJaxbAdapter.java | 2 +-
.../markdown/applib/jaxb/MarkdownJaxbAdapter.java | 2 +-
.../ui/wkt/components/MarkdownComponent.java | 2 +-
.../metamodel/facets/SseObserveFacetAbstract.java | 2 +-
.../markup/ListeningMarkupComponent_observing.java | 4 +-
.../sse/ui/wkt/services/SseServiceDefault.java | 2 +-
.../ui/wkt/webmodule/ServerSentEventsServlet.java | 8 +-
.../wkt/webmodule/WebModuleServerSentEvents.java | 2 +-
.../common/model/action/form/FormUiModel.java | 4 +-
.../common/model/binding/BindingConverter.java | 6 +-
.../binding/NumberConverterForStringComponent.java | 4 +-
.../TemporalConverterForLocalDateComponent.java | 4 +-
.../common/model/branding/BrandingUiModel.java | 2 +-
.../model/components/UiComponentFactory.java | 8 +-
.../viewer/common/model/debug/DebugUiModel.java | 2 +-
.../model/decorator/disable/DisablingUiModel.java | 2 +-
.../model/decorator/icon/FontAwesomeUiModel.java | 2 +-
.../common/model/feature/ParameterUiModel.java | 2 +-
.../common/model/feature/PropertyUiModel.java | 2 +-
.../viewer/common/model/feature/ScalarUiModel.java | 2 +-
.../common/model/gridlayout/UiGridLayout.java | 4 +-
.../isis/viewer/common/model/menu/MenuItemDto.java | 2 +-
.../model/menu/MenuUiModel_buildMenuItems.java | 2 +-
.../restfulobjects/applib/JsonRepresentation.java | 4 +-
.../restfulobjects/applib/RestfulResponse.java | 2 +-
.../restfulobjects/applib/util/MediaTypes.java | 2 +-
.../viewer/restfulobjects/applib/util/Parser.java | 8 +-
.../restfulobjects/applib/util/PathNode.java | 6 +-
.../applib/util/UrlEncodingUtils.java | 2 +-
.../viewer/restfulobjects/applib/JsonFixture.java | 2 +-
.../JsonRepresentationTest_asInputStream.java | 4 +-
.../webmodule/WebModuleJaxrsResteasy4.java | 2 +-
.../restfulobjects/rendering/LinkFollowSpecs.java | 2 +-
.../rendering/ReprRendererAbstract.java | 4 +-
.../AbstractObjectMemberReprRenderer.java | 2 +-
.../rendering/domainobjects/JsonValueEncoder.java | 8 +-
.../domainobjects/JsonValueEncoder_Converters.java | 2 +-
.../rendering/domainobjects/MemberType.java | 2 +-
.../domainobjects/ObjectActionReprRenderer.java | 4 +-
.../domainobjects/ObjectAndActionInvocation.java | 2 +-
.../ObjectCollectionReprRenderer.java | 2 +-
.../domainobjects/ObjectPropertyReprRenderer.java | 2 +-
.../AbstractTypeFeatureReprRenderer.java | 2 +-
.../domaintypes/DomainTypeReprRenderer.java | 2 +-
.../acceptheader/AcceptHeaderServiceForRest.java | 4 +-
.../conneg/ContentNegotiationServiceAbstract.java | 6 +-
.../service/swagger/SwaggerServiceDefault.java | 2 +-
.../service/swagger/SwaggerServiceMenu.java | 2 +-
.../swagger/internal/ClassExcluderAbstract.java | 2 +-
.../swagger/internal/ClassExcluderDefault.java | 2 +-
.../service/swagger/internal/Generation.java | 4 +-
.../rendering/service/swagger/internal/Util.java | 8 +-
.../internal/ValuePropertyFactoryDefault.java | 6 +-
.../swagger/internal/ValuePropertyPlugin.java | 2 +-
.../rendering/util/FollowSpecUtil.java | 2 +-
.../rendering/util/JsonWriterUtil.java | 2 +-
.../restfulobjects/rendering/util/MapUtils.java | 2 +-
.../viewer/restfulobjects/rendering/util/Util.java | 4 +-
..._ensureCompatibleAcceptHeader_ContractTest.java | 2 +-
.../viewer/context/ResourceContext.java | 6 +-
.../viewer/mappers/ExceptionMapperAbstract.java | 4 +-
.../viewer/mappers/entity/ExceptionDetail.java | 2 +-
.../resources/DomainObjectResourceServerside.java | 8 +-
.../viewer/resources/DomainResourceHelper.java | 2 +-
.../resources/DomainServiceResourceServerside.java | 2 +-
.../resources/DomainTypeResourceServerside.java | 2 +-
.../viewer/resources/ImageResourceServerside.java | 4 +-
.../viewer/resources/ObjectActionArgHelper.java | 6 +-
.../viewer/resources/ResourceAbstract.java | 2 +-
.../viewer/resources/VersionReprRenderer.java | 2 +-
.../serialization/SerializationStrategy.java | 2 +-
.../IsisRestfulObjectsInteractionFilter.java | 8 +-
.../AuthenticationSessionStrategyBasicAuth.java | 4 +-
.../context/ResourceContext_getArg_Test.java | 2 +-
.../viewer/wicket/model/links/LinkAndLabel.java | 6 +-
.../wicket/model/links/LinkAndLabelAbstract.java | 2 +-
.../wicket/model/links/ListOfLinksModel.java | 4 +-
.../wicket/model/mementos/PageParameterNames.java | 2 +-
.../wicket/model/models/ActionArgumentCache.java | 6 +-
.../viewer/wicket/model/models/ActionModel.java | 4 +-
.../wicket/model/models/BookmarkTreeNode.java | 4 +-
.../wicket/model/models/BookmarkedPagesModel.java | 2 +-
.../wicket/model/models/EntityCollectionModel.java | 12 +-
.../viewer/wicket/model/models/EntityModel.java | 4 +-
.../wicket/model/models/ManagedObjectModel.java | 4 +-
.../wicket/model/models/PageParameterUtil.java | 4 +-
.../viewer/wicket/model/models/ScalarModel.java | 6 +-
.../wicket/model/models/ScalarParameterModel.java | 2 +-
.../wicket/model/models/ScalarPropertyModel.java | 2 +-
.../model/models/ToggledMementosProvider.java | 2 +-
.../wicket/model/models/WicketComponentUtils.java | 2 +-
.../wicket/model/models/ActionModelTest.java | 2 +-
.../actionresponse/ActionResultResponseType.java | 2 +-
.../ui/app/registry/ComponentFactoryRegistrar.java | 2 +-
.../ui/components/about/JarManifestModel.java | 6 +-
.../entityactions/AdditionalLinksPanel.java | 2 +-
.../actionmenu/entityactions/LinkAndLabelUtil.java | 2 +-
.../actionmenu/serviceactions/CssMenuItem.java | 4 +-
.../actionmenu/serviceactions/MenuActionPanel.java | 2 +-
.../serviceactions/ServiceActionsPanel.java | 2 +-
.../serviceactions/ServiceActionsPanelFactory.java | 2 +-
.../serviceactions/TertiaryMenuPanelFactory.java | 2 +-
.../actionprompt/ActionPromptHeaderPanel.java | 2 +-
.../components/actions/ActionParametersForm.java | 4 +-
.../collection/AssociatedWithActionsHelper.java | 2 +-
.../ui/components/collection/CollectionPanel.java | 4 +-
.../selector/CollectionSelectorHelper.java | 2 +-
.../CollectionContentsAsAjaxTablePanel.java | 8 +-
.../CollectionContentsSortableDataProvider.java | 2 +-
.../ajaxtable/IsisAjaxFallbackHeadersToolbar.java | 2 +-
.../ajaxtable/PrototypingMessageProvider.java | 2 +-
.../columns/ObjectAdapterPropertyColumn.java | 2 +-
.../columns/ObjectAdapterToggleboxColumn.java | 2 +-
.../summary/CollectionContentsAsSummary.java | 2 +-
.../components/entity/fieldset/PropertyGroup.java | 6 +-
.../icontitle/EntityIconAndTitlePanelFactory.java | 2 +-
.../selector/links/EntityLinksSelectorPanel.java | 4 +-
.../wicket/ui/components/footer/FooterPanel.java | 2 +-
.../wicket/ui/components/layout/bs3/Util.java | 2 +-
.../wicket/ui/components/layout/bs3/col/Col.java | 4 +-
.../components/layout/bs3/tabs/TabGroupPanel.java | 2 +-
.../components/scalars/IsisConverterLocator.java | 4 +-
.../ui/components/scalars/ScalarPanelAbstract.java | 8 +-
.../scalars/ScalarPanelTextFieldAbstract.java | 2 +-
.../ScalarPanelTextFieldDatePickerAbstract.java | 2 +-
.../scalars/ScalarPanelTextFieldNumeric.java | 2 +-
.../ui/components/scalars/uuid/UuidConverter.java | 2 +-
.../valuechoices/ValueChoicesSelect2Panel.java | 4 +-
.../components/tree/IsisToWicketTreeAdapter.java | 6 +-
.../widgets/breadcrumbs/BreadcrumbModel.java | 4 +-
.../widgets/breadcrumbs/BreadcrumbPanel.java | 2 +-
.../widgets/buttons/ContainedButtonPanel.java | 2 +-
.../widgets/linkandlabel/ActionLink.java | 4 +-
.../select2/Select2BootstrapCssReference.java | 2 +-
.../widgets/select2/Select2JsReference.java | 2 +-
.../widgets/select2/Select2MultiChoiceExt.java | 2 +-
.../ObjectAdapterMementoProviderAbstract.java | 6 +-
.../ObjectAdapterMementoProviderForChoices.java | 2 +-
...tAdapterMementoProviderForReferenceChoices.java | 2 +-
...entoProviderForReferenceObjectAutoComplete.java | 2 +-
...derForReferenceParamOrPropertyAutoComplete.java | 4 +-
...bjectAdapterMementoProviderForValueChoices.java | 2 +-
.../themepicker/IsisWicketThemeSupport.java | 2 +-
.../themepicker/IsisWicketThemeSupportDefault.java | 6 +-
.../themepicker/ThemeProviderComposite.java | 6 +-
.../viewer/wicket/ui/errors/ExceptionModel.java | 6 +-
.../viewer/wicket/ui/errors/JGrowlBehaviour.java | 2 +-
.../viewer/wicket/ui/pages/error/ErrorPage.java | 2 +-
.../wicket/ui/pages/login/IsisSignInPanel.java | 2 +-
.../wicket/ui/pages/mmverror/MmvErrorPage.java | 2 +-
.../wicket/ui/panels/FormExecutorDefault.java | 4 +-
.../isis/viewer/wicket/ui/panels/PanelUtil.java | 2 +-
.../wicket/ui/panels/PromptFormAbstract.java | 6 +-
.../isis/viewer/wicket/ui/util/Components.java | 2 +-
.../viewer/wicket/ui/util/CssClassAppender.java | 2 +-
.../viewer/wicket/ui/util/CssClassRemover.java | 2 +-
.../isis/viewer/wicket/ui/util/CssIdAppender.java | 2 +-
.../isis/viewer/wicket/ui/util/Decorators.java | 2 +-
.../isis/viewer/wicket/ui/util/Tooltips.java | 2 +-
...tAdapterMementoProviderForValueChoicesTest.java | 2 +-
.../AuthenticatedWebSessionForIsis.java | 2 +-
.../ConverterForObjectAdapterMemento.java | 2 +-
.../viewer/integration/LocalizerForIsis.java | 4 +-
.../viewer/integration/WebRequestCycleForIsis.java | 4 +-
.../ComponentFactoryRegistrarDefault.java | 2 +-
.../ComponentFactoryRegistryDefault.java | 6 +-
.../registries/pages/PageClassRegistryDefault.java | 2 +-
.../services/HintStoreUsingWicketSession.java | 2 +-
.../services/ImageResourceCacheClassPath.java | 4 +-
.../services/TranslationsResolverWicket.java | 2 +-
.../mementos/ObjectMementoServiceWicket.java | 4 +-
.../viewer/services/mementos/ObjectMementoWkt.java | 8 +-
.../wicket/viewer/webmodule/WebModuleWicket.java | 4 +-
.../viewer/wicketapp/IsisWicketApplication.java | 8 +-
.../IsisWicketApplication_Experimental.java | 2 +-
.../IsisWicketApplication_newPageFactory.java | 2 +-
...uthenticatedWebSessionForIsis_Authenticate.java | 2 +-
.../AuthenticatedWebSessionForIsis_SignIn.java | 2 +-
1293 files changed, 23009 insertions(+), 22978 deletions(-)
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/events/EventObjectBase.java b/api/applib/src/main/adoc/modules/applib-classes/examples/events/EventObjectBase.java
index 2cee75b..2635740 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/events/EventObjectBase.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/events/EventObjectBase.java
@@ -20,9 +20,9 @@ package org.apache.isis.applib.events;
import javax.annotation.Nullable;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.base._With.requires;
+import static org.apache.isis.commons.internal.base._With.requires;
/**
* @since 2.0
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/events/domain/AbstractDomainEvent.java b/api/applib/src/main/adoc/modules/applib-classes/examples/events/domain/AbstractDomainEvent.java
index 4ca383c..2ddd967 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/events/domain/AbstractDomainEvent.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/events/domain/AbstractDomainEvent.java
@@ -28,7 +28,7 @@ import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.util.ToString;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.Getter;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/LazyTreeNode.java b/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/LazyTreeNode.java
index 63218a8..ce2964e 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/LazyTreeNode.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/LazyTreeNode.java
@@ -23,8 +23,8 @@ import java.util.concurrent.atomic.LongAdder;
import java.util.stream.Stream;
import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.core.commons.internal.base._Lazy;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._Lazy;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
@Value(semanticsProviderName="org.apache.isis.core.metamodel.facets.value.treenode.TreeNodeValueSemanticsProvider")
public class LazyTreeNode<T> implements TreeNode<T> {
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/TreeNode.java b/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/TreeNode.java
index 6ffc186..934fac0 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/TreeNode.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/graph/tree/TreeNode.java
@@ -31,7 +31,7 @@ import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.graph.Edge;
import org.apache.isis.applib.graph.SimpleEdge;
import org.apache.isis.applib.graph.Vertex;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
/**
* Fundamental building block of Tree structures.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/layout/grid/bootstrap3/BS3Col.java b/api/applib/src/main/adoc/modules/applib-classes/examples/layout/grid/bootstrap3/BS3Col.java
index 7c32897..47686f2 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/layout/grid/bootstrap3/BS3Col.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/layout/grid/bootstrap3/BS3Col.java
@@ -35,8 +35,8 @@ import org.apache.isis.applib.layout.component.DomainObjectLayoutData;
import org.apache.isis.applib.layout.component.DomainObjectLayoutDataOwner;
import org.apache.isis.applib.layout.component.FieldSet;
import org.apache.isis.applib.layout.component.FieldSetOwner;
-import org.apache.isis.core.commons.internal.primitives._Ints;
-import org.apache.isis.core.commons.internal.primitives._Ints.Bound;
+import org.apache.isis.commons.internal.primitives._Ints;
+import org.apache.isis.commons.internal.primitives._Ints.Bound;
/**
* A column within a row which, depending on its {@link #getSpan()}, could be as narrow as 1/12th of the page's width, all the way up to spanning the entire page.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/layout/menubars/bootstrap3/BS3MenuBars.java b/api/applib/src/main/adoc/modules/applib-classes/examples/layout/menubars/bootstrap3/BS3MenuBars.java
index cd8341f..d52e577 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/layout/menubars/bootstrap3/BS3MenuBars.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/layout/menubars/bootstrap3/BS3MenuBars.java
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlType;
import org.apache.isis.applib.annotation.DomainServiceLayout;
import org.apache.isis.applib.layout.component.ServiceActionLayoutData;
import org.apache.isis.applib.layout.menubars.MenuBars;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
/**
* Describes the collection of domain services into menubars, broadly corresponding to the aggregation of information within {@link org.apache.isis.applib.annotation.DomainServiceLayout}.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/mixins/metamodel/Object_objectIdentifier.java b/api/applib/src/main/adoc/modules/applib-classes/examples/mixins/metamodel/Object_objectIdentifier.java
index 8ba9947..d3e5787 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/mixins/metamodel/Object_objectIdentifier.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/mixins/metamodel/Object_objectIdentifier.java
@@ -27,7 +27,7 @@ import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.mixins.MixinConstants;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.metamodel.MetaModelService;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/spec/AbstractSpecification2.java b/api/applib/src/main/adoc/modules/applib-classes/examples/spec/AbstractSpecification2.java
index 2036587..b3ae676 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/spec/AbstractSpecification2.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/spec/AbstractSpecification2.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.spec;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Casts;
/**
* Adapter to make it easy to write {@link Specification}s.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Enums.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Enums.java
index 9f342ba..4047788 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Enums.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Enums.java
@@ -21,7 +21,7 @@ package org.apache.isis.applib.util;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.experimental.UtilityClass;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Equality.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Equality.java
index c4610ca..a8509fd 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Equality.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Equality.java
@@ -22,8 +22,8 @@ import java.util.List;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object Equality Composition.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Hashing.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Hashing.java
index 5754570..1a393a4 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/Hashing.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/Hashing.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object Hash Code Composition.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbAdapters.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbAdapters.java
index 66c53e3..a2479ac 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbAdapters.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbAdapters.java
@@ -36,8 +36,8 @@ import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
import org.apache.isis.applib.value.Markup;
-import org.apache.isis.core.commons.internal.base._Bytes;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Bytes;
+import org.apache.isis.commons.internal.base._Strings;
/**
* Provides JAXB XmlAdapters for Java built-in temporal types.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbUtil.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbUtil.java
index f2919f0..08cf554 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbUtil.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/JaxbUtil.java
@@ -30,9 +30,9 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.collections._Maps;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.resources._Resources;
import lombok.val;
import lombok.experimental.UtilityClass;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContract_Parser.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContract_Parser.java
index e8d9aab..9120f11 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContract_Parser.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContract_Parser.java
@@ -32,8 +32,8 @@ import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.apache.isis.applib.util.ObjectContracts.ObjectContract;
-import org.apache.isis.core.commons.internal._Constants;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal._Constants;
+import org.apache.isis.commons.internal.base._Strings;
/**
* Package private parser for ObjectContract.<br/><br/>
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContracts.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContracts.java
index 963d9c1..eb68dc5 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContracts.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ObjectContracts.java
@@ -22,8 +22,8 @@ import java.util.Comparator;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._NullSafe;
import lombok.extern.log4j.Log4j2;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ReasonBuffer2.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ReasonBuffer2.java
index b3cd010..c10f0ba 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ReasonBuffer2.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ReasonBuffer2.java
@@ -23,7 +23,7 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Extension to applib's {@link ReasonBuffer}.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/TitleBuffer.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/TitleBuffer.java
index edd02cc..1219e34 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/TitleBuffer.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/TitleBuffer.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.util;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.apache.isis.core.commons.internal._Constants;
+import org.apache.isis.commons.internal._Constants;
/**
* Title buffer is a utility class to help produce titles for objects without
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ToString.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ToString.java
index a11a431..129c52d 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ToString.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ToString.java
@@ -24,7 +24,7 @@ import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object to String Composition.
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ZipWriter.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ZipWriter.java
index bea7b06..d60adc5 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/ZipWriter.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/ZipWriter.java
@@ -24,7 +24,7 @@ import java.io.OutputStreamWriter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/ChangesDtoUtils.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/ChangesDtoUtils.java
index 4c92a33..5e013a1 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/ChangesDtoUtils.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/ChangesDtoUtils.java
@@ -32,7 +32,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.chg.v2.ChangesDto;
public final class ChangesDtoUtils {
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommandDtoUtils.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommandDtoUtils.java
index bb7a815..b02c91c 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommandDtoUtils.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommandDtoUtils.java
@@ -31,7 +31,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.cmd.v2.ActionDto;
import org.apache.isis.schema.cmd.v2.CommandDto;
import org.apache.isis.schema.cmd.v2.MapDto;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommonDtoUtils.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommonDtoUtils.java
index 7038580..48ce8e3 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommonDtoUtils.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/CommonDtoUtils.java
@@ -37,11 +37,11 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.collections._Maps;
-import org.apache.isis.core.commons.internal.context._Context;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.context._Context;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import org.apache.isis.schema.cmd.v2.MapDto;
import org.apache.isis.schema.cmd.v2.ParamDto;
import org.apache.isis.schema.common.v2.BlobDto;
@@ -53,7 +53,7 @@ import org.apache.isis.schema.common.v2.ValueDto;
import org.apache.isis.schema.common.v2.ValueType;
import org.apache.isis.schema.common.v2.ValueWithTypeDto;
-import static org.apache.isis.core.commons.internal.collections._Maps.entry;
+import static org.apache.isis.commons.internal.collections._Maps.entry;
public final class CommonDtoUtils {
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/InteractionDtoUtils.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/InteractionDtoUtils.java
index 2b2e506..dd8419a 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/InteractionDtoUtils.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/InteractionDtoUtils.java
@@ -38,9 +38,9 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.iactn.Interaction;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.cmd.v2.ParamDto;
import org.apache.isis.schema.cmd.v2.ParamsDto;
import org.apache.isis.schema.common.v2.InteractionType;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/MemberExecutionDtoUtils.java b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/MemberExecutionDtoUtils.java
index cbc491b..68b9832 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/MemberExecutionDtoUtils.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/util/schema/MemberExecutionDtoUtils.java
@@ -30,7 +30,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Casts;
import org.apache.isis.schema.common.v2.DifferenceDto;
import org.apache.isis.schema.common.v2.PeriodDto;
import org.apache.isis.schema.ixn.v2.MemberExecutionDto;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/value/Blob.java b/api/applib/src/main/adoc/modules/applib-classes/examples/value/Blob.java
index 028aa33..ef723ca 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/value/Blob.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/value/Blob.java
@@ -26,7 +26,7 @@ import java.util.Objects;
import javax.activation.MimeType;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/value/Clob.java b/api/applib/src/main/adoc/modules/applib-classes/examples/value/Clob.java
index e1baa9d..d2a6554 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/value/Clob.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/value/Clob.java
@@ -25,7 +25,7 @@ import java.util.Objects;
import javax.activation.MimeType;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-classes/examples/value/NamedWithMimeType.java b/api/applib/src/main/adoc/modules/applib-classes/examples/value/NamedWithMimeType.java
index 19e01a7..c242158 100644
--- a/api/applib/src/main/adoc/modules/applib-classes/examples/value/NamedWithMimeType.java
+++ b/api/applib/src/main/adoc/modules/applib-classes/examples/value/NamedWithMimeType.java
@@ -24,7 +24,7 @@ import java.io.Serializable;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
-import org.apache.isis.core.commons.collections.Can;
+import org.apache.isis.commons.collections.Can;
import lombok.Getter;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/appfeat/ApplicationMemberType.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/appfeat/ApplicationMemberType.java
index 0b78ed8..89a8744 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/appfeat/ApplicationMemberType.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/appfeat/ApplicationMemberType.java
@@ -18,7 +18,7 @@
*/
package org.apache.isis.applib.services.appfeat;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
// tag::refguide[]
public enum ApplicationMemberType {
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/bookmark/BookmarkService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/bookmark/BookmarkService.java
index 283c8fe..808c80e 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/bookmark/BookmarkService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/bookmark/BookmarkService.java
@@ -20,9 +20,9 @@ package org.apache.isis.applib.services.bookmark;
import javax.annotation.Nullable;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.base._With.requires;
+import static org.apache.isis.commons.internal.base._With.requires;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/confview/ConfigurationProperty.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/confview/ConfigurationProperty.java
index b25e7f3..9bffce9 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/confview/ConfigurationProperty.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/confview/ConfigurationProperty.java
@@ -29,7 +29,7 @@ import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
import lombok.Getter;
import lombok.NoArgsConstructor;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/conmap/ContentMappingService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/conmap/ContentMappingService.java
index 1e76565..f9076bb 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/conmap/ContentMappingService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/conmap/ContentMappingService.java
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
import javax.ws.rs.core.MediaType;
import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
// tag::refguide[]
public interface ContentMappingService {
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerAbstract.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerAbstract.java
index 64da844..3c18948 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerAbstract.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerAbstract.java
@@ -29,8 +29,8 @@ import javax.inject.Inject;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.services.i18n.TranslationService;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.Getter;
import lombok.Setter;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerForType.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerForType.java
index 501e6fd..da0231c 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerForType.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerForType.java
@@ -24,10 +24,10 @@ import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.exceptions._Exceptions.containsAnyOfTheseMessages;
-import static org.apache.isis.core.commons.internal.exceptions._Exceptions.getCausalChain;
+import static org.apache.isis.commons.internal.exceptions._Exceptions.containsAnyOfTheseMessages;
+import static org.apache.isis.commons.internal.exceptions._Exceptions.getCausalChain;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerService.java
index 2c8043b..d5e359c 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/exceprecog/ExceptionRecognizerService.java
@@ -21,7 +21,7 @@ package org.apache.isis.applib.services.exceprecog;
import java.util.Optional;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer.Recognition;
-import org.apache.isis.core.commons.collections.Can;
+import org.apache.isis.commons.collections.Can;
/**
*
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
index ee4fa16..5cb8640 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
@@ -24,7 +24,7 @@ import java.util.NoSuchElementException;
import javax.annotation.Nullable;
import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.core.commons.exceptions.IsisException;
+import org.apache.isis.commons.exceptions.IsisException;
// tag::refguide[]
public interface FactoryService {
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/i18n/TranslatableString.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/i18n/TranslatableString.java
index 30de466..b3c950d 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/i18n/TranslatableString.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/i18n/TranslatableString.java
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
// tag::refguide[]
@Value
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/iactn/Interaction.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/iactn/Interaction.java
index 43450df..7f12c39 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/iactn/Interaction.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/iactn/Interaction.java
@@ -37,8 +37,8 @@ import org.apache.isis.applib.services.eventbus.EventBusService;
import org.apache.isis.applib.services.metrics.MetricsService;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
import org.apache.isis.applib.util.schema.MemberExecutionDtoUtils;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Maps;
import org.apache.isis.schema.common.v2.DifferenceDto;
import org.apache.isis.schema.common.v2.InteractionType;
import org.apache.isis.schema.common.v2.PeriodDto;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/CatalogingSchemaOutputResolver.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/CatalogingSchemaOutputResolver.java
index c77d003..8df647b 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/CatalogingSchemaOutputResolver.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/CatalogingSchemaOutputResolver.java
@@ -39,9 +39,9 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
-import org.apache.isis.core.commons.internal.codec._DocumentFactories;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.codec._DocumentFactories;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Maps;
/**
* An implementation of {@link SchemaOutputResolver} that keeps track of all the schemas for which it has
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/JaxbService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/JaxbService.java
index 47af07a..3ccc8ba 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/JaxbService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/jaxb/JaxbService.java
@@ -35,9 +35,9 @@ import org.apache.isis.applib.ApplicationException;
import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.mixins.dto.Dto_downloadXsd;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.collections._Maps;
// tag::refguide[]
public interface JaxbService {
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/layout/LayoutServiceMenu.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/layout/LayoutServiceMenu.java
index 0006792..821fe33 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/layout/LayoutServiceMenu.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/layout/LayoutServiceMenu.java
@@ -35,7 +35,7 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.services.menu.MenuBarsService;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
@Named("isisApplib.LayoutServiceMenu")
@DomainService(objectType = "isisApplib.LayoutServiceMenu")
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelService.java
index c0c3c09..ac5770a 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelService.java
@@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.S
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.command.CommandDtoProcessor;
-import org.apache.isis.core.commons.internal.collections._Sets;
+import org.apache.isis.commons.internal.collections._Sets;
import org.apache.isis.schema.metamodel.v2.MetamodelDto;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelServiceMenu.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelServiceMenu.java
index 00690db..6d22f86 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelServiceMenu.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/metamodel/MetaModelServiceMenu.java
@@ -42,9 +42,9 @@ import org.apache.isis.applib.annotation.RestrictTo;
import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.services.jaxb.JaxbService;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Sets;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Sets;
import org.apache.isis.schema.metamodel.v2.MetamodelDto;
@Named("isisApplib.MetaModelServiceMenu")
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/registry/ServiceRegistry.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/registry/ServiceRegistry.java
index 45972aa..e94e27e 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/registry/ServiceRegistry.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/registry/ServiceRegistry.java
@@ -27,12 +27,12 @@ import java.util.stream.Stream;
import javax.annotation.Priority;
-import org.apache.isis.core.commons.collections.Can;
-import org.apache.isis.core.commons.internal._Constants;
-import org.apache.isis.core.commons.internal.base._Reduction;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
-import org.apache.isis.core.commons.internal.ioc.ManagedBeanAdapter;
-import org.apache.isis.core.commons.internal.reflection._Reflect;
+import org.apache.isis.commons.collections.Can;
+import org.apache.isis.commons.internal._Constants;
+import org.apache.isis.commons.internal.base._Reduction;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.ioc.ManagedBeanAdapter;
+import org.apache.isis.commons.internal.reflection._Reflect;
import lombok.val;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/scratchpad/Scratchpad.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/scratchpad/Scratchpad.java
index 46553f9..8f241ad 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/scratchpad/Scratchpad.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/scratchpad/Scratchpad.java
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Service;
import org.apache.isis.applib.annotation.IsisInteractionScope;
import org.apache.isis.applib.annotation.OrderPrecedence;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.collections._Maps;
import lombok.extern.log4j.Log4j2;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingService.java
index 094a791..b1a9f3b 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingService.java
@@ -21,8 +21,8 @@ package org.apache.isis.applib.services.urlencoding;
import java.nio.charset.StandardCharsets;
import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.memento._Mementos.EncoderDecoder;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.memento._Mementos.EncoderDecoder;
// tag::refguide[]
public interface UrlEncodingService extends EncoderDecoder {
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
index bedd2b1..8bc0dd2 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
@@ -20,8 +20,8 @@ package org.apache.isis.applib.services.urlencoding;
import java.nio.charset.StandardCharsets;
-import org.apache.isis.core.commons.internal.base._Bytes;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Bytes;
+import org.apache.isis.commons.internal.base._Strings;
/**
* to use, subclass and annotated with:
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrapperFactory.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrapperFactory.java
index e930670..658aafa 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrapperFactory.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrapperFactory.java
@@ -26,7 +26,7 @@ import org.apache.isis.applib.services.wrapper.control.AsyncControl;
import org.apache.isis.applib.services.wrapper.control.SyncControl;
import org.apache.isis.applib.services.wrapper.events.InteractionEvent;
import org.apache.isis.applib.services.wrapper.listeners.InteractionListener;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
* Provides the ability to "wrap" of a domain object such that it can
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrappingObject.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrappingObject.java
index 5d4fca6..838a6ff 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrappingObject.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/WrappingObject.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.services.wrapper;
import java.util.EnumSet;
import org.apache.isis.applib.services.wrapper.control.ExecutionMode;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
* Implemented by all objects that have been viewed as per
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ControlAbstract.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ControlAbstract.java
index dc03213..da06560 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ControlAbstract.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ControlAbstract.java
@@ -22,8 +22,8 @@ import java.lang.reflect.Method;
import java.util.EnumSet;
import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.internal.base._Casts;
import lombok.AccessLevel;
import lombok.Getter;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ExecutionMode.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ExecutionMode.java
index 8db0655..3048f61 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ExecutionMode.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/ExecutionMode.java
@@ -19,7 +19,7 @@
package org.apache.isis.applib.services.wrapper.control;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/SyncControl.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/SyncControl.java
index 6ea0387..071ba73 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/SyncControl.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/wrapper/control/SyncControl.java
@@ -20,7 +20,7 @@ package org.apache.isis.applib.services.wrapper.control;
import java.util.EnumSet;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
*/
diff --git a/api/applib/src/main/java/org/apache/isis/applib/Identifier.java b/api/applib/src/main/java/org/apache/isis/applib/Identifier.java
index bfd8f62..e757cf0 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/Identifier.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/Identifier.java
@@ -25,8 +25,8 @@ import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.collections._Lists;
// tag::refguide[]
// end::refguide[]
diff --git a/api/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java b/api/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
index 2853e2b..32381e3 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
@@ -21,8 +21,8 @@ package org.apache.isis.applib;
import org.apache.isis.applib.services.exceprecog.TranslatableException;
import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.functions._Functions;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.functions._Functions;
/**
* Indicates that an unexpected, non-recoverable (fatal) exception has occurred within
diff --git a/api/applib/src/main/java/org/apache/isis/applib/RecoverableException.java b/api/applib/src/main/java/org/apache/isis/applib/RecoverableException.java
index 5ff2e77..6aa0059 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/RecoverableException.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/RecoverableException.java
@@ -21,8 +21,8 @@ package org.apache.isis.applib;
import org.apache.isis.applib.services.exceprecog.TranslatableException;
import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
/**
* Indicates that an exceptional condition/problem has occurred within the application's domain logic.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/client/SuppressionType.java b/api/applib/src/main/java/org/apache/isis/applib/client/SuppressionType.java
index 4a0a42c..661260f 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/client/SuppressionType.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/client/SuppressionType.java
@@ -21,9 +21,9 @@ package org.apache.isis.applib.client;
import java.util.EnumSet;
import java.util.List;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
-import static org.apache.isis.core.commons.internal.base._NullSafe.stream;
+import static org.apache.isis.commons.internal.base._NullSafe.stream;
/**
*
diff --git a/api/applib/src/main/java/org/apache/isis/applib/events/EventObjectBase.java b/api/applib/src/main/java/org/apache/isis/applib/events/EventObjectBase.java
index 2cee75b..2635740 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/events/EventObjectBase.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/events/EventObjectBase.java
@@ -20,9 +20,9 @@ package org.apache.isis.applib.events;
import javax.annotation.Nullable;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.base._With.requires;
+import static org.apache.isis.commons.internal.base._With.requires;
/**
* @since 2.0
diff --git a/api/applib/src/main/java/org/apache/isis/applib/events/domain/AbstractDomainEvent.java b/api/applib/src/main/java/org/apache/isis/applib/events/domain/AbstractDomainEvent.java
index 4ca383c..2ddd967 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/events/domain/AbstractDomainEvent.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/events/domain/AbstractDomainEvent.java
@@ -28,7 +28,7 @@ import org.apache.isis.applib.services.command.CommandContext;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.util.ToString;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.Getter;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/graph/tree/LazyTreeNode.java b/api/applib/src/main/java/org/apache/isis/applib/graph/tree/LazyTreeNode.java
index 63218a8..ce2964e 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/graph/tree/LazyTreeNode.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/graph/tree/LazyTreeNode.java
@@ -23,8 +23,8 @@ import java.util.concurrent.atomic.LongAdder;
import java.util.stream.Stream;
import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.core.commons.internal.base._Lazy;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._Lazy;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
@Value(semanticsProviderName="org.apache.isis.core.metamodel.facets.value.treenode.TreeNodeValueSemanticsProvider")
public class LazyTreeNode<T> implements TreeNode<T> {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/graph/tree/TreeNode.java b/api/applib/src/main/java/org/apache/isis/applib/graph/tree/TreeNode.java
index 6ffc186..934fac0 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/graph/tree/TreeNode.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/graph/tree/TreeNode.java
@@ -31,7 +31,7 @@ import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.graph.Edge;
import org.apache.isis.applib.graph.SimpleEdge;
import org.apache.isis.applib.graph.Vertex;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
/**
* Fundamental building block of Tree structures.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/jaxb/PrimitiveJaxbAdapters.java b/api/applib/src/main/java/org/apache/isis/applib/jaxb/PrimitiveJaxbAdapters.java
index 9416c75..fbae217 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/jaxb/PrimitiveJaxbAdapters.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/jaxb/PrimitiveJaxbAdapters.java
@@ -22,8 +22,8 @@ import java.nio.charset.StandardCharsets;
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.apache.isis.core.commons.internal.base._Bytes;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Bytes;
+import org.apache.isis.commons.internal.base._Strings;
public final class PrimitiveJaxbAdapters {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3Col.java b/api/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3Col.java
index 7c32897..47686f2 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3Col.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3Col.java
@@ -35,8 +35,8 @@ import org.apache.isis.applib.layout.component.DomainObjectLayoutData;
import org.apache.isis.applib.layout.component.DomainObjectLayoutDataOwner;
import org.apache.isis.applib.layout.component.FieldSet;
import org.apache.isis.applib.layout.component.FieldSetOwner;
-import org.apache.isis.core.commons.internal.primitives._Ints;
-import org.apache.isis.core.commons.internal.primitives._Ints.Bound;
+import org.apache.isis.commons.internal.primitives._Ints;
+import org.apache.isis.commons.internal.primitives._Ints.Bound;
/**
* A column within a row which, depending on its {@link #getSpan()}, could be as narrow as 1/12th of the page's width, all the way up to spanning the entire page.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/layout/menubars/bootstrap3/BS3MenuBars.java b/api/applib/src/main/java/org/apache/isis/applib/layout/menubars/bootstrap3/BS3MenuBars.java
index cd8341f..d52e577 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/layout/menubars/bootstrap3/BS3MenuBars.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/layout/menubars/bootstrap3/BS3MenuBars.java
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlType;
import org.apache.isis.applib.annotation.DomainServiceLayout;
import org.apache.isis.applib.layout.component.ServiceActionLayoutData;
import org.apache.isis.applib.layout.menubars.MenuBars;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
/**
* Describes the collection of domain services into menubars, broadly corresponding to the aggregation of information within {@link org.apache.isis.applib.annotation.DomainServiceLayout}.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/mixins/metamodel/Object_objectIdentifier.java b/api/applib/src/main/java/org/apache/isis/applib/mixins/metamodel/Object_objectIdentifier.java
index 8ba9947..d3e5787 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/mixins/metamodel/Object_objectIdentifier.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/mixins/metamodel/Object_objectIdentifier.java
@@ -27,7 +27,7 @@ import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.mixins.MixinConstants;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.metamodel.MetaModelService;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/query/QueryAbstract.java b/api/applib/src/main/java/org/apache/isis/applib/query/QueryAbstract.java
index 2e7b5d1..2f33de8 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/query/QueryAbstract.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/query/QueryAbstract.java
@@ -19,7 +19,7 @@
package org.apache.isis.applib.query;
-import org.apache.isis.core.commons.internal.context._Context;
+import org.apache.isis.commons.internal.context._Context;
import lombok.Getter;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/appfeat/ApplicationMemberType.java b/api/applib/src/main/java/org/apache/isis/applib/services/appfeat/ApplicationMemberType.java
index 0b78ed8..89a8744 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/appfeat/ApplicationMemberType.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/appfeat/ApplicationMemberType.java
@@ -18,7 +18,7 @@
*/
package org.apache.isis.applib.services.appfeat;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
// tag::refguide[]
public enum ApplicationMemberType {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/bookmark/BookmarkService.java b/api/applib/src/main/java/org/apache/isis/applib/services/bookmark/BookmarkService.java
index 283c8fe..808c80e 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/bookmark/BookmarkService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/bookmark/BookmarkService.java
@@ -20,9 +20,9 @@ package org.apache.isis.applib.services.bookmark;
import javax.annotation.Nullable;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.base._With.requires;
+import static org.apache.isis.commons.internal.base._With.requires;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationProperty.java b/api/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationProperty.java
index b25e7f3..9bffce9 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationProperty.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationProperty.java
@@ -29,7 +29,7 @@ import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
import lombok.Getter;
import lombok.NoArgsConstructor;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/conmap/ContentMappingService.java b/api/applib/src/main/java/org/apache/isis/applib/services/conmap/ContentMappingService.java
index 1e76565..f9076bb 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/conmap/ContentMappingService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/conmap/ContentMappingService.java
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
import javax.ws.rs.core.MediaType;
import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._NullSafe;
// tag::refguide[]
public interface ContentMappingService {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerAbstract.java b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerAbstract.java
index 64da844..3c18948 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerAbstract.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerAbstract.java
@@ -29,8 +29,8 @@ import javax.inject.Inject;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.services.i18n.TranslationService;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.Getter;
import lombok.Setter;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerForType.java b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerForType.java
index 501e6fd..da0231c 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerForType.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerForType.java
@@ -24,10 +24,10 @@ import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
-import static org.apache.isis.core.commons.internal.exceptions._Exceptions.containsAnyOfTheseMessages;
-import static org.apache.isis.core.commons.internal.exceptions._Exceptions.getCausalChain;
+import static org.apache.isis.commons.internal.exceptions._Exceptions.containsAnyOfTheseMessages;
+import static org.apache.isis.commons.internal.exceptions._Exceptions.getCausalChain;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerService.java b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerService.java
index 2c8043b..d5e359c 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/exceprecog/ExceptionRecognizerService.java
@@ -21,7 +21,7 @@ package org.apache.isis.applib.services.exceprecog;
import java.util.Optional;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer.Recognition;
-import org.apache.isis.core.commons.collections.Can;
+import org.apache.isis.commons.collections.Can;
/**
*
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/factory/FactoryService.java b/api/applib/src/main/java/org/apache/isis/applib/services/factory/FactoryService.java
index ee4fa16..5cb8640 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/factory/FactoryService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/factory/FactoryService.java
@@ -24,7 +24,7 @@ import java.util.NoSuchElementException;
import javax.annotation.Nullable;
import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.core.commons.exceptions.IsisException;
+import org.apache.isis.commons.exceptions.IsisException;
// tag::refguide[]
public interface FactoryService {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java b/api/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
index 30de466..b3c950d 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/i18n/TranslatableString.java
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
// tag::refguide[]
@Value
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/iactn/Interaction.java b/api/applib/src/main/java/org/apache/isis/applib/services/iactn/Interaction.java
index 5cfb218..9260b9a 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/iactn/Interaction.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/iactn/Interaction.java
@@ -38,8 +38,8 @@ import org.apache.isis.applib.services.eventbus.EventBusService;
import org.apache.isis.applib.services.metrics.MetricsService;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
import org.apache.isis.applib.util.schema.MemberExecutionDtoUtils;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Maps;
import org.apache.isis.schema.common.v2.DifferenceDto;
import org.apache.isis.schema.common.v2.InteractionType;
import org.apache.isis.schema.common.v2.PeriodDto;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/CatalogingSchemaOutputResolver.java b/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/CatalogingSchemaOutputResolver.java
index c77d003..8df647b 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/CatalogingSchemaOutputResolver.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/CatalogingSchemaOutputResolver.java
@@ -39,9 +39,9 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
-import org.apache.isis.core.commons.internal.codec._DocumentFactories;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.codec._DocumentFactories;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Maps;
/**
* An implementation of {@link SchemaOutputResolver} that keeps track of all the schemas for which it has
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/JaxbService.java b/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/JaxbService.java
index e33a1ca..4148840 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/JaxbService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/jaxb/JaxbService.java
@@ -36,9 +36,9 @@ import org.apache.isis.applib.ApplicationException;
import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.mixins.dto.Dto_downloadXsd;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.collections._Maps;
import lombok.NonNull;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/layout/LayoutServiceMenu.java b/api/applib/src/main/java/org/apache/isis/applib/services/layout/LayoutServiceMenu.java
index 0006792..821fe33 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/layout/LayoutServiceMenu.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/layout/LayoutServiceMenu.java
@@ -35,7 +35,7 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.services.menu.MenuBarsService;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
@Named("isisApplib.LayoutServiceMenu")
@DomainService(objectType = "isisApplib.LayoutServiceMenu")
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelService.java b/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelService.java
index c0c3c09..ac5770a 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelService.java
@@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.S
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.command.CommandDtoProcessor;
-import org.apache.isis.core.commons.internal.collections._Sets;
+import org.apache.isis.commons.internal.collections._Sets;
import org.apache.isis.schema.metamodel.v2.MetamodelDto;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelServiceMenu.java b/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelServiceMenu.java
index 00690db..6d22f86 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelServiceMenu.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/metamodel/MetaModelServiceMenu.java
@@ -42,9 +42,9 @@ import org.apache.isis.applib.annotation.RestrictTo;
import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.services.jaxb.JaxbService;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.collections._Sets;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Sets;
import org.apache.isis.schema.metamodel.v2.MetamodelDto;
@Named("isisApplib.MetaModelServiceMenu")
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/registry/ServiceRegistry.java b/api/applib/src/main/java/org/apache/isis/applib/services/registry/ServiceRegistry.java
index 45972aa..e94e27e 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/registry/ServiceRegistry.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/registry/ServiceRegistry.java
@@ -27,12 +27,12 @@ import java.util.stream.Stream;
import javax.annotation.Priority;
-import org.apache.isis.core.commons.collections.Can;
-import org.apache.isis.core.commons.internal._Constants;
-import org.apache.isis.core.commons.internal.base._Reduction;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
-import org.apache.isis.core.commons.internal.ioc.ManagedBeanAdapter;
-import org.apache.isis.core.commons.internal.reflection._Reflect;
+import org.apache.isis.commons.collections.Can;
+import org.apache.isis.commons.internal._Constants;
+import org.apache.isis.commons.internal.base._Reduction;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.ioc.ManagedBeanAdapter;
+import org.apache.isis.commons.internal.reflection._Reflect;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java b/api/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
index 46553f9..8f241ad 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Service;
import org.apache.isis.applib.annotation.IsisInteractionScope;
import org.apache.isis.applib.annotation.OrderPrecedence;
-import org.apache.isis.core.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.collections._Maps;
import lombok.extern.log4j.Log4j2;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java b/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
index 094a791..b1a9f3b 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
@@ -21,8 +21,8 @@ package org.apache.isis.applib.services.urlencoding;
import java.nio.charset.StandardCharsets;
import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.memento._Mementos.EncoderDecoder;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.memento._Mementos.EncoderDecoder;
// tag::refguide[]
public interface UrlEncodingService extends EncoderDecoder {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java b/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
index bedd2b1..8bc0dd2 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceUsingBaseEncodingAbstract.java
@@ -20,8 +20,8 @@ package org.apache.isis.applib.services.urlencoding;
import java.nio.charset.StandardCharsets;
-import org.apache.isis.core.commons.internal.base._Bytes;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Bytes;
+import org.apache.isis.commons.internal.base._Strings;
/**
* to use, subclass and annotated with:
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrapperFactory.java b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrapperFactory.java
index e930670..658aafa 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrapperFactory.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrapperFactory.java
@@ -26,7 +26,7 @@ import org.apache.isis.applib.services.wrapper.control.AsyncControl;
import org.apache.isis.applib.services.wrapper.control.SyncControl;
import org.apache.isis.applib.services.wrapper.events.InteractionEvent;
import org.apache.isis.applib.services.wrapper.listeners.InteractionListener;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
* Provides the ability to "wrap" of a domain object such that it can
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrappingObject.java b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrappingObject.java
index 5d4fca6..838a6ff 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrappingObject.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/WrappingObject.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.services.wrapper;
import java.util.EnumSet;
import org.apache.isis.applib.services.wrapper.control.ExecutionMode;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
* Implemented by all objects that have been viewed as per
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ControlAbstract.java b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ControlAbstract.java
index 0716096..ca9e1c3 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ControlAbstract.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ControlAbstract.java
@@ -23,8 +23,8 @@ import java.util.EnumSet;
import java.util.Optional;
import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.internal.base._Casts;
import lombok.AccessLevel;
import lombok.Getter;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ExecutionMode.java b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ExecutionMode.java
index 8db0655..3048f61 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ExecutionMode.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/ExecutionMode.java
@@ -19,7 +19,7 @@
package org.apache.isis.applib.services.wrapper.control;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/SyncControl.java b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/SyncControl.java
index 6ea0387..071ba73 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/SyncControl.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/wrapper/control/SyncControl.java
@@ -20,7 +20,7 @@ package org.apache.isis.applib.services.wrapper.control;
import java.util.EnumSet;
-import org.apache.isis.core.commons.collections.ImmutableEnumSet;
+import org.apache.isis.commons.collections.ImmutableEnumSet;
/**
*/
diff --git a/api/applib/src/main/java/org/apache/isis/applib/spec/AbstractSpecification2.java b/api/applib/src/main/java/org/apache/isis/applib/spec/AbstractSpecification2.java
index 2036587..b3ae676 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/spec/AbstractSpecification2.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/spec/AbstractSpecification2.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.spec;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Casts;
/**
* Adapter to make it easy to write {@link Specification}s.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/Enums.java b/api/applib/src/main/java/org/apache/isis/applib/util/Enums.java
index 9f342ba..4047788 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/Enums.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/Enums.java
@@ -21,7 +21,7 @@ package org.apache.isis.applib.util;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.experimental.UtilityClass;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/Equality.java b/api/applib/src/main/java/org/apache/isis/applib/util/Equality.java
index c4610ca..a8509fd 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/Equality.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/Equality.java
@@ -22,8 +22,8 @@ import java.util.List;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object Equality Composition.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/Hashing.java b/api/applib/src/main/java/org/apache/isis/applib/util/Hashing.java
index 5754570..1a393a4 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/Hashing.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/Hashing.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object Hash Code Composition.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/JaxbUtil.java b/api/applib/src/main/java/org/apache/isis/applib/util/JaxbUtil.java
index f2919f0..08cf554 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/JaxbUtil.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/JaxbUtil.java
@@ -30,9 +30,9 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.collections._Maps;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.resources._Resources;
import lombok.val;
import lombok.experimental.UtilityClass;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContract_Parser.java b/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContract_Parser.java
index e8d9aab..9120f11 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContract_Parser.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContract_Parser.java
@@ -32,8 +32,8 @@ import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.apache.isis.applib.util.ObjectContracts.ObjectContract;
-import org.apache.isis.core.commons.internal._Constants;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal._Constants;
+import org.apache.isis.commons.internal.base._Strings;
/**
* Package private parser for ObjectContract.<br/><br/>
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java b/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
index 963d9c1..eb68dc5 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
@@ -22,8 +22,8 @@ import java.util.Comparator;
import java.util.Objects;
import java.util.function.Function;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._NullSafe;
import lombok.extern.log4j.Log4j2;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/ReasonBuffer2.java b/api/applib/src/main/java/org/apache/isis/applib/util/ReasonBuffer2.java
index b3cd010..c10f0ba 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/ReasonBuffer2.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/ReasonBuffer2.java
@@ -23,7 +23,7 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Extension to applib's {@link ReasonBuffer}.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/TitleBuffer.java b/api/applib/src/main/java/org/apache/isis/applib/util/TitleBuffer.java
index edd02cc..1219e34 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/TitleBuffer.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/TitleBuffer.java
@@ -22,7 +22,7 @@ package org.apache.isis.applib.util;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.apache.isis.core.commons.internal._Constants;
+import org.apache.isis.commons.internal._Constants;
/**
* Title buffer is a utility class to help produce titles for objects without
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/ToString.java b/api/applib/src/main/java/org/apache/isis/applib/util/ToString.java
index a11a431..129c52d 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/ToString.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/ToString.java
@@ -24,7 +24,7 @@ import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
/**
* Fluent Object to String Composition.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/ZipWriter.java b/api/applib/src/main/java/org/apache/isis/applib/util/ZipWriter.java
index bea7b06..d60adc5 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/ZipWriter.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/ZipWriter.java
@@ -24,7 +24,7 @@ import java.io.OutputStreamWriter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/schema/ChangesDtoUtils.java b/api/applib/src/main/java/org/apache/isis/applib/util/schema/ChangesDtoUtils.java
index 4c92a33..5e013a1 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/schema/ChangesDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/schema/ChangesDtoUtils.java
@@ -32,7 +32,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.chg.v2.ChangesDto;
public final class ChangesDtoUtils {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommandDtoUtils.java b/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommandDtoUtils.java
index bb7a815..b02c91c 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommandDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommandDtoUtils.java
@@ -31,7 +31,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.cmd.v2.ActionDto;
import org.apache.isis.schema.cmd.v2.CommandDto;
import org.apache.isis.schema.cmd.v2.MapDto;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommonDtoUtils.java b/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommonDtoUtils.java
index b50f6e9..3fb7f14 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommonDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/schema/CommonDtoUtils.java
@@ -40,11 +40,11 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
-import org.apache.isis.core.commons.internal.base._Casts;
-import org.apache.isis.core.commons.internal.base._Strings;
-import org.apache.isis.core.commons.internal.collections._Maps;
-import org.apache.isis.core.commons.internal.context._Context;
-import org.apache.isis.core.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.collections._Maps;
+import org.apache.isis.commons.internal.context._Context;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
import org.apache.isis.schema.cmd.v2.MapDto;
import org.apache.isis.schema.cmd.v2.ParamDto;
import org.apache.isis.schema.common.v2.BlobDto;
@@ -56,7 +56,7 @@ import org.apache.isis.schema.common.v2.ValueDto;
import org.apache.isis.schema.common.v2.ValueType;
import org.apache.isis.schema.common.v2.ValueWithTypeDto;
-import static org.apache.isis.core.commons.internal.collections._Maps.entry;
+import static org.apache.isis.commons.internal.collections._Maps.entry;
public final class CommonDtoUtils {
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/schema/InteractionDtoUtils.java b/api/applib/src/main/java/org/apache/isis/applib/util/schema/InteractionDtoUtils.java
index 2b2e506..dd8419a 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/schema/InteractionDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/schema/InteractionDtoUtils.java
@@ -38,9 +38,9 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.iactn.Interaction;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._NullSafe;
-import org.apache.isis.core.commons.internal.collections._Lists;
-import org.apache.isis.core.commons.internal.resources._Resources;
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.resources._Resources;
import org.apache.isis.schema.cmd.v2.ParamDto;
import org.apache.isis.schema.cmd.v2.ParamsDto;
import org.apache.isis.schema.common.v2.InteractionType;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/util/schema/MemberExecutionDtoUtils.java b/api/applib/src/main/java/org/apache/isis/applib/util/schema/MemberExecutionDtoUtils.java
index cbc491b..68b9832 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/util/schema/MemberExecutionDtoUtils.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/util/schema/MemberExecutionDtoUtils.java
@@ -30,7 +30,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
import org.apache.isis.applib.util.JaxbUtil;
-import org.apache.isis.core.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.base._Casts;
import org.apache.isis.schema.common.v2.DifferenceDto;
import org.apache.isis.schema.common.v2.PeriodDto;
import org.apache.isis.schema.ixn.v2.MemberExecutionDto;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/value/Blob.java b/api/applib/src/main/java/org/apache/isis/applib/value/Blob.java
index 3e66c9d..3dba41d 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/value/Blob.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/value/Blob.java
@@ -31,7 +31,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.isis.applib.annotation.Value;
import org.apache.isis.applib.jaxb.PrimitiveJaxbAdapters;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/value/Clob.java b/api/applib/src/main/java/org/apache/isis/applib/value/Clob.java
index d9cf898..0b558de 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/value/Clob.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/value/Clob.java
@@ -31,7 +31,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.isis.applib.annotation.Value;
import org.apache.isis.applib.jaxb.PrimitiveJaxbAdapters;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
import lombok.val;
diff --git a/api/applib/src/main/java/org/apache/isis/applib/value/Markup.java b/api/applib/src/main/java/org/apache/isis/applib/value/Markup.java
index 478d3b4..65a4291 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/value/Markup.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/value/Markup.java
@@ -27,7 +27,7 @@ import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.core.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.base._Strings;
/**
* Immutable value type holding pre-rendered HTML.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/value/NamedWithMimeType.java b/api/applib/src/main/java/org/apache/isis/applib/value/NamedWithMimeType.java
index 19e01a7..c242158 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/value/NamedWithMimeType.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/value/NamedWithMimeType.java
@@ -24,7 +24,7 @@ import java.io.Serializable;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
-import org.apache.isis.core.commons.collections.Can;
+import org.apache.isis.commons.collections.Can;
import lombok.Getter;
diff --git a/api/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java b/api/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
index 3e0d3b3..a812007 100644
--- a/api/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
+++ b/api/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.junit.Before;
-import org.apache.isis.core.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.collections._Lists;
import org.apache.isis.core.internaltestsupport.contract.ValueTypeContractTestAbstract;
public class ObjectContractsTest_equals_and_hashCode extends ValueTypeContractTestAbstract<InvoiceItem3> {
diff --git a/commons/src/main/java/org/apache/isis/commons/IsisModuleCoreCommons.java b/commons/src/main/java/org/apache/isis/commons/IsisModuleCoreCommons.java
new file mode 100644
index 0000000..aa4656c
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/IsisModuleCoreCommons.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+
+import org.apache.isis.commons.internal.environment.IsisSystemEnvironment;
+
+@Configuration
+@Import({
+ // @Service's
+ IsisSystemEnvironment.class
+})
+public class IsisModuleCoreCommons {
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/binding/Bindable.java b/commons/src/main/java/org/apache/isis/commons/binding/Bindable.java
new file mode 100644
index 0000000..75aba72
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/binding/Bindable.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.binding;
+
+/**
+ * @param <T>
+ */
+public interface Bindable<T> extends Observable<T>, Writable<T> {
+
+ void bind(Observable<? extends T> observable);
+
+ void unbind();
+
+ boolean isBound();
+
+ void bindBidirectional(Bindable<T> other);
+
+ void unbindBidirectional(Bindable<T> other);
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/binding/ChangeListener.java b/commons/src/main/java/org/apache/isis/commons/binding/ChangeListener.java
new file mode 100644
index 0000000..c443389
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/binding/ChangeListener.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.binding;
+
+/**
+ * @param <T>
+ */
+@FunctionalInterface
+public interface ChangeListener<T> {
+
+ void changed(Observable<? extends T> observable, T oldValue, T newValue);
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/binding/InvalidationListener.java b/commons/src/main/java/org/apache/isis/commons/binding/InvalidationListener.java
new file mode 100644
index 0000000..57f5732
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/binding/InvalidationListener.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.binding;
+
+/**
+ * @param <T>
+ */
+@FunctionalInterface
+public interface InvalidationListener {
+
+ public void invalidated(Observable<?> observable);
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/binding/Observable.java b/commons/src/main/java/org/apache/isis/commons/binding/Observable.java
new file mode 100644
index 0000000..690794c
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/binding/Observable.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.binding;
+
+/**
+ * @param <T>
+ */
+public interface Observable<T> {
+
+ T getValue();
+
+ void addListener(ChangeListener<? super T> listener);
+ void removeListener(ChangeListener<? super T> listener);
+
+ void addListener(InvalidationListener listener);
+ void removeListener(InvalidationListener listener);
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/binding/Writable.java b/commons/src/main/java/org/apache/isis/commons/binding/Writable.java
new file mode 100644
index 0000000..ba4f583
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/binding/Writable.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.binding;
+
+/**
+ * @param <T>
+ */
+public interface Writable<T> {
+
+ T getValue();
+ void setValue(T value);
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/Can.java b/commons/src/main/java/org/apache/isis/commons/collections/Can.java
new file mode 100644
index 0000000..dd91e65
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Can.java
@@ -0,0 +1,582 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import java.util.stream.Collector;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.annotation.Nullable;
+import javax.enterprise.inject.Instance;
+
+import org.apache.isis.commons.internal.base._NullSafe;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+import lombok.val;
+
+/**
+ *
+ * Immutable {@link Iterable}, that can specifically represent 3 possible variants of
+ * {@link Cardinality}.
+ * <p>
+ * Java's {@link Optional}, can be seen as a holder of element(s), that is restricted to
+ * cardinality ZERO or ONE. {@link Can} is the logical extension to that, allowing also a
+ * cardinality of MULTIPLE.
+ * <p>
+ * Same idiomatic convention applies: References to {@link Can}
+ * should never be initialized to {@code null}.
+ * <p>
+ * A {@link Can} must not contain elements equal to {@code null}.
+ *
+ * @param <T>
+ * @since 2.0
+ */
+public interface Can<T> extends Iterable<T>, Serializable {
+
+ /**
+ * @return this Can's cardinality
+ */
+ Cardinality getCardinality();
+
+ /**
+ * @return number of elements this Can contains
+ */
+ int size();
+
+ /**
+ * Will only ever return an empty Optional, if the elementIndex is out of bounds.
+ * @param elementIndex
+ * @return optionally this Can's element with index {@code elementIndex},
+ * based on whether this index is within bounds
+ */
+ Optional<T> get(int elementIndex);
+
+ /**
+ * Shortcut to {@code get(elementIndex).orElseThrow(...)}
+ * <p>
+ * Will only ever throw, if the elementIndex is out of bounds.
+ * @param elementIndex
+ * @return this Can's element with index {@code elementIndex}
+ * @throws NoSuchElementException when the elementIndex is out of bounds
+ * @see {@link #get(int)}
+ */
+ default T getElseFail(final int elementIndex) {
+ return get(elementIndex)
+ .orElseThrow(()->new NoSuchElementException(
+ "no element with elementIndex = " + elementIndex));
+ }
+
+ /**
+ * @return Stream of elements this Can contains
+ */
+ Stream<T> stream();
+
+ /**
+ * @return this Can's first element or an empty Optional if no such element
+ */
+ Optional<T> getFirst();
+
+ /**
+ * Shortcut for {@code getFirst().orElseThrow(_Exceptions::noSuchElement)}
+ * @throws NoSuchElementException if result is empty
+ */
+ default T getFirstOrFail() {
+ return getFirst().orElseThrow(_Exceptions::noSuchElement);
+ }
+
+ /**
+ * @return this Can's single element or an empty Optional if this Can has any cardinality other than ONE
+ */
+ Optional<T> getSingleton();
+
+ /**
+ * Shortcut for {@code getSingleton().orElseThrow(_Exceptions::noSuchElement)}
+ * @throws NoSuchElementException if result is empty
+ */
+ default T getSingletonOrFail() {
+ return getSingleton().orElseThrow(_Exceptions::noSuchElement);
+ }
+
+ /**
+ * @return whether this Can contains given {@code element}, that is, at least one contained element
+ * passes the {@link Objects#equals(Object, Object)} test with respect to the given element.
+ */
+ boolean contains(T element);
+
+ // -- FACTORIES
+
+ /**
+ * Returns an empty {@code Can}.
+ * @param <T>
+ */
+ @SuppressWarnings("unchecked") // this is how the JDK does it for eg. empty lists
+ public static <T> Can<T> empty() {
+ return (Can<T>) Can_Empty.INSTANCE;
+ }
+
+ /**
+ * Returns either a {@code Can} with the given {@code element} or an empty {@code Can} if the
+ * {@code element} is {@code null}.
+ * @param <T>
+ * @param element
+ * @return non-null
+ */
+ public static <T> Can<T> ofNullable(@Nullable T element) {
+ if(element==null) {
+ return empty();
+ }
+ return Can_Singleton.of(element);
+ }
+
+ /**
+ * Returns either a {@code Can} with the given {@code element} or throws if the
+ * {@code element} is {@code null}.
+ * @param <T>
+ * @param element
+ * @return non-null
+ * @throws NullPointerException if {@code element} is {@code null}
+ */
+ public static <T> Can<T> ofSingleton(T element) {
+ requires(element, "element");
+ return Can_Singleton.of(element);
+ }
+
+ @SafeVarargs
+ public static <T> Can<T> of(T ... array) {
+ return ofArray(array);
+ }
+
+ public static <T> Can<T> ofArray(@Nullable T[] array) {
+
+ if(_NullSafe.size(array)==0) {
+ return empty();
+ }
+
+ // this is just an optimization, to pre-allocate a reasonable list size,
+ // specifically targeted at small list sizes
+ val maxSize = Math.min(array.length, 1024);
+
+ val nonNullElements = Stream.of(array)
+ .filter(_NullSafe::isPresent)
+ .collect(Collectors.toCollection(()->new ArrayList<>(maxSize)));
+
+ nonNullElements.trimToSize(); // in case we have a 'sparse' collection as input to this method
+
+ val size = nonNullElements.size();
+
+ if(size==0) {
+ return empty();
+ }
+
+ if(size==1) {
+ return ofSingleton(((List<T>)nonNullElements).get(0));
+ }
+
+ return Can_Multiple.of(nonNullElements);
+
+ }
+
+ /**
+ * Returns either a {@code Can} with all the elements from given {@code collection}
+ * or an empty {@code Can} if the {@code collection} is {@code null}. Any elements
+ * equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
+ * @param <T>
+ * @param collection
+ * @return non-null
+ */
+ public static <T> Can<T> ofCollection(@Nullable Collection<T> collection) {
+
+ if(_NullSafe.size(collection)==0) {
+ return empty();
+ }
+
+ // this is just an optimization, to pre-allocate a reasonable list size,
+ // specifically targeted at small list sizes
+ val maxSize = Math.min(collection.size(), 1024);
+
+ val nonNullElements = collection.stream()
+ .filter(_NullSafe::isPresent)
+ .collect(Collectors.toCollection(()->new ArrayList<>(maxSize)));
+
+ nonNullElements.trimToSize(); // in case we have a 'sparse' collection as input to this method
+
+ val size = nonNullElements.size();
+
+ if(size==0) {
+ return empty();
+ }
+
+ if(size==1) {
+ return ofSingleton(((List<T>)nonNullElements).get(0));
+ }
+
+ return Can_Multiple.of(nonNullElements);
+ }
+
+ public static <T> Can<T> ofIterable(@Nullable Iterable<T> iterable) {
+
+ if(iterable==null) {
+ return empty();
+ }
+
+ val elements = new ArrayList<T>();
+ iterable.forEach(elements::add);
+
+ return ofCollection(elements);
+ }
+
+ /**
+ * Returns either a {@code Can} with all the elements from given {@code stream}
+ * or an empty {@code Can} if the {@code stream} is {@code null}. Any elements
+ * equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
+ * @param <T>
+ * @param stream
+ * @return non-null
+ */
+ public static <T> Can<T> ofStream(@Nullable Stream<T> stream) {
+
+ if(stream==null) {
+ return empty();
+ }
+
+ val nonNullElements = stream
+ .filter(_NullSafe::isPresent)
+ .collect(Collectors.toCollection(()->new ArrayList<>()));
+
+ val size = nonNullElements.size();
+
+ if(size==0) {
+ return empty();
+ }
+
+ if(size==1) {
+ return ofSingleton(((List<T>)nonNullElements).get(0));
+ }
+
+ return Can_Multiple.of(nonNullElements);
+ }
+
+ /**
+ * Returns either a {@code Can} with all the elements from given {@code instance}
+ * or an empty {@code Can} if the {@code instance} is {@code null}. Any elements
+ * equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
+ * @param <T>
+ * @param instance
+ * @return non-null
+ */
+ public static <T> Can<T> ofInstance(@Nullable Instance<T> instance) {
+ if(instance==null || instance.isUnsatisfied()) {
+ return empty();
+ }
+ if(instance.isResolvable()) {
+ return Can_Singleton.of(instance.get());
+ }
+ val nonNullElements = instance.stream()
+ .collect(Collectors.toCollection(()->new ArrayList<>()));
+
+ return Can_Multiple.of(nonNullElements);
+
+ }
+
+
+ // -- OPERATORS
+
+ /**
+ * Returns a {@code Can} with all the elements from this {@code Can},
+ * that are accepted by the given {@code predicate}. If {@code predicate}
+ * is {@code null} <em>all</em> elements are accepted.
+ * @param predicate - if absent accepts all
+ * @return non-null
+ */
+ public default Can<T> filter(@Nullable Predicate<? super T> predicate) {
+ if(predicate==null || isEmpty()) {
+ return this;
+ }
+
+ // optimization for the singleton case
+ if(isCardinalityOne()) {
+ val singleton = getSingleton().get();
+ return predicate.test(singleton)
+ ? this
+ : empty();
+ }
+
+ val filteredElements =
+ stream()
+ .filter(predicate)
+ .collect(Collectors.toCollection(ArrayList::new));
+
+ // optimization for the case when the filter accepted all
+ if(filteredElements.size()==size()) {
+ return this;
+ }
+
+ return ofCollection(filteredElements);
+ }
+
+ /**
+ * Returns a {@code Can} with all the elements from this {@code Can}
+ * 'transformed' by the given {@code mapper} function. Any resulting elements
+ * equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
+ *
+ * @param <R>
+ * @param mapper - if absent throws if this {@code Can} is non-empty
+ * @return non-null
+ */
+ default <R> Can<R> map(Function<? super T, R> mapper) {
+
+ if(isEmpty()) {
+ return empty();
+ }
+
+ requires(mapper, "mapper");
+
+ val mappedElements =
+ stream()
+ .map(mapper)
+ .filter(_NullSafe::isPresent)
+ .collect(Collectors.toCollection(ArrayList::new));
+
+ return ofCollection(mappedElements);
+ }
+
+ // -- CONCATENATION
+
+ /**
+ * Returns a {@code Can} with all the elements from given {@code can} joined by
+ * the given {@code element}. If any of given {@code can} or {@code element} are {@code null}
+ * these do not contribute any elements and are ignored.
+ * @param <T>
+ * @param can - nullable
+ * @param element - nullable
+ * @return non-null
+ */
+ public static <T> Can<T> concat(@Nullable Can<T> can, @Nullable T element) {
+ if(can==null || can.isEmpty()) {
+ return ofNullable(element);
+ }
+ if(element==null) {
+ return can;
+ }
+ // at this point: can is not empty and variant is not null
+ val newSize = can.size() + 1;
+ val union = can.stream().collect(Collectors.toCollection(()->new ArrayList<>(newSize)));
+ union.add(element);
+ return Can_Multiple.of(union);
+ }
+
+ // -- TRAVERSAL
+
+ @Override
+ default void forEach(Consumer<? super T> action) {
+ requires(action, "action");
+ stream().forEach(action);
+ }
+
+ /**
+ * Similar to {@link #forEach(Consumer)}, but zipps in {@code zippedIn} to iterate through
+ * its elements and passes them over as the second argument to the {@code action}.
+ * @param <R>
+ * @param zippedIn must have at least as much elements as this {@code Can}
+ * @param action
+ * @throws NoSuchElementException if {@code zippedIn} overflows
+ */
+ <R> void zip(Iterable<R> zippedIn, BiConsumer<? super T, ? super R> action);
+
+ /**
+ * Similar to {@link #map(Function)}, but zipps in {@code zippedIn} to iterate through
+ * its elements and passes them over as the second argument to the {@code mapper}.
+ * @param <R>
+ * @param <Z>
+ * @param zippedIn must have at least as much elements as this {@code Can}
+ * @param mapper
+ * @throws NoSuchElementException if {@code zippedIn} overflows
+ */
+ <R, Z> Can<R> zipMap(Iterable<Z> zippedIn, BiFunction<? super T, ? super Z, R> mapper);
+
+ // -- MANIPULATION
+
+ Can<T> add(T element);
+ Can<T> addAll(Can<T> other);
+
+ /**
+ * Inserts the specified element at the specified position in this list
+ * (optional operation). Shifts the element currently at that position
+ * (if any) and any subsequent elements to the right (adds one to their
+ * indices).
+ *
+ * @param index index at which the specified element is to be inserted
+ * @param element element to be inserted
+ * @return new instance
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this list
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this list
+ * @throws IndexOutOfBoundsException if the index is out of range
+ * (<tt>index < 0 || index > size()</tt>)
+ */
+ Can<T> add(int index, T element);
+
+ Can<T> replace(int index, T element);
+
+ /**
+ * Removes the element at the specified position in this list (optional
+ * operation). Shifts any subsequent elements to the left (subtracts one
+ * from their indices). Returns the element that was removed from the
+ * list.
+ *
+ * @param index the index of the element to be removed
+ * @return new instance
+ * @throws IndexOutOfBoundsException if the index is out of range
+ * (<tt>index < 0 || index >= size()</tt>)
+ */
+ Can<T> remove(int index);
+
+ Can<T> remove(T element);
+
+ // -- SEARCH
+
+ /**
+ * Returns the index of the first occurrence of the specified element
+ * in this list, or -1 if this list does not contain the element.
+ * More formally, returns the lowest index <tt>i</tt> such that
+ * <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>,
+ * or -1 if there is no such index.
+ *
+ * @param element element to search for
+ * @return the index of the first occurrence of the specified element in
+ * this list, or -1 if this list does not contain the element
+ * @throws ClassCastException if the type of the specified element
+ * is incompatible with this list
+ * (<a href="Collection.html#optional-restrictions">optional</a>)
+ * @throws NullPointerException if the specified element is null and this
+ * list does not permit null elements
+ * (<a href="Collection.html#optional-restrictions">optional</a>)
+ */
+ int indexOf(T element);
+
+ // -- EQUALITY
+
+ /**
+ * @param other
+ * @return whether this is element-wise equal to {@code other}
+ */
+ default boolean isEqualTo(Can<?> other) {
+ if(other==null) {
+ return false;
+ }
+ if(this.size()!=other.size()) {
+ return false;
+ }
+
+ val otherIterator = other.iterator();
+
+ for(T element: this) {
+ val otherElement = otherIterator.next();
+ if(!element.equals(otherElement)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // -- SHORTCUTS FOR PREDICATES
+
+ default boolean isEmpty() {
+ return getCardinality().isZero();
+ }
+
+ default boolean isNotEmpty() {
+ return !getCardinality().isZero();
+ }
+
+ default boolean isCardinalityOne() {
+ return getCardinality().isOne();
+ }
+
+ default boolean isCardinalityMultiple() {
+ return getCardinality().isMultiple();
+ }
+
+ // -- COLLECTORS
+
+ public static <T>
+ Collector<T, ?, Can<T>> toCan() {
+
+ return Collectors.collectingAndThen(
+ Collectors.toList(),
+ Can::ofCollection);
+ }
+
+ // -- CONVERSIONS
+
+ /**
+ * @return a serializable and immutable List, containing the elements of this Can
+ */
+ List<T> toList();
+
+//XXX to implement when needed
+// Set<T> toSet();
+// Set<T> toSortedSet();
+// Set<T> toSortedSet(Comparator<T> comparator);
+
+ /**
+ * @param <C>
+ * @param collectionFactory
+ * @return a collection, containing the elements of this Can
+ */
+ <C extends Collection<T>> C toCollection(Supplier<C> collectionFactory);
+
+ /**
+ * @param a the array into which the elements of this Can are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose.
+ * @return a non-null array, containing the elements of this Can
+ */
+ default T[] toArray(T[] a) {
+ return toList().toArray(a);
+ }
+
+ /**
+ * @param elementType the {@code Class} object representing the component
+ * type of the new array
+ * @return a non-null array, containing the elements of this Can
+ */
+ T[] toArray(Class<T> elementType);
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/CanVector.java b/commons/src/main/java/org/apache/isis/commons/collections/CanVector.java
new file mode 100644
index 0000000..483aaeb
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/CanVector.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.IntStream;
+
+import lombok.NonNull;
+
+/**
+ * Represents a mutable, but fixed size vector of Can<T>.
+ * <p>
+ * Mutable meaning, that the vector elements can be replaced.
+ *
+ * @since Jun 30, 2020
+ */
+public final class CanVector<T> implements Iterable<Can<T>>, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final int size;
+ private final List<Can<T>> cans;
+
+ public CanVector(int size) {
+ this.size = size;
+ this.cans = new ArrayList<>(size);
+ // init vector with empty cans
+ IntStream.range(0, size).forEach(__->cans.add(Can.empty()));
+ }
+
+ public int size() {
+ return size;
+ }
+
+ @Override
+ public Iterator<Can<T>> iterator() {
+ return cans.iterator();
+ }
+
+ /**
+ * Returns the element at the specified position in this CanVector.
+ * @param index
+ * @throws IndexOutOfBoundsException if the index is out of range
+ * (<tt>index < 0 || index >= size()</tt>)
+ */
+ public Can<T> get(int index) {
+ return cans.get(index);
+ }
+
+ /**
+ * Replaces the element at the specified position in this CanVector with the
+ * specified element.
+ *
+ * @param index
+ * @param can
+ * @return self
+ * @throws IndexOutOfBoundsException if the index is out of range
+ * (<tt>index < 0 || index >= size()</tt>)
+ */
+ public CanVector<T> set(int index, @NonNull Can<T> can) {
+ cans.set(index, can);
+ return this;
+ }
+
+ public static <T> CanVector<T> empty() {
+ return new CanVector<>(0);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true; // optimization not strictly necessary
+ }
+ return (obj instanceof CanVector)
+ ? cans.equals(((CanVector<?>)obj).cans)
+ : false;
+ }
+
+ @Override
+ public int hashCode() {
+ return cans.hashCode();
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/Can_Empty.java b/commons/src/main/java/org/apache/isis/commons/collections/Can_Empty.java
new file mode 100644
index 0000000..51f0f4b
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Can_Empty.java
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Optional;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import java.util.stream.Stream;
+
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import lombok.NonNull;
+import lombok.Value;
+import lombok.val;
+
+@Value @NoArgsConstructor(access = AccessLevel.PRIVATE)
+final class Can_Empty<T> implements Can<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ static final Can_Empty<?> INSTANCE = new Can_Empty<>();
+
+ @Override
+ public Cardinality getCardinality() {
+ return Cardinality.ZERO;
+ }
+
+ @Override
+ public Stream<T> stream() {
+ return Stream.empty();
+ }
+
+ @Override
+ public Optional<T> getSingleton() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<T> getFirst() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<T> get(int elementIndex) {
+ return Optional.empty();
+ }
+
+ @Override
+ public boolean contains(T element) {
+ return false;
+ }
+
+ @Override
+ public int size() {
+ return 0;
+ }
+
+ @Override
+ public Iterator<T> iterator() {
+ return Collections.<T>emptyList().iterator();
+ }
+
+ @Override
+ public <R> void zip(Iterable<R> zippedIn, BiConsumer<? super T, ? super R> action) {
+ // no-op
+ }
+
+ @Override
+ public <R, Z> Can<R> zipMap(Iterable<Z> zippedIn, BiFunction<? super T, ? super Z, R> mapper) {
+ return Can.empty();
+ }
+
+ @Override
+ public Can<T> add(@NonNull T element) {
+ return Can.ofSingleton(element);
+ }
+
+ @Override
+ public Can<T> addAll(@NonNull Can<T> other) {
+ return other;
+ }
+
+ @Override
+ public Can<T> add(int index, @NonNull T element) {
+ if(index!=0) {
+ throw new IndexOutOfBoundsException(
+ "cannot add to empty can with index other than 0; got " + index);
+ }
+ return Can.ofSingleton(element);
+ }
+
+ @Override
+ public Can<T> replace(int index, T element) {
+ throw _Exceptions.unsupportedOperation("cannot replace an element in an empty Can");
+ }
+
+ @Override
+ public Can<T> remove(int index) {
+ throw new IndexOutOfBoundsException("cannot remove anything from an empty Can");
+ }
+
+ @Override
+ public Can<T> remove(T element) {
+ return this; // on an empty can this is a no-op
+ }
+
+ @Override
+ public int indexOf(T element) {
+ return -1;
+ }
+
+ @Override
+ public String toString() {
+ return "Can[]";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(INSTANCE == obj) {
+ return true; // optimization not strictly necessary
+ }
+ return (obj instanceof Can)
+ ? ((Can<?>)obj).isEmpty()
+ : false;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public List<T> toList() {
+ return Collections.emptyList(); // serializable and immutable
+ }
+
+ @Override
+ public <C extends Collection<T>> C toCollection(@NonNull Supplier<C> collectionFactory) {
+ return collectionFactory.get();
+ }
+
+ @Override
+ public T[] toArray(@NonNull Class<T> elementType) {
+ val array = _Casts.<T[]>uncheckedCast(Array.newInstance(elementType, 0));
+ return array;
+ }
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/Can_Multiple.java b/commons/src/main/java/org/apache/isis/commons/collections/Can_Multiple.java
new file mode 100644
index 0000000..ea1af08
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Can_Multiple.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Optional;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.isis.commons.internal.base._Casts;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+@RequiredArgsConstructor(staticName="of")
+final class Can_Multiple<T> implements Can<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ private final List<T> elements;
+
+ @Override
+ public Optional<T> getFirst() {
+ return Optional.of(elements.get(0));
+ }
+
+ @Override
+ public Cardinality getCardinality() {
+ return Cardinality.MULTIPLE;
+ }
+
+ @Override
+ public Stream<T> stream() {
+ return elements.stream();
+ }
+
+ @Override
+ public Optional<T> getSingleton() {
+ return Optional.empty();
+ }
+
+ @Override
+ public int size() {
+ return elements.size();
+ }
+
+ @Override
+ public boolean contains(T element) {
+ if(element==null) {
+ return false; // an optimization: Can's dont't contain null
+ }
+ return elements.contains(element);
+ }
+
+ @Override
+ public Optional<T> get(int elementIndex) {
+ // we do an index out of bounds check ourselves, in order to prevent any stack-traces,
+ // that pollute the heap
+ val size = size();
+ if(size==0) {
+ return Optional.empty();
+ }
+ val minIndex = 0;
+ val maxIndex = size - 1;
+ if(elementIndex < minIndex || elementIndex > maxIndex) {
+ return Optional.empty();
+ }
+ return Optional.of(elements.get(elementIndex));
+ }
+
+ @Override
+ public Iterator<T> iterator() {
+ return Collections.unmodifiableList(elements).iterator();
+ }
+
+ @Override
+ public <R> void zip(Iterable<R> zippedIn, BiConsumer<? super T, ? super R> action) {
+ requires(zippedIn, "zippedIn");
+ requires(action, "action");
+ val zippedInIterator = zippedIn.iterator();
+ stream().forEach(t->{
+ action.accept(t, zippedInIterator.next());
+ });
+ }
+
+ @Override
+ public <R, Z> Can<R> zipMap(Iterable<Z> zippedIn, BiFunction<? super T, ? super Z, R> mapper) {
+ requires(zippedIn, "zippedIn");
+ requires(mapper, "mapper");
+ val zippedInIterator = zippedIn.iterator();
+ return map(t->mapper.apply(t, zippedInIterator.next()));
+ }
+
+ @Override
+ public Can<T> add(@NonNull T element) {
+ val elementStream = Stream.concat(elements.stream(), Stream.of(element)); // append
+ return Can.ofStream(elementStream);
+ }
+
+ @Override
+ public Can<T> addAll(@NonNull Can<T> other) {
+ if(other.isEmpty()) {
+ return this;
+ }
+ val newElements = new ArrayList<T>(this.size() + other.size());
+ newElements.addAll(elements);
+ other.forEach(newElements::add);
+ return Can_Multiple.of(newElements);
+ }
+
+ @Override
+ public Can<T> add(int index, @NonNull T element) {
+ val newElements = new ArrayList<T>(elements);
+ newElements.add(index, element);
+ return Can.ofCollection(newElements);
+ }
+
+ @Override
+ public Can<T> replace(int index, T element) {
+ val newElements = new ArrayList<T>(elements);
+ newElements.set(index, element);
+ return Can.ofCollection(newElements);
+ }
+
+ @Override
+ public Can<T> remove(int index) {
+ val newElements = new ArrayList<T>(elements);
+ newElements.remove(index);
+ return Can.ofCollection(newElements);
+ }
+
+ @Override
+ public Can<T> remove(T element) {
+ val newElements = new ArrayList<T>(elements);
+ newElements.remove(element);
+ return Can.ofCollection(newElements);
+ }
+
+ @Override
+ public int indexOf(@NonNull T element) {
+ return this.elements.indexOf(element);
+ }
+
+ @Override
+ public String toString() {
+ val literal = stream()
+ .map(s->""+s)
+ .collect(Collectors.joining(", "));
+ return "Can["+literal+"]";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof Can) {
+ return ((Can<?>) obj).isEqualTo(this);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return elements.hashCode();
+ }
+
+ @Override
+ public List<T> toList() {
+ return Collections.unmodifiableList(elements); // serializable and immutable
+ }
+
+ @Override
+ public <C extends Collection<T>> C toCollection(@NonNull Supplier<C> collectionFactory) {
+ val collection = collectionFactory.get();
+ collection.addAll(elements);
+ return collection;
+ }
+
+ @Override
+ public T[] toArray(@NonNull Class<T> elementType) {
+ val array = _Casts.<T[]>uncheckedCast(Array.newInstance(elementType, size()));
+ return elements.toArray(array);
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/Can_Singleton.java b/commons/src/main/java/org/apache/isis/commons/collections/Can_Singleton.java
new file mode 100644
index 0000000..c9c12c3
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Can_Singleton.java
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import java.util.stream.Stream;
+
+import org.apache.isis.commons.internal.base._Casts;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+@RequiredArgsConstructor(staticName="of")
+final class Can_Singleton<T> implements Can<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ private final T element;
+
+ @Override
+ public Optional<T> getSingleton() {
+ return Optional.of(element);
+ }
+
+ @Override
+ public Cardinality getCardinality() {
+ return Cardinality.ONE;
+ }
+
+ @Override
+ public Stream<T> stream() {
+ return Stream.of(element);
+ }
+
+ @Override
+ public Optional<T> getFirst() {
+ return getSingleton();
+ }
+
+ @Override
+ public Optional<T> get(int elementIndex) {
+ return getSingleton();
+ }
+
+ @Override
+ public int size() {
+ return 1;
+ }
+
+ @Override
+ public boolean contains(T element) {
+ return Objects.equals(this.element, element);
+ }
+
+ @Override
+ public Iterator<T> iterator() {
+ return Collections.singletonList(element).iterator();
+ }
+
+ @Override
+ public <R> void zip(Iterable<R> zippedIn, BiConsumer<? super T, ? super R> action) {
+ action.accept(element, zippedIn.iterator().next());
+ }
+
+ @Override
+ public <R, Z> Can<R> zipMap(Iterable<Z> zippedIn, BiFunction<? super T, ? super Z, R> mapper) {
+ return Can_Singleton.of(mapper.apply(element, zippedIn.iterator().next()));
+ }
+
+ @Override
+ public Can<T> add(@NonNull T element) {
+ return Can.ofStream(Stream.of(this.element, element)); // append
+ }
+
+ @Override
+ public Can<T> addAll(@NonNull Can<T> other) {
+ if(other.isEmpty()) {
+ return this;
+ }
+ if(other.isCardinalityOne()) {
+ return add(other.getSingleton().orElseThrow(_Exceptions::unexpectedCodeReach));
+ }
+ val newElements = new ArrayList<T>(other.size()+1);
+ newElements.add(element);
+ other.forEach(newElements::add);
+ return Can_Multiple.of(newElements);
+ }
+
+ @Override
+ public Can<T> add(int index, @NonNull T element) {
+ if(index==0) {
+ return Can.ofStream(Stream.of(element, this.element)); // insert before
+ }
+ if(index==1) {
+ return Can.ofStream(Stream.of(this.element, element)); // append
+ }
+ throw new IndexOutOfBoundsException(
+ "cannot add to singleton with index other than 0 or 1; got " + index);
+ }
+
+ @Override
+ public Can<T> replace(int index, T element) {
+ if(index==0) {
+ return Can.ofSingleton(element);
+ }
+ throw new IndexOutOfBoundsException(
+ "cannot replace on singleton with index other than 0; got " + index);
+ }
+
+ @Override
+ public Can<T> remove(int index) {
+ if(index==0) {
+ return Can.empty();
+ }
+ throw new IndexOutOfBoundsException(
+ "cannot remove from singleton with index other than 0; got " + index);
+ }
+
+ @Override
+ public Can<T> remove(T element) {
+ if(this.element.equals(element)) {
+ return Can.empty();
+ }
+ return this;
+ }
+
+ @Override
+ public int indexOf(@NonNull T element) {
+ return this.element.equals(element) ? 0 : -1;
+ }
+
+ @Override
+ public String toString() {
+ return "Can["+element+"]";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof Can) {
+ return ((Can<?>) obj).isEqualTo(this);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return element.hashCode();
+ }
+
+ @Override
+ public List<T> toList() {
+ return Collections.singletonList(element); // serializable and immutable
+ }
+
+ @Override
+ public <C extends Collection<T>> C toCollection(@NonNull Supplier<C> collectionFactory) {
+ val collection = collectionFactory.get();
+ collection.add(element);
+ return collection;
+ }
+
+ @Override
+ public T[] toArray(@NonNull Class<T> elementType) {
+ val array = _Casts.<T[]>uncheckedCast(Array.newInstance(elementType, 1));
+ array[0] = element;
+ return array;
+ }
+
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/Cardinality.java b/commons/src/main/java/org/apache/isis/commons/collections/Cardinality.java
new file mode 100644
index 0000000..5371493
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Cardinality.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+/**
+ * @since 2.0
+ */
+public enum Cardinality {
+
+ /**
+ * The container is empty.
+ */
+ ZERO,
+
+ /**
+ * The container has exactly one element.
+ */
+ ONE,
+
+ /**
+ * The container has at least two elements.
+ */
+ MULTIPLE
+ ;
+
+ public boolean isZero() {
+ return this == ZERO;
+ }
+
+ public boolean isOne() {
+ return this == ONE;
+ }
+
+ public boolean isMultiple() {
+ return this == MULTIPLE;
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/collections/ImmutableEnumSet.java b/commons/src/main/java/org/apache/isis/commons/collections/ImmutableEnumSet.java
new file mode 100644
index 0000000..2f45e1a
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/collections/ImmutableEnumSet.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.collections;
+
+import java.util.EnumSet;
+import java.util.Iterator;
+
+/**
+ * Immutable variant of {@link EnumSet}
+ *
+ * @since 2.0
+ */
+public final class ImmutableEnumSet<E extends Enum<E>>
+implements Iterable<E>, java.io.Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final EnumSet<E> delegate;
+
+ private ImmutableEnumSet(EnumSet<E> delegate) {
+ this.delegate = delegate;
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> from(EnumSet<E> delegate) {
+ return new ImmutableEnumSet<>(delegate);
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> noneOf(Class<E> enumType) {
+ return from(EnumSet.noneOf(enumType));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> of(E e1) {
+ return from(EnumSet.of(e1));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> of(E e1, E e2) {
+ return from(EnumSet.of(e1, e2));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> of(E e1, E e2, E e3) {
+ return from(EnumSet.of(e1, e2, e3));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> of(E e1, E e2, E e3, E e4) {
+ return from(EnumSet.of(e1, e2, e3, e4));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> complementOf(ImmutableEnumSet<E> other) {
+ return from(EnumSet.complementOf(other.delegate));
+ }
+
+ public static <E extends Enum<E>> ImmutableEnumSet<E> allOf(Class<E> enumType) {
+ return from(EnumSet.allOf(enumType));
+ }
+
+ public boolean contains(E element) {
+ return delegate.contains(element);
+ }
+
+ public EnumSet<E> toEnumSet() {
+ return delegate.clone();
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ return delegate.iterator();
+ }
+
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/concurrent/AwaitableLatch.java b/commons/src/main/java/org/apache/isis/commons/concurrent/AwaitableLatch.java
new file mode 100644
index 0000000..56b1455
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/concurrent/AwaitableLatch.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.concurrent;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.RequiredArgsConstructor;
+
+/**
+ * Provides a read-only view on a {@link CountDownLatch}.
+ * @since 2.0
+ *
+ */
+@RequiredArgsConstructor(staticName = "of")
+public final class AwaitableLatch {
+
+ private final CountDownLatch countDownLatch;
+
+ public static AwaitableLatch unlocked() {
+ return of(new CountDownLatch(0));
+ }
+
+ /**
+ * {@link AwaitableLatch#await()}
+ * @throws InterruptedException
+ */
+ public void await() {
+ try {
+ countDownLatch.await();
+ } catch (InterruptedException e) {
+ throw _Exceptions.unrecoverable(e);
+ }
+ }
+
+ /**
+ * {@link AwaitableLatch#await(long, TimeUnit)}
+ * @throws InterruptedException
+ */
+ public boolean await(long timeout, TimeUnit unit) {
+ try {
+ return countDownLatch.await(timeout, unit);
+ } catch (InterruptedException e) {
+ throw _Exceptions.unrecoverable(e);
+ }
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java b/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java
new file mode 100644
index 0000000..23b0e93
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java
@@ -0,0 +1,350 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.exceptions;
+
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.isis.commons.internal._Constants;
+
+/**
+ * <p>Provides utilities for manipulating and examining
+ * <code>Throwable</code> objects.</p>
+ *
+ * @author Daniel L. Rall
+ * @author Dmitri Plotnikov
+ * @author Stephen Colebourne
+ * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
+ * @author Pete Gieser
+ * @since 1.0
+ * @version $Id: ExceptionUtils.java 594278 2007-11-12 19:58:30Z bayard $
+ */
+// portions copied in from commons-lang 2.6
+public class ExceptionUtils {
+
+ /**
+ * <p>The names of methods commonly used to access a wrapped exception.</p>
+ */
+ private static String[] CAUSE_METHOD_NAMES = {
+ "getCause",
+ "getNextException",
+ "getTargetException",
+ "getException",
+ "getSourceException",
+ "getRootCause",
+ "getCausedByException",
+ "getNested",
+ "getLinkedException",
+ "getNestedException",
+ "getLinkedCause",
+ "getThrowable",
+ };
+
+ /**
+ * <p>The Method object for Java 1.4 getCause.</p>
+ */
+ private static final Method THROWABLE_CAUSE_METHOD;
+
+ static {
+ Method causeMethod;
+ try {
+ causeMethod = Throwable.class.getMethod("getCause", _Constants.emptyClasses);
+ } catch (Exception e) {
+ causeMethod = null;
+ }
+ THROWABLE_CAUSE_METHOD = causeMethod;
+ }
+
+ /**
+ * <p>
+ * Public constructor allows an instance of <code>ExceptionUtils</code> to be created, although that is not
+ * normally necessary.
+ * </p>
+ */
+ public ExceptionUtils() {
+ super();
+ }
+
+ //-----------------------------------------------------------------------
+ /**
+ * <p>Introspects the <code>Throwable</code> to obtain the cause.</p>
+ *
+ * <p>The method searches for methods with specific names that return a
+ * <code>Throwable</code> object. This will pick up most wrapping exceptions.
+ *
+ * <p>The default list searched for are:</p>
+ * <ul>
+ * <li><code>getCause()</code></li>
+ * <li><code>getNextException()</code></li>
+ * <li><code>getTargetException()</code></li>
+ * <li><code>getException()</code></li>
+ * <li><code>getSourceException()</code></li>
+ * <li><code>getRootCause()</code></li>
+ * <li><code>getCausedByException()</code></li>
+ * <li><code>getNested()</code></li>
+ * </ul>
+ *
+ * <p>In the absence of any such method, the object is inspected for a
+ * <code>detail</code> field assignable to a <code>Throwable</code>.</p>
+ *
+ * <p>If none of the above is found, returns <code>null</code>.</p>
+ *
+ * @param throwable the throwable to introspect for a cause, may be null
+ * @return the cause of the <code>Throwable</code>,
+ * <code>null</code> if none found or null throwable input
+ * @since 1.0
+ */
+ public static Throwable getCause(Throwable throwable) {
+ if (throwable == null) {
+ return null;
+ }
+ Throwable cause = getCauseUsingWellKnownTypes(throwable);
+ if (cause == null) {
+ for (String methodName : CAUSE_METHOD_NAMES) {
+ if (methodName != null) {
+ cause = getCauseUsingMethodName(throwable, methodName);
+ if (cause != null) {
+ break;
+ }
+ }
+ }
+ if (cause == null) {
+ cause = getCauseUsingFieldName(throwable, "detail");
+ }
+ }
+ return cause;
+ }
+
+ /**
+ * <p>Finds a <code>Throwable</code> for known types.</p>
+ *
+ * <p>Uses <code>instanceof</code> checks to examine the exception,
+ * looking for well known types which could contain chained or
+ * wrapped exceptions.</p>
+ *
+ * @param throwable the exception to examine
+ * @return the wrapped exception, or <code>null</code> if not found
+ */
+ private static Throwable getCauseUsingWellKnownTypes(Throwable throwable) {
+ /*if (throwable instanceof Nestable) {
+ return ((Nestable) throwable).getCause();
+ } else */
+ if (throwable instanceof SQLException) {
+ return ((SQLException) throwable).getNextException();
+ }
+ if (throwable instanceof InvocationTargetException) {
+ return ((InvocationTargetException) throwable).getTargetException();
+ }
+ return null;
+ }
+
+ /**
+ * <p>Finds a <code>Throwable</code> by method name.</p>
+ *
+ * @param throwable the exception to examine
+ * @param methodName the name of the method to find and invoke
+ * @return the wrapped exception, or <code>null</code> if not found
+ */
+ private static Throwable getCauseUsingMethodName(Throwable throwable, String methodName) {
+ Method method;
+ try {
+ method = throwable.getClass().getMethod(methodName);
+ } catch (NoSuchMethodException | SecurityException ignored) {
+ return null;
+ }
+
+ if (!Throwable.class.isAssignableFrom(method.getReturnType())) {
+ return null;
+ }
+ try {
+ return (Throwable) method.invoke(throwable);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ignored) {
+ return null;
+ }
+ }
+
+ /**
+ * <p>Finds a <code>Throwable</code> by field name.</p>
+ *
+ * @param throwable the exception to examine
+ * @param fieldName the name of the attribute to examine
+ * @return the wrapped exception, or <code>null</code> if not found
+ */
+ private static Throwable getCauseUsingFieldName(Throwable throwable, String fieldName) {
+ Field field = null;
+ try {
+ field = throwable.getClass().getField(fieldName);
+ } catch (NoSuchFieldException | SecurityException ignored) {
+ // exception ignored
+ }
+
+ if (field != null && Throwable.class.isAssignableFrom(field.getType())) {
+ try {
+ return (Throwable) field.get(throwable);
+ } catch (IllegalAccessException | IllegalArgumentException ignored) {
+ // exception ignored
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <p>Checks if the Throwable class has a <code>getCause</code> method.</p>
+ *
+ * <p>This is true for JDK 1.4 and above.</p>
+ *
+ * @return true if Throwable is nestable
+ * @since 2.0
+ */
+ public static boolean isThrowableNested() {
+ return THROWABLE_CAUSE_METHOD != null;
+ }
+
+ /**
+ * <p>Checks whether this <code>Throwable</code> class can store a cause.</p>
+ *
+ * <p>This method does <b>not</b> check whether it actually does store a cause.<p>
+ *
+ * @param throwable the <code>Throwable</code> to examine, may be null
+ * @return boolean <code>true</code> if nested otherwise <code>false</code>
+ * @since 2.0
+ */
+ public static boolean isNestedThrowable(Throwable throwable) {
+ if (throwable == null) {
+ return false;
+ }
+
+ /*if (throwable instanceof Nestable) {
+ return true;
+ } else*/ if (throwable instanceof SQLException) {
+ return true;
+ } else if (throwable instanceof InvocationTargetException) {
+ return true;
+ } else if (isThrowableNested()) {
+ return true;
+ }
+
+ Class<?> cls = throwable.getClass();
+ for (final String causeMethodName : CAUSE_METHOD_NAMES) {
+ try {
+ Method method = cls.getMethod(causeMethodName, _Constants.emptyClasses);
+ if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
+ return true;
+ }
+ } catch (NoSuchMethodException | SecurityException ignored) {
+ // exception ignored
+ }
+ }
+
+ try {
+ Field field = cls.getField("detail");
+ if (field != null) {
+ return true;
+ }
+ } catch (NoSuchFieldException | SecurityException ignored) {
+ // exception ignored
+ }
+
+ return false;
+ }
+
+ /**
+ * <p>Returns the list of <code>Throwable</code> objects in the
+ * exception chain.</p>
+ *
+ * <p>A throwable without cause will return an array containing
+ * one element - the input throwable.
+ * A throwable with one cause will return an array containing
+ * two elements. - the input throwable and the cause throwable.
+ * A <code>null</code> throwable will return an array of size zero.</p>
+ *
+ * <p>From version 2.2, this method handles recursive cause structures
+ * that might otherwise cause infinite loops. The cause chain is
+ * processed until the end is reached, or until the next item in the
+ * chain is already in the result set.</p>
+ *
+ * @see #getThrowableList(Throwable)
+ * @param throwable the throwable to inspect, may be null
+ * @return the array of throwables, never null
+ */
+ public static Throwable[] getThrowables(Throwable throwable) {
+ List<Throwable> list = getThrowableList(throwable);
+ return (Throwable[]) list.toArray(new Throwable[list.size()]);
+ }
+
+ /**
+ * <p>Returns the list of <code>Throwable</code> objects in the
+ * exception chain.</p>
+ *
+ * <p>A throwable without cause will return a list containing
+ * one element - the input throwable.
+ * A throwable with one cause will return a list containing
+ * two elements. - the input throwable and the cause throwable.
+ * A <code>null</code> throwable will return a list of size zero.</p>
+ *
+ * <p>This method handles recursive cause structures that might
+ * otherwise cause infinite loops. The cause chain is processed until
+ * the end is reached, or until the next item in the chain is already
+ * in the result set.</p>
+ *
+ * @param throwable the throwable to inspect, may be null
+ * @return the list of throwables, never null
+ * @since Commons Lang 2.2
+ */
+ public static List<Throwable> getThrowableList(Throwable throwable) {
+ List<Throwable> list = new ArrayList<Throwable>();
+ while (throwable != null && list.contains(throwable) == false) {
+ list.add(throwable);
+ throwable = ExceptionUtils.getCause(throwable);
+ }
+ return list;
+ }
+
+ //-----------------------------------------------------------------------
+ /**
+ * <p>A way to get the entire nested stack-trace of an throwable.</p>
+ *
+ * <p>The result of this method is highly dependent on the JDK version
+ * and whether the exceptions override printStackTrace or not.</p>
+ *
+ * @param throwable the <code>Throwable</code> to be examined
+ * @return the nested stack trace, with the root cause first
+ * @since 2.0
+ */
+ public static String getFullStackTrace(Throwable throwable) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw, true);
+ Throwable[] ts = getThrowables(throwable);
+ for (int i = 0; i < ts.length; i++) {
+ ts[i].printStackTrace(pw);
+ if (isNestedThrowable(ts[i])) {
+ break;
+ }
+ }
+ return sw.getBuffer().toString();
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/IsisApplicationException.java b/commons/src/main/java/org/apache/isis/commons/exceptions/IsisApplicationException.java
new file mode 100644
index 0000000..618c122
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/IsisApplicationException.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.exceptions;
+
+/**
+ * Indicates an error raised by the application code.
+ *
+ * <p>
+ * The viewer is expected to render the message within the application in a
+ * user-friendly fashion, for example as a growl-like notification.
+ *
+ * <p>
+ * <b>Note:</b> application code should not throw this exception directly; instead use {@link org.apache.isis.applib.ApplicationException},
+ * {@link org.apache.isis.applib.RecoverableException}, {@link org.apache.isis.applib.NonRecoverableException} or {@link org.apache.isis.applib.FatalException}
+ * </p>
+ */
+public class IsisApplicationException extends IsisException {
+
+ private static final long serialVersionUID = 1L;
+
+ public IsisApplicationException() {
+ super();
+ }
+
+ public IsisApplicationException(final String msg) {
+ super(msg);
+ }
+
+ public IsisApplicationException(final Throwable cause) {
+ super(cause);
+ }
+
+ public IsisApplicationException(final String msg, final Throwable cause) {
+ super(msg, cause);
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/IsisException.java b/commons/src/main/java/org/apache/isis/commons/exceptions/IsisException.java
new file mode 100644
index 0000000..819d567
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/IsisException.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.exceptions;
+
+import java.text.MessageFormat;
+
+/**
+ * General exception raised by the framework, typically a system exception.
+ */
+public class IsisException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public IsisException() {
+ }
+
+ public IsisException(final String message) {
+ super(message);
+ }
+
+ public IsisException(final String messageFormat, final Object... args) {
+ super(MessageFormat.format(messageFormat, args));
+ }
+
+ public IsisException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public IsisException(final Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/UnexpectedCallException.java b/commons/src/main/java/org/apache/isis/commons/exceptions/UnexpectedCallException.java
new file mode 100644
index 0000000..537bf42
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/UnexpectedCallException.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.exceptions;
+
+/**
+ * Indicates that a call was made to a method (normally an overridden one) that
+ * was not expected, and hence not coded for.
+ */
+public class UnexpectedCallException extends IsisException {
+ private static final long serialVersionUID = 1L;
+
+ public UnexpectedCallException() {
+ super("This method call was not expected");
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/UnknownTypeException.java b/commons/src/main/java/org/apache/isis/commons/exceptions/UnknownTypeException.java
new file mode 100644
index 0000000..dc448d6
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/UnknownTypeException.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.exceptions;
+
+public class UnknownTypeException extends IsisException {
+ private static final long serialVersionUID = 1L;
+
+ public UnknownTypeException(final String message) {
+ super(message);
+ }
+
+ public UnknownTypeException(final Object object) {
+ this(object == null ? "null" : object.toString());
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java b/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java
new file mode 100644
index 0000000..de038f6
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Defines {@link org.apache.isis.commons.exceptions.IsisException base class}
+ * for exceptions raised either by Isis itself or by the domain model
+ * running on top of Isis.
+ */
+package org.apache.isis.commons.exceptions;
\ No newline at end of file
diff --git a/commons/src/main/java/org/apache/isis/commons/handler/ChainOfResponsibility.java b/commons/src/main/java/org/apache/isis/commons/handler/ChainOfResponsibility.java
new file mode 100644
index 0000000..120f9c0
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/handler/ChainOfResponsibility.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.handler;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * Building blocks for the <em>Chain of Responsibility</em> design pattern.
+ * <p>
+ * <em>Chain of Responsibility</em> allows passing requests along the chain of handlers,
+ * until one of them handles the request.
+ *
+ * @since 2.0
+ *
+ * @param <X> request type
+ * @param <R> response type
+ */
+public interface ChainOfResponsibility<X, R> {
+
+ /**
+ * The {@code request} is passed along the chain of handlers, until one of them handles the request.
+ * @param request
+ * @return response of the first handler that handled the request wrapped in an Optional,
+ * or an empty Optional, if no handler handled the request
+ */
+ Optional<R> handle(X request);
+
+ /**
+ * A chain of responsibility is made up of handlers, that are asked in sequence,
+ * whether they handle a request.
+ *
+ * @since 2.0
+ *
+ * @param <X> request type
+ * @param <R> response type
+ */
+ static interface Handler<X, R> {
+ boolean isHandling(X request);
+ R handle(X request);
+ }
+
+ /**
+ * Creates a new ChainOfResponsibility of given {@code chainOfHandlers}
+ * @param <X>
+ * @param <R>
+ * @param chainOfHandlers
+ * @return
+ */
+ static <X, R> ChainOfResponsibility<X, R>
+ of(
+ final List<? extends ChainOfResponsibility.Handler<? super X, R>> chainOfHandlers) {
+
+ return request -> {
+
+ final Optional<R> responseIfAny = chainOfHandlers.stream()
+ .filter(h -> h.isHandling(request))
+ .findFirst()
+ .map(h -> h.handle(request));
+ return responseIfAny;
+ };
+
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java b/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
new file mode 100644
index 0000000..53e4f33
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+
+import org.springframework.context.annotation.Primary;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * A collection of commonly used constants.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Constants {
+
+ private _Constants(){}
+
+ /**
+ * Convenient e.g. for reflective invocation
+ */
+ public static final Object[] emptyObjects = new Object[0];
+
+ /**
+ * Convenient e.g. for reflective invocation
+ */
+ public static final Class<?>[] emptyClasses = new Class[0];
+
+ /**
+ * Convenient e.g. for toArray conversions
+ */
+ public static final String[] emptyStringArray = new String[0];
+
+ /**
+ * empty array of byte
+ */
+ public static final byte[] emptyBytes = new byte[0];
+
+ /**
+ * empty array of Annotation
+ */
+ public static final Annotation[] emptyAnnotations = new Annotation[0];
+
+ /**
+ * Writer that does nothing
+ */
+ public static final Writer nopWriter = new Writer() {
+ @Override public void write(char[] cbuf, int off, int len) throws IOException { }
+ @Override public void flush() throws IOException { }
+ @Override public void close() throws IOException { }
+ };
+
+ /**
+ * OutputStream that does nothing
+ */
+ public static final OutputStream nopOutputStream = new OutputStream() {
+ @Override public void write(int b) throws IOException { }
+ };
+
+ /**
+ * PrintStream that does nothing
+ */
+ public static final PrintStream nopPrintStream = new PrintStream(nopOutputStream);
+
+ @Primary private static final class PrimaryAnnotated {}
+ public static final Primary ANNOTATION_PRIMARY = PrimaryAnnotated.class.getAnnotation(Primary.class);
+
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/assertions/_Assert.java b/commons/src/main/java/org/apache/isis/commons/internal/assertions/_Assert.java
new file mode 100644
index 0000000..74b272c
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/assertions/_Assert.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.assertions;
+
+import java.util.Objects;
+import java.util.function.Supplier;
+
+import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+import org.apache.isis.commons.internal.primitives._Ints;
+import org.apache.isis.commons.internal.primitives._Longs;
+
+import lombok.val;
+import lombok.experimental.UtilityClass;
+import lombok.extern.log4j.Log4j2;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * A collection of commonly used constants.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+@UtilityClass
+@Log4j2
+public final class _Assert {
+
+
+ // -- TRUE
+
+ public static void assertTrue(boolean condition) {
+ assertTrue(condition, (String) null);
+ }
+
+ public static void assertTrue(boolean condition, String message) {
+ if (!condition) {
+ fail(message, true, false);
+ }
+ }
+
+ public static void assertTrue(boolean condition, Supplier<String> lazyMessage) {
+ if (!condition) {
+ fail(lazyMessage.get(), true, false);
+ }
+ }
+
+ // -- FALSE
+
+ public static void assertFalse(boolean condition) {
+ assertFalse(condition, (String) null);
+ }
+
+ public static void assertFalse(boolean condition, String message) {
+ if (condition) {
+ fail(message, false, true);
+ }
+ }
+
+ public static void assertFalse(boolean condition, Supplier<String> lazyMessage) {
+ if (condition) {
+ fail(lazyMessage.get(), true, false);
+ }
+ }
+
+ // -- NOT NULL
+
+ public static void assertNotNull(Object object) {
+ assertNotNull(object, (String) null);
+ }
+
+ public static void assertNotNull(Object object, String message) {
+ if (object==null) {
+ fail(message, "not null", "null");
+ }
+ }
+
+ public static void assertNotNull(Object object, Supplier<String> lazyMessage) {
+ if (object==null) {
+ fail(lazyMessage.get(), "not null", "null");
+ }
+ }
+
+ /**
+ * <em>Assert</em> that {@code expected} and {@code actual} are equal.
+ * <p>If both are {@code null}, they are considered equal.
+ *
+ * @see Object#equals(Object)
+ */
+ public static void assertEquals(Object left, Object right) {
+ assertEquals(left, right, (String) null);
+ }
+
+ /**
+ * <em>Assert</em> that {@code expected} and {@code actual} are equal.
+ * <p>If both are {@code null}, they are considered equal.
+ * <p>Fails with the supplied failure {@code message}.
+ *
+ * @see Object#equals(Object)
+ */
+ public static void assertEquals(Object left, Object right, String message) {
+ if (!Objects.equals(left, right)) {
+ fail(message, left, right);
+ }
+ }
+
+ public static void assertEquals(Object left, Object right, Supplier<String> lazyMessage) {
+ if (!Objects.equals(left, right)) {
+ fail(lazyMessage.get(), left, right);
+ }
+ }
+
+ // -- RANGE CHECKS
+
+ public static void assertRangeContains(_Ints.Range range, int value, String message) {
+ if(!range.contains(value)) {
+ fail(message, range.toString(), value);
+ }
+ }
+
+ public static void assertRangeContains(_Ints.Range range, int value, Supplier<String> lazyMessage) {
+ if(!range.contains(value)) {
+ fail(lazyMessage.get(), range.toString(), value);
+ }
+ }
+
+ public static void assertRangeContains(_Longs.Range range, long value, String message) {
+ if(!range.contains(value)) {
+ fail(message, range.toString(), value);
+ }
+ }
+
+ public static void assertRangeContains(_Longs.Range range, long value, Supplier<String> lazyMessage) {
+ if(!range.contains(value)) {
+ fail(lazyMessage.get(), range.toString(), value);
+ }
+ }
+
+ // -- TYPE INSTANCE OF
+
+ public static void assertTypeIsInstanceOf(Class<?> type, Class<?> requiredType) {
+ if(!requiredType.isAssignableFrom(type)) {
+ throw _Exceptions.assertionError(String.format(
+ "unexpected type: <%s> is not an instance of <%s> ", ""+type, ""+requiredType));
+ }
+ }
+
+ // -- HELPER
+
+ static String buildPrefix(String message) {
+ return _Strings.isNotEmpty(message) ? message + " ==> " : "";
+ }
+
+ private static void fail(String message, Object expected, Object actual) {
+ val error = _Exceptions.assertionError(
+ buildPrefix(message)
+ + String.format("expected: <%s> but was: <%s>", ""+expected, ""+actual));
+ log.error(error); // in case exceptions get swallowed, make sure errors at least get logged
+ throw error;
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Blackhole.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Blackhole.java
new file mode 100644
index 0000000..bdfc67f
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Blackhole.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.lang.ref.WeakReference;
+import java.util.Random;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * "consumes" the values, conceiving no information to JIT whether the value is actually used afterwards.
+ * This can save from the dead-code elimination of the computations resulting in the given values.
+ * </p>
+ * <p>
+ * This is a poor man's version of JMH's Blackhole (org.openjdk.jmh.infra.Blackhole).
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Blackhole {
+
+ /**
+ * Consume object. This call provides a side effect preventing JIT to eliminate dependent computations.
+ *
+ * @param obj object to consume.
+ */
+ public static void consume(Object obj) {
+
+ int tlrMask = internal.tlrMask; // volatile read
+ int tlr = (internal.tlr = (internal.tlr * 1664525 + 1013904223));
+
+ if ((tlr & tlrMask) == 0) {
+ // SHOULD ALMOST NEVER HAPPEN
+ internal.obj1 = new WeakReference<>(obj);
+ internal.tlrMask = (tlrMask << 1) + 1;
+ }
+
+ }
+
+ // -- HELPER
+
+ public static final class _Blackhole_Internal {
+
+ public int tlr;
+ public volatile int tlrMask;
+ public volatile Object obj1;
+
+ public _Blackhole_Internal() {
+ Random r = new Random(System.nanoTime());
+ tlr = r.nextInt();
+ tlrMask = 1;
+ obj1 = new Object();
+ }
+
+ }
+
+ private static final _Blackhole_Internal internal = new _Blackhole_Internal();
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes.java
new file mode 100644
index 0000000..3a6e5bf
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes.java
@@ -0,0 +1,283 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Base64;
+import java.util.function.UnaryOperator;
+
+import javax.annotation.Nullable;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides byte[] related algorithms.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Bytes {
+
+ private _Bytes(){}
+
+ // -- CONSTRUCTION
+
+ private static final int BUFFER_SIZE = 16 * 1024; // 16k
+
+ /**
+ * Reads the input stream into an array of byte, then closes the input (-stream).
+ * @param input
+ * @return null if {@code input} is null
+ * @throws IOException
+ */
+ public static byte[] of(@Nullable final InputStream input) throws IOException {
+ if(input==null) {
+ return null;
+ }
+
+ try(final ByteArrayOutputStream bos = new ByteArrayOutputStream()){
+ final byte[] buffer = new byte[BUFFER_SIZE];
+
+ int nRead;
+ while ((nRead = input.read(buffer, 0, buffer.length)) != -1) {
+ bos.write(buffer, 0, nRead);
+ }
+ bos.flush();
+ return bos.toByteArray();
+ } finally {
+ input.close();
+ }
+ }
+
+ /**
+ * Reads the input stream into an array of byte, but does not close the input (-stream).
+ * @param input
+ * @return null if {@code input} is null
+ * @throws IOException
+ */
+ public static byte[] ofKeepOpen(@Nullable final InputStream input) throws IOException {
+ if(input==null) {
+ return null;
+ }
+
+ try(final ByteArrayOutputStream bos = new ByteArrayOutputStream()){
+ final byte[] buffer = new byte[BUFFER_SIZE];
+
+ int nRead;
+ while ((nRead = input.read(buffer, 0, buffer.length)) != -1) {
+ bos.write(buffer, 0, nRead);
+ }
+ bos.flush();
+ return bos.toByteArray();
+ }
+ }
+
+ // -- PREPEND/APPEND
+
+ /**
+ * Copies all bytes from {@code bytes} followed by all bytes from {@code target} into a newly-allocated byte array.
+ * @param target
+ * @param bytes to be prepended to {@code target}
+ * @return bytes + target, or null if both {@code target} and {@code bytes} are null
+ */
+ public static final byte[] prepend(@Nullable final byte[] target, @Nullable final byte ... bytes) {
+ if(target==null) {
+ if(bytes==null) {
+ return null;
+ }
+ return bytes.clone();
+ }
+ if(bytes==null) {
+ return target.clone();
+ }
+ final byte[] result = new byte[target.length + bytes.length];
+ System.arraycopy(bytes, 0, result, 0, bytes.length);
+ System.arraycopy(target, 0, result, bytes.length, target.length);
+ return result;
+ }
+
+ /**
+ * Copies all bytes from {@code target} followed by all bytes from {@code bytes} into a newly-allocated byte array.
+ * @param target
+ * @param bytes to be appended to {@code target}
+ * @return target + bytes, or null if both {@code target} and {@code bytes} are null
+ */
+ public static final byte[] append(@Nullable final byte[] target, @Nullable final byte ... bytes) {
+ if(target==null) {
+ if(bytes==null) {
+ return null;
+ }
+ return bytes.clone();
+ }
+ if(bytes==null) {
+ return target.clone();
+ }
+ final byte[] result = new byte[target.length + bytes.length];
+ System.arraycopy(target, 0, result, 0, target.length);
+ System.arraycopy(bytes, 0, result, target.length, bytes.length);
+ return result;
+ }
+
+ // -- BASE-64 ENCODING
+
+ /**
+ * Encodes all bytes from the specified byte array into a newly-allocated byte array using
+ * the specified {@code encoder}.
+ * @param encoder
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static final byte[] encodeToBase64(Base64.Encoder encoder, @Nullable final byte[] input) {
+ requires(encoder, "encoder");
+ return input!=null ? encoder.encode(input) : null;
+ }
+
+ /**
+ * Decodes all bytes from the input byte array using the specified {@code decoder}, writing the
+ * results into a newly-allocated output byte array.
+ * @param decoder
+ * @param base64
+ * @return null if {@code base64} is null
+ */
+ public static final byte[] decodeBase64(Base64.Decoder decoder, @Nullable final byte[] base64) {
+ requires(decoder, "decoder");
+ return base64!=null ? decoder.decode(base64) : null;
+ }
+
+ // -- COMPRESSION
+
+ /**
+ * Compresses the given byte array, without being specific about the used algorithm.<br/>
+ * However, following symmetry holds: <br/>
+ * {@code x == decompress(compress(x))}
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static final byte[] compress(@Nullable byte[] input) {
+ if(input==null) {
+ return null;
+ }
+ if(input.length==0) {
+ return input;
+ }
+ try {
+ return _Bytes_GZipCompressorSmart.compress(input);
+ } catch (IOException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ /**
+ * Decompresses the given byte array, without being specific about the used algorithm.<br/>
+ * However, following symmetry holds: <br/>
+ * {@code x == decompress(compress(x))}
+ * @param compressed
+ * @return null if {@code compressed} is null
+ */
+ public static final byte[] decompress(@Nullable byte[] compressed) {
+ if(compressed==null) {
+ return null;
+ }
+ if(compressed.length==0) {
+ return compressed;
+ }
+ try {
+ return _Bytes_GZipCompressorSmart.decompress(compressed);
+ } catch (IOException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ // -- UNARY OPERATOR COMPOSITION
+
+ /**
+ * Monadic BytesOperator that allows composition of unary byte[] operators.
+ */
+ public static final class BytesOperator {
+
+ private final UnaryOperator<byte[]> operator;
+
+ private BytesOperator(UnaryOperator<byte[]> operator) {
+ this.operator = requires(operator, "operator");
+ }
+
+ public byte[] apply(byte[] input) {
+ return operator.apply(input);
+ }
+
+ public BytesOperator andThen(UnaryOperator<byte[]> andThen) {
+ return new BytesOperator(s->andThen.apply(operator.apply(s)));
+ }
+
+ }
+
+ /**
+ * Returns a monadic BytesOperator that allows composition of unary byte[] operators
+ * @return
+ */
+ public static BytesOperator operator() {
+ return new BytesOperator(UnaryOperator.identity());
+ }
+
+ // -- SPECIAL COMPOSITES
+
+ // using naming convention asX .. encode / ofX .. decode
+
+ public static final BytesOperator asUrlBase64 = operator()
+ .andThen(bytes->encodeToBase64(Base64.getUrlEncoder(), bytes));
+
+ public static final BytesOperator ofUrlBase64 = operator()
+ .andThen(bytes->decodeBase64(Base64.getUrlDecoder(), bytes));
+
+ public static final BytesOperator asCompressedUrlBase64 = operator()
+ .andThen(_Bytes::compress)
+ .andThen(bytes->encodeToBase64(Base64.getUrlEncoder(), bytes));
+
+ public static final BytesOperator ofCompressedUrlBase64 = operator()
+ .andThen(bytes->decodeBase64(Base64.getUrlDecoder(), bytes))
+ .andThen(_Bytes::decompress);
+
+ public static final BytesOperator asBase64 = operator()
+ .andThen(bytes->encodeToBase64(Base64.getEncoder(), bytes));
+
+ public static final BytesOperator ofBase64 = operator()
+ .andThen(bytes->decodeBase64(Base64.getDecoder(), bytes));
+
+ public static final BytesOperator asCompressedBase64 = operator()
+ .andThen(_Bytes::compress)
+ .andThen(bytes->encodeToBase64(Base64.getEncoder(), bytes));
+
+ public static final BytesOperator ofCompressedBase64 = operator()
+ .andThen(bytes->decodeBase64(Base64.getDecoder(), bytes))
+ .andThen(_Bytes::decompress);
+
+
+ // --
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressor.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressor.java
new file mode 100644
index 0000000..59575dc
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressor.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ *
+ * package private mixin for utility class {@link _Bytes}
+ *
+ */
+final class _Bytes_GZipCompressor {
+
+ static byte[] compress(final byte[] input) throws IOException {
+
+ final int BUFFER_SIZE = Math.max(256, input.length); // at least 256
+
+ final ByteArrayOutputStream os = new ByteArrayOutputStream(BUFFER_SIZE);
+ final GZIPOutputStream gos = new GZIPOutputStream(os);
+ gos.write(input);
+ gos.close();
+
+ return os.toByteArray();
+ }
+
+ static byte[] decompress(byte[] compressed) throws IOException {
+
+ final int BUFFER_SIZE = 32;
+
+ final ByteArrayInputStream is = new ByteArrayInputStream(compressed);
+ final GZIPInputStream gis = new GZIPInputStream(is, BUFFER_SIZE);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final byte[] data = new byte[BUFFER_SIZE];
+ int bytesRead;
+ while ((bytesRead = gis.read(data)) != -1) {
+ baos.write(data, 0, bytesRead);
+ }
+ gis.close();
+ return baos.toByteArray();
+ }
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressorSmart.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressorSmart.java
new file mode 100644
index 0000000..683f666
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Bytes_GZipCompressorSmart.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+/**
+ *
+ * package private mixin for utility class {@link _Bytes}
+ *
+ */
+final class _Bytes_GZipCompressorSmart {
+
+ private static final int INPUT_LENGTH_THRESHOLD_FOR_SMART_COMPRESSION = 256;
+ private static final int GZIP_MIN_OVERHEAD = 18;
+ private static final byte COMPRESSION_NONE = 0;
+ private static final byte COMPRESSION_GZIP = 1;
+
+ static byte[] compress(byte[] input) throws IOException {
+ if(input.length<GZIP_MIN_OVERHEAD) {
+ return input;
+ }
+ if(input.length<INPUT_LENGTH_THRESHOLD_FOR_SMART_COMPRESSION) {
+ return _Bytes.prepend(input, COMPRESSION_NONE); // prefix the input
+ } else {
+ return _Bytes.prepend(_Bytes_GZipCompressor.compress(input), COMPRESSION_GZIP); // prefix the input
+ }
+ }
+
+ static byte[] decompress(byte[] input) throws IOException {
+ if(input==null || input.length<GZIP_MIN_OVERHEAD)
+ return input;
+
+ final byte[] inputWithoutPrefix = Arrays.copyOfRange(input, 1, input.length);
+
+ return isCompressed(input) ? _Bytes_GZipCompressor.decompress(inputWithoutPrefix) : inputWithoutPrefix;
+
+ }
+
+ // -- HELPER
+
+ private static boolean isCompressed(byte[] input) {
+ switch (input[0]) {
+ case COMPRESSION_NONE:
+ return false;
+ case COMPRESSION_GZIP:
+ return true;
+ default:
+ throw _Exceptions.unmatchedCase(input[0]);
+ }
+
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Casts.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Casts.java
new file mode 100644
index 0000000..cd433c1
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Casts.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.Optional;
+import java.util.function.BiFunction;
+
+import javax.annotation.Nullable;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Casting Utilities
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Casts {
+
+ private _Casts(){}
+
+ @SuppressWarnings("unchecked")
+ public static <T> T uncheckedCast(@Nullable Object obj) {
+ return (T) obj;
+ }
+
+ /**
+ * Casts an object to the class or interface represented by given {@code cls} Class object,
+ * then wraps the result in an {@link Optional}. The {@link Optional} is empty if the cast
+ * fails or provided {@code value} is {@code null}.
+ * @param <T>
+ * @param value
+ * @param cls
+ * @return non-null
+ */
+ public static <T> Optional<T> castTo(@Nullable Object value, Class<T> cls) {
+ if(value==null) {
+ return Optional.empty();
+ }
+ requires(cls, "cls");
+ if(cls.isAssignableFrom(value.getClass())) {
+ return Optional.of(cls.cast(value));
+ }
+ return Optional.empty();
+ }
+
+ /**
+ * Casts an object to the class or interface represented by given {@code cls} Class object.
+ * Returns {@code null}, if the cast fails or provided {@code value} is {@code null}.
+ * @param <T>
+ * @param value
+ * @param cls
+ * @return casted value, or null
+ */
+ public static @Nullable <T> T castToOrElseNull(@Nullable Object value, Class<T> cls) {
+ if(value==null) {
+ return null;
+ }
+ requires(cls, "cls");
+ if(cls.isAssignableFrom(value.getClass())) {
+ return cls.cast(value);
+ }
+ return null;
+ }
+
+ /**
+ * Dependent on whether left or right can be cast to {@code cls}, the appropriate functional
+ * interface is chosen to produce the result.
+ * @param left
+ * @param right
+ * @param cls
+ * @param onBothCast
+ * @param onLeftCast
+ * @param onRightCast
+ * @param onNonCast
+ * @return
+ */
+ public static <T, R, U, V> R castThenApply(
+ @Nullable U left,
+ @Nullable V right,
+ Class<T> cls,
+ BiFunction<T, T, R> onBothCast,
+ BiFunction<T, V, R> onLeftCast,
+ BiFunction<U, T, R> onRightCast,
+ BiFunction<U, V, R> onNonCast) {
+
+ requires(cls, "cls");
+
+ T left_casted=null, right_casted=null;
+ boolean left_not_casted=false, right_not_casted=false;
+
+ if(left==null) {
+ left_casted = null;
+ } else if(cls.isAssignableFrom(left.getClass())) {
+ left_casted = cls.cast(left);
+ } else {
+ left_not_casted = true;
+ }
+
+ if(right==null) {
+ right_casted = null;
+ } else if(cls.isAssignableFrom(right.getClass())) {
+ right_casted = cls.cast(right);
+ } else {
+ right_not_casted = true;
+ }
+
+ if(left_not_casted && right_not_casted) {
+ return onNonCast.apply(left, right);
+ }
+
+ if(!left_not_casted && !right_not_casted) {
+ return onBothCast.apply(left_casted, right_casted);
+ }
+
+ if(left_not_casted) {
+ return onRightCast.apply(left, right_casted);
+ }
+
+ return onLeftCast.apply(left_casted, right);
+
+ }
+
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Either.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Either.java
new file mode 100644
index 0000000..d8008c4
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Either.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.Optional;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+import javax.annotation.Nullable;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+import lombok.AccessLevel;
+import lombok.EqualsAndHashCode;
+import lombok.RequiredArgsConstructor;
+import lombok.ToString;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * A holder of either a left or right reference, only one of both can be present.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+@RequiredArgsConstructor(access=AccessLevel.PRIVATE, staticName="of")
+@ToString @EqualsAndHashCode
+public final class _Either<L, R> {
+
+ private final L left;
+ private final R right;
+ private final boolean isLeft;
+
+ // -- FACTORIES
+
+ public static <L, R> _Either<L, R> left(L left) {
+ requires(left, "left");
+ return of(left, null, true);
+ }
+
+ public static <L, R> _Either<L, R> right(R right) {
+ requires(right, "right");
+ return of(null, right, false);
+ }
+
+ public static <L, R> _Either<L, R> leftNullable(@Nullable L left) {
+ return of(left, null, true);
+ }
+
+ public static <L, R> _Either<L, R> rightNullable(@Nullable R right) {
+ return of(null, right, false);
+ }
+
+ // -- ACCESSORS
+
+ public Optional<L> left() {
+ return Optional.ofNullable(left);
+ }
+
+ public Optional<R> right() {
+ return Optional.ofNullable(right);
+ }
+
+ public L leftIfAny() {
+ return left;
+ }
+
+ public R rightIfAny() {
+ return right;
+ }
+
+ // -- PREDICATES
+
+ public boolean isLeft() {
+ return isLeft;
+ }
+
+ public boolean isRight() {
+ return !isLeft;
+ }
+
+ public boolean isPresentLeft() {
+ return left!=null;
+ }
+
+ public boolean isPresentRight() {
+ return right!=null;
+ }
+
+ // -- COMPOSITION
+
+ public <X, Y> _Either<X, Y> map(Function<L, X> leftMapper, Function<R, Y> rightMapper){
+ return isLeft()
+ ? left(leftMapper.apply(left))
+ : right(rightMapper.apply(right));
+ }
+
+ public <X, Y> _Either<X, Y> mapNullable(Function<L, X> leftMapper, Function<R, Y> rightMapper){
+ return isLeft()
+ ? leftNullable(leftMapper.apply(left))
+ : rightNullable(rightMapper.apply(right));
+ }
+
+ public _Either<L, R> leftRemap(Function<L, _Either<L, R>> leftRemapper){
+ return isLeft()
+ ? leftRemapper.apply(left)
+ : this;
+ }
+
+ public _Either<L, R> rightReMap(Function<R, _Either<L, R>> rightRemapper){
+ return isLeft()
+ ? this
+ : rightRemapper.apply(right);
+ }
+
+ // -- REDUCTION
+
+ public <X> X get(BiFunction<L, R, X> reduction){
+ return reduction.apply(left, right);
+ }
+
+ public <X> X get(Function<L, X> leftMapper, Function<R, X> rightMapper){
+ return isLeft()
+ ? leftMapper.apply(left)
+ : rightMapper.apply(right);
+ }
+
+ // -- TERMINALS
+
+ public void accept(Consumer<L> leftConsumer, Consumer<R> rightConsumer) {
+ if(isLeft()) {
+ leftConsumer.accept(left);
+ } else {
+ rightConsumer.accept(right);
+ }
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java
new file mode 100644
index 0000000..a51681a
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.base;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+
+import javax.annotation.Nullable;
+
+import lombok.NonNull;
+import lombok.val;
+
+public class _Files {
+
+ /**
+ * Recursive file search, starting at {@code dir}, going deeper based on predicate
+ * {@code dirFilter}, collecting files (not directories) based on predicate
+ * {@code fileFilter}.
+ * @param dir
+ * @param dirFilter
+ * @param fileFilter
+ * @return set of matching files
+ * @throws IOException
+ */
+ public static Set<File> searchFiles(
+ final File dir,
+ final Predicate<File> dirFilter,
+ final Predicate<File> fileFilter) throws IOException {
+
+ final Set<File> fileList = new HashSet<>();
+ searchFiles(dir, dirFilter, fileFilter, fileList::add);
+ return fileList;
+ }
+
+ /**
+ * Recursive file search, starting at {@code dir}, going deeper based on predicate
+ * {@code dirFilter}, consuming files (not directories) based on predicate
+ * {@code fileFilter}.
+ * @param dir
+ * @param dirFilter
+ * @param fileFilter
+ * @param onFileFound
+ * @throws IOException
+ */
+ public static void searchFiles(
+ final File dir,
+ final Predicate<File> dirFilter,
+ final Predicate<File> fileFilter,
+ final Consumer<File> onFileFound) throws IOException {
+
+ try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir.toPath())) {
+ for (Path path : stream) {
+ val file = path.toFile();
+ if (Files.isDirectory(path)) {
+ if(dirFilter.test(file)) {
+ // go deeper
+ searchFiles(file, dirFilter, fileFilter, onFileFound);
+ }
+ } else {
+ if(fileFilter.test(file)) {
+ onFileFound.accept(file);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @param file
+ * @return optionally {@code file.getCanonicalPath()} based on whether {@code file}
+ * is not {@code null} and the 'file I/O system' can handle this call without
+ * throwing an exception.
+ */
+ public static Optional<String> canonicalPath(@Nullable File file) {
+ if(file==null) {
+ return Optional.empty();
+ }
+ try {
+ return Optional.of(file.getCanonicalPath());
+ } catch (Exception e) {
+ return Optional.empty();
+ }
+ }
+
+ /**
+ *
+ * @param commonPath
+ * @param absolutePath
+ * @return prefix removed from {@code absolutePath}, if {@code commonPath} appears to be a prefix
+ * of {@code absolutePath}, otherwise returns the {@code absolutePath} unmodified.
+ */
+ public static String toRelativePath(@NonNull String commonPath, @NonNull String absolutePath) {
+ if(absolutePath.startsWith(commonPath)) {
+ return absolutePath.substring(commonPath.length());
+ }
+ return absolutePath;
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy.java
new file mode 100644
index 0000000..def502c
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.function.Supplier;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * (non-thread-safe) Supplier with memoization.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public interface _Lazy<T> extends Supplier<T> {
+
+ // -- INTERFACE
+
+ /**
+ * @return whether this lazy got initialized and holds a memoized value
+ */
+ public boolean isMemoized();
+
+ /**
+ * Clears the lazy's memoized value. Resets this lazy to its initial state.<br>
+ * isMemoized() = false;
+ *
+ */
+ public void clear();
+
+ /**
+ * Evaluates this lazy value and memoizes it, when called the first time
+ * after initialization or clear().
+ * <p>
+ * Postcondition when memoization throws an exception: isMemoized()->true and get()->null
+ */
+ @Override
+ public T get();
+
+ /**
+ * Sets the memoized value, if not already memoized.
+ * @param value
+ * @throws IllegalStateException if already memoized
+ */
+ public void set(T value);
+
+
+ // -- FACTORIES
+
+ /**
+ * Concurrent calls to this lazy's get() method might result in concurrent calls to the
+ * specified {@code supplier}.
+ * @param supplier
+ * @return an (non-thread-safe) instance of _Lacy that initializes with the specified {@code supplier}
+ */
+ public static <T> _Lazy<T> of(Supplier<? extends T> supplier) {
+ return new _Lazy_Simple<T>(supplier);
+ }
+
+ /**
+ * Thread-safe variant to {@link _Lazy#of(Supplier)}.
+ * Concurrent calls to this lazy's get() method will never result in concurrent calls to the
+ * specified {@code supplier}.
+ * @param supplier
+ * @return an (thread-safe) instance of _Lacy that initializes with the specified {@code supplier}
+ */
+ public static <T> _Lazy<T> threadSafe(Supplier<? extends T> supplier) {
+ return new _Lazy_ThreadSafe<T>(supplier);
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_Simple.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_Simple.java
new file mode 100644
index 0000000..9b24018
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_Simple.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.function.Supplier;
+
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+/**
+ * package private mixin for _Lazy
+ * @since 2.0
+ */
+final class _Lazy_Simple<T> implements _Lazy<T> {
+
+ private final Supplier<? extends T> supplier;
+ private T value;
+ private boolean memoized;
+
+ _Lazy_Simple(Supplier<? extends T> supplier) {
+ this.supplier = requires(supplier, "supplier");
+ }
+
+ @Override
+ public boolean isMemoized() {
+ return memoized;
+ }
+
+ @Override
+ public void clear() {
+ this.memoized = false;
+ this.value = null;
+ }
+
+ @Override
+ public T get() {
+ if(memoized) {
+ return value;
+ }
+ memoized = true;
+ return value = supplier.get();
+ }
+
+ @Override
+ public void set(T value) {
+ if(memoized) {
+ throw _Exceptions.illegalState("cannot set value '%s' on Lazy that has already memoized a value", ""+value);
+ }
+ memoized = true;
+ this.value = value;
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafe.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafe.java
new file mode 100644
index 0000000..0048e61
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafe.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.function.Supplier;
+
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+/**
+ * package private mixin for _Lazy
+ * @since 2.0
+ */
+final class _Lazy_ThreadSafe<T> implements _Lazy<T> {
+
+ private final Supplier<? extends T> supplier;
+ private T value;
+ private boolean memoized;
+
+ _Lazy_ThreadSafe(Supplier<? extends T> supplier) {
+ this.supplier = requires(supplier, "supplier");
+ }
+
+ @Override
+ public boolean isMemoized() {
+ synchronized (this) {
+ return memoized;
+ }
+ }
+
+ @Override
+ public void clear() {
+ synchronized (this) {
+ this.memoized = false;
+ this.value = null;
+ }
+ }
+
+ @Override
+ public T get() {
+ synchronized (this) {
+ if(memoized) {
+ return value;
+ }
+ memoized = true;
+ return value = supplier.get();
+ }
+ }
+
+ @Override
+ public void set(T value) {
+ synchronized (this) {
+ if(memoized) {
+ throw _Exceptions.illegalState("cannot set value '%s' on Lazy that has already memoized a value", ""+value);
+ }
+ memoized = true;
+ this.value = value;
+ }
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_NullSafe.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_NullSafe.java
new file mode 100644
index 0000000..8688d61
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_NullSafe.java
@@ -0,0 +1,332 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.base;
+
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+import javax.annotation.Nullable;
+
+import org.apache.isis.commons.collections.Can;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides convenient null check / null safe methods primarily
+ * to shortcut null-check idioms.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ *
+ */
+public final class _NullSafe {
+
+ private _NullSafe(){}
+
+ // -- STREAM CREATION
+
+ /**
+ * If {@code array} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the array's elements.
+ * @param array
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final T[] array) {
+ return array!=null ? Stream.of(array) : Stream.empty();
+ }
+
+ /**
+ * If {@code nullable} is {@code null} returns the empty stream,
+ * otherwise returns a Stream containing the single element {@code nullable}.
+ *
+ * @param nullable
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> streamNullable(@Nullable final T nullable) {
+ return nullable != null ? Stream.of(nullable) : Stream.empty();
+ }
+
+ /**
+ * If {@code can} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the can's elements.
+ * @param can
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final Can<T> can){
+ return can!=null ? can.stream() : Stream.empty();
+ }
+
+ /**
+ * If {@code collection} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the collection's elements.
+ * @param coll
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final Collection<T> coll){
+ return coll!=null ? coll.stream() : Stream.empty();
+ }
+
+ /**
+ * If {@code iterable} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the iterable's elements.
+ * @param iterable
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final Iterable<T> iterable){
+ return iterable!=null ? stream(iterable.iterator()) : Stream.empty();
+ }
+
+ /**
+ * If {@code iterator} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the iterator's elements.
+ * @param iterator
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final Iterator<T> iterator){
+ return iterator!=null
+ ? StreamSupport.stream(
+ Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED),
+ false) //not parallel
+ : Stream.empty();
+ }
+
+ /**
+ * If {@code stream} is {@code null} returns the empty stream,
+ * otherwise returns the stream argument.
+ * @param stream
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(@Nullable final Stream<T> stream) {
+ return stream!=null ? stream : Stream.empty();
+ }
+
+ /**
+ * If {@code enumeration} is {@code null} returns the empty stream,
+ * otherwise returns a stream of the enumeration's elements.
+ * @param enumeration
+ * @return non-null stream object
+ */
+ public static <T> Stream<T> stream(final Enumeration<T> enumeration){
+ return enumeration!=null
+ ? StreamSupport.stream(toSpliterator(enumeration), /*parallel*/false)
+ : Stream.empty();
+ }
+
+ // not public, used internally for stream(Enumeration) only
+ private static <T> Spliterator<T> toSpliterator(final Enumeration<T> e){
+ return new Spliterators.AbstractSpliterator<T>(Long.MAX_VALUE, Spliterator.ORDERED) {
+ public boolean tryAdvance(Consumer<? super T> action) {
+ if(e.hasMoreElements()) {
+ action.accept(e.nextElement());
+ return true;
+ }
+ return false;
+ }
+ public void forEachRemaining(Consumer<? super T> action) {
+ while(e.hasMoreElements()) {
+ action.accept(e.nextElement());
+ }
+ }
+ };
+ }
+
+ public static Stream<?> streamAutodetect(@Nullable Object pojo) {
+ if(pojo==null) {
+ return Stream.empty();
+ }
+ if(pojo instanceof Collection) {
+ return ((Collection<?>)pojo).stream();
+ }
+ if(pojo instanceof Can) {
+ return ((Can<?>)pojo).stream();
+ }
+ if(pojo.getClass().isArray()) {
+ if(Array.getLength(pojo)==0) return Stream.empty();
+ if(pojo instanceof Object[]) return Stream.of((Object[]) pojo);
+ if(pojo instanceof boolean[]) return primitiveStream((boolean[]) pojo);
+ if(pojo instanceof byte[]) return primitiveStream((byte[]) pojo);
+ if(pojo instanceof char[]) return primitiveStream((char[]) pojo);
+ if(pojo instanceof double[]) return primitiveStream((double[]) pojo);
+ if(pojo instanceof float[]) return primitiveStream((float[]) pojo);
+ if(pojo instanceof int[]) return primitiveStream((int[]) pojo);
+ if(pojo instanceof long[]) return primitiveStream((long[]) pojo);
+ if(pojo instanceof short[]) return primitiveStream((short[]) pojo);
+ }
+ if(pojo instanceof Iterable) {
+ return stream((Iterable<?>)pojo);
+ }
+ if(pojo instanceof Enumeration) {
+ return stream((Enumeration<?>)pojo);
+ }
+ return Stream.of(pojo);
+ }
+
+ private static Stream<Boolean> primitiveStream(final boolean[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Byte> primitiveStream(final byte[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Character> primitiveStream(final char[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Float> primitiveStream(final float[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Double> primitiveStream(final double[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Short> primitiveStream(final short[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Integer> primitiveStream(final int[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ private static Stream<Long> primitiveStream(final long[] array) {
+ return IntStream.range(0, array.length).mapToObj(s -> array[s]);
+ }
+
+ // -- ABSENCE/PRESENCE PREDICATES
+
+
+ /**
+ * Equivalent to {@link java.util.Objects#nonNull(Object)}.
+ * @param x
+ * @return whether {@code x} is not null (present).
+ *
+ * @apiNote we keep this, arguably provides better code readability than {@code Objects#nonNull}
+ */
+ public static boolean isPresent(Object x) {
+ return x!=null;
+ }
+
+ /**
+ * Equivalent to {@link java.util.Objects#isNull(Object)}.
+ * @param x
+ * @return whether {@code x} is null (absent).
+ *
+ * @apiNote we keep this, arguably provides better code readability than {@code Objects#isNull}
+ */
+ public static boolean isAbsent(Object x) {
+ return x==null;
+ }
+
+ // -- EQUALS/COMPARE
+
+ /**
+ * equivalent to {@link java.util.Objects#equals(Object, Object)}
+ */
+ public static boolean equals(final Object x, final Object y) {
+ return Objects.equals(x, y);
+ }
+
+ /**
+ * Natural order compare, with nulls ordered first.
+ * @param x
+ * @param y
+ * @return
+ */
+ public static <T extends Comparable<T>> int compareNullsFirst(final T x, final T y) {
+ return Objects.compare(x, y, Comparator.nullsFirst(Comparator.naturalOrder()));
+
+ }
+
+ /**
+ * Natural order compare, with nulls ordered last.
+ * @param x
+ * @param y
+ * @return
+ */
+ public static <T extends Comparable<T>> int compareNullsLast(final T x, final T y) {
+ return Objects.compare(x, y, Comparator.nullsLast(Comparator.naturalOrder()));
+
+ }
+
+ // -- EMTPY CHECKS
+
+ public static boolean isEmpty(String x) { return x==null || x.length() == 0; }
+ public static boolean isEmpty(Can<?> x) { return x==null || x.size() == 0; }
+ public static boolean isEmpty(Collection<?> x) { return x==null || x.size() == 0; }
+ public static boolean isEmpty(Map<?,?> x) { return x==null || x.size() == 0; }
+ public static boolean isEmpty(boolean[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(byte[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(char[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(double[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(float[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(int[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(long[] array){ return array==null || array.length == 0;}
+ public static boolean isEmpty(short[] array){ return array==null || array.length == 0;}
+ public static <T> boolean isEmpty(T[] array){ return array==null || array.length == 0;}
+
+ // -- SIZE/LENGTH CHECKS
+
+ public static int size(String x){ return x!=null ? x.length() : 0; }
+ public static int size(Collection<?> x){ return x!=null ? x.size() : 0; }
+ public static int size(Map<?,?> x){ return x!=null ? x.size() : 0; }
+ public static int size(boolean[] array){ return array!=null ? array.length : 0; }
+ public static int size(byte[] array){ return array!=null ? array.length : 0; }
+ public static int size(char[] array){ return array!=null ? array.length : 0; }
+ public static int size(double[] array){ return array!=null ? array.length : 0; }
+ public static int size(float[] array){ return array!=null ? array.length : 0; }
+ public static int size(int[] array){ return array!=null ? array.length : 0; }
+ public static int size(long[] array){ return array!=null ? array.length : 0; }
+ public static int size(short[] array){ return array!=null ? array.length : 0; }
+ public static <T> int size(T[] array){ return array!=null ? array.length : 0; }
+
+
+ // -- MAP
+
+ /**
+ * Null-safe variant of {@link java.util.Map#getOrDefault(Object, Object)}
+ * @param map
+ * @param key
+ * @param defaultValue
+ * @return
+ */
+ public static final <K,V> V getOrDefault(final Map<K, V> map, final K key, final V defaultValue) {
+ if(map==null || key==null) {
+ return defaultValue;
+ }
+ return map.getOrDefault(key, defaultValue);
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Oneshot.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Oneshot.java
new file mode 100644
index 0000000..c2c006a
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Oneshot.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.base;
+
+import java.io.Serializable;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * One-shot idiom helper utility, thread-safe and serializable
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ *
+ * @since 2.0
+ *
+ */
+public final class _Oneshot implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final Object $lock = new Object[0]; // serializable lock
+
+ private int shotCount = 0;
+
+ /**
+ * @return whether the shot actually happened (was allowed)
+ */
+ public boolean shoot() {
+ synchronized ($lock) {
+ if(shotCount==0) {
+ ++ shotCount;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * resets to initial condition, that is it allows one more shot
+ */
+ public void reset() {
+ synchronized ($lock) {
+ shotCount = 0;
+ }
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Reduction.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Reduction.java
new file mode 100644
index 0000000..8cb2674
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Reduction.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.base;
+
+import java.util.Optional;
+import java.util.function.BinaryOperator;
+import java.util.function.Consumer;
+import java.util.stream.Stream;
+
+import javax.annotation.Nullable;
+
+import static org.apache.isis.commons.internal.base._With.requires;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides a generic (left-fold) reduction class.
+ * </p>
+ * <p>
+ * Most intuitive example of a reduction is finding the
+ * minimum value from a list of values. See {@link ReductionTest} for examples.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ *
+ */
+public final class _Reduction<T> implements Consumer<T> {
+
+ private final BinaryOperator<T> accumulator;
+ private T result;
+ private boolean initialized = false;
+
+
+ /**
+ * Inspired by {@link Stream#reduce(Object, BinaryOperator)}
+ * @param identity
+ * @param accumulator
+ * @return
+ */
+ public static <T> _Reduction<T> of(@Nullable T identity, BinaryOperator<T> accumulator){
+ return new _Reduction<T>(identity, accumulator, true);
+ }
+
+ /**
+ * Inspired by {@link Stream#reduce(BinaryOperator)}
+ * @param accumulator
+ * @return
+ */
+ public static <T> _Reduction<T> of(BinaryOperator<T> accumulator){
+ return new _Reduction<T>(null, accumulator, false);
+ }
+
+ private _Reduction(@Nullable T identity, BinaryOperator<T> accumulator, boolean initialized) {
+ requires(accumulator, "accumulator");
+ this.initialized = initialized;
+ this.result = identity;
+ this.accumulator = accumulator;
+ }
+
+ @Override
+ public void accept(@Nullable T next) {
+ if(!initialized) {
+ result = next;
+ initialized = true;
+ return;
+ }
+ result = accumulator.apply(result, next);
+ }
+
+ /**
+ * Returns the reduction result if ever initialized, Optional.empty() otherwise.
+ * @return non-null
+ */
+ public Optional<T> getResult() {
+ if(!initialized) {
+ return Optional.empty();
+ }
+ return Optional.ofNullable(result);
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings.java
new file mode 100644
index 0000000..77db933
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings.java
@@ -0,0 +1,664 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Scanner;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+import javax.annotation.Nullable;
+
+import org.apache.isis.commons.internal._Constants;
+import org.apache.isis.commons.internal.base._Bytes.BytesOperator;
+import org.apache.isis.commons.internal.functions._Predicates;
+
+import static org.apache.isis.commons.internal.base._NullSafe.size;
+import static org.apache.isis.commons.internal.base._Strings_SplitIterator.splitIterator;
+import static org.apache.isis.commons.internal.base._With.mapIfPresentElse;
+import static org.apache.isis.commons.internal.base._With.requires;
+import static org.apache.isis.commons.internal.base._With.requiresNotEmpty;
+import static org.apache.isis.commons.internal.functions._Predicates.not;
+
+import lombok.NonNull;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides String related algorithms.
+ * </p><p>
+ * Keep the public methods simple, these are basic building blocks for more complex composites.
+ * Composites are provided as static fields.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Strings {
+
+ private _Strings() {}
+
+ // -- CONSTANTS
+
+ /**
+ * Convenient e.g. for toArray conversions
+ * (a duplicate of in {@link _Constants.emptyStringArray} )
+ */
+ public static final String[] emptyArray = new String[0];
+
+ // -- PAIR OF STRINGS
+
+ public static interface KeyValuePair extends Map.Entry<String, String> { }
+
+ public static KeyValuePair pair(final String key, final String value){
+ return _Strings_KeyValuePair.of(key, value);
+ }
+
+ /**
+ * Parses a string assumed to be of the form <kbd>key[separator]value</kbd> into its parts.
+ * @param keyValueLiteral
+ * @param separator
+ * @return a non-empty Optional, if (and only if) the {@code keyValueLiteral}
+ * does contain at least one {@code separator}
+ */
+ public static Optional<KeyValuePair> parseKeyValuePair(@Nullable String keyValueLiteral, char separator) {
+ return _Strings_KeyValuePair.parse(keyValueLiteral, separator);
+ }
+
+ // -- FILLING
+
+ public static String of(int length, char c) {
+ if(length<=0) {
+ return "";
+ }
+ final char[] chars = new char[length];
+ Arrays.fill(chars, c);
+ return String.valueOf(chars);
+ }
+
+ // -- BASIC PREDICATES
+
+ /**
+ * Same as {@link #isNullOrEmpty(CharSequence)}
+ * @param x
+ * @return true only if string is of zero length or null.
+ */
+ public static boolean isEmpty(@Nullable final CharSequence x){
+ return x==null || x.length()==0;
+ }
+ /**
+ * Same as {@link #isEmpty(CharSequence)}
+ * @param x
+ * @return true only if string is of zero length or null.
+ */
+ public static boolean isNullOrEmpty(@Nullable final CharSequence x){
+ return x==null || x.length()==0;
+ }
+
+
+ /**
+ *
+ * @param x
+ * @return inverse of isEmpty(CharSequence).
+ */
+ public static boolean isNotEmpty(@Nullable final CharSequence x){
+ return x!=null && x.length()!=0;
+ }
+
+ // -- OPTIONAL
+
+ /**
+ * @param x - input string
+ * @return optionally the input string based on whether the input is not empty
+ */
+ public static Optional<String> nonEmpty(@Nullable final CharSequence x) {
+ return isEmpty(x) ? Optional.empty() : Optional.of(x.toString());
+ }
+
+ // -- BASIC UNARY OPERATORS
+
+ /**
+ * @param input
+ * @return null if the {@code input} is null or empty, the {@code input} otherwise
+ */
+ public static @Nullable String emptyToNull(@Nullable String input) {
+ if(isEmpty(input)) {
+ return null;
+ }
+ return input;
+ }
+
+ /**
+ * @param input
+ * @return the empty string if the {@code input} is null, the {@code input} otherwise
+ */
+ public static String nullToEmpty(@Nullable String input) {
+ if(input==null) {
+ return "";
+ }
+ return input;
+ }
+
+
+ /**
+ * Trims the input.
+ * @param input
+ * @return null if the {@code input} is null
+ */
+ public static String trim(@Nullable String input) {
+ return mapIfPresentElse(input, String::trim, null);
+ }
+
+ /**
+ * Converts all of the characters in {@code input} to lower case using the rules of the default locale.
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static String lower(@Nullable final String input) {
+ return mapIfPresentElse(input, String::toLowerCase, null);
+ }
+
+ /**
+ * Converts all of the characters in {@code input} to upper case using the rules of the default locale.
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static String upper(@Nullable final String input) {
+ return mapIfPresentElse(input, String::toUpperCase, null);
+ }
+
+ /**
+ * Converts the first character in {@code input} to upper case using the rules of the default locale.
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static String capitalize(@Nullable final String input) {
+ if(input==null) {
+ return null;
+ }
+ if (input.length() == 0) {
+ return input;
+ }
+ if (input.length() == 1) {
+ return input.toUpperCase();
+ }
+ return Character.toUpperCase(input.charAt(0)) + input.substring(1);
+ }
+
+ /**
+ * Converts the first character in {@code input} to lower case using the rules of the default locale.
+ * @param input
+ * @return null if {@code input} is null
+ */
+ public static String decapitalize(@Nullable final String input) {
+ if(input==null) {
+ return null;
+ }
+ if (input.length() == 0) {
+ return input;
+ }
+ if (input.length() == 1) {
+ return input.toLowerCase();
+ }
+ return Character.toLowerCase(input.charAt(0)) + input.substring(1);
+ }
+
+ // -- SPECIAL UNARY OPERATORS
+
+ public static String htmlEscape(String source) {
+ return _Strings_HtmlEscaper.htmlEscape(source);
+ }
+
+ // -- PREFIX/SUFFIX
+
+ /**
+ * If {@code input} does not start with {@code prefix} prepends {@code prefix} to the input.
+ * @param input
+ * @param prefix
+ * @return null if {@code input} is null
+ */
+ public static String prefix(@Nullable final String input, final String prefix) {
+ if(input==null) {
+ return null;
+ }
+ requires(prefix, "prefix");
+ if(input.startsWith(prefix)) {
+ return input;
+ }
+ return prefix + input;
+ }
+
+ /**
+ * If {@code input} does not end with {@code suffix} appends {@code suffix} to the input.
+ * @param input
+ * @param suffix
+ * @return null if {@code input} is null
+ */
+ public static String suffix(@Nullable final String input, final String suffix) {
+ if(input==null) {
+ return null;
+ }
+ requires(suffix, "suffix");
+ if(input.endsWith(suffix)) {
+ return input;
+ }
+ return input + suffix;
+ }
+
+ // -- REDUCTION (BINARY OPERATIOR)
+
+ /**
+ * Combines 2 strings {@code left} and {@code right} into a single string, such that left
+ * and right are delimited by the {@code delimiter} and such that
+ * the result does not introduce a sequence of delimiters, like for example when building file-system
+ * paths from chunks.
+ *
+ * @param left
+ * @param right
+ * @param delimiter
+ * @return non-null
+ */
+ public static String combineWithDelimiter(
+ @Nullable String left, @Nullable String right, String delimiter) {
+
+ requiresNotEmpty(delimiter, "pathDelimiter");
+
+ if (isNullOrEmpty(left) && isNullOrEmpty(right)) {
+ return "";
+ }
+ if (isNullOrEmpty(left)) {
+ return right;
+ }
+ if (isNullOrEmpty(right)) {
+ return left;
+ }
+ if (left.endsWith(delimiter) || right.startsWith(delimiter)) {
+ return left + right;
+ }
+ return left + delimiter + right;
+ }
+
+
+ // -- PADDING
+
+ /**
+ * Returns a string, of length at least minLength, consisting of string prepended with as many copies
+ * of padChar as are necessary to reach that length.
+ * @param str
+ * @param minLength
+ * @param c
+ * @return
+ */
+ public static String padStart(@Nullable String str, int minLength, char c) {
+ if(minLength<=0) {
+ return str;
+ }
+ final int len = size(str);
+ if(len>=minLength) {
+ return str;
+ }
+
+ final int fillCount = minLength - len;
+
+ return of(fillCount, c) + nullToEmpty(str);
+ }
+
+ /**
+ * Returns a string, of length at least minLength, consisting of string appended with as many copies
+ * of padChar as are necessary to reach that length.
+ * @param str
+ * @param padTo
+ * @param c
+ * @return
+ */
+ public static String padEnd(@Nullable String str, int minLength, char c) {
+ if(minLength<=0) {
+ return str;
+ }
+ final int len = size(str);
+ if(len>=minLength) {
+ return str;
+ }
+
+ final int fillCount = minLength - len;
+
+ return nullToEmpty(str) + of(fillCount, c);
+ }
+
+ // -- SPLITTING
+
+ /**
+ * Splits the {@code input} into chunks separated by {@code separator},
+ * then puts all chunks on the returned stream.
+ * <p>
+ * Corner cases:
+ * <ul>
+ * <li>{@code input} starts with {@code separator}: an empty string is the first chunk put on the stream</li>
+ * <li>{@code input} ends with {@code separator}: an empty string is the last chunk put on the stream</li>
+ * <li>a {@code separator} is followed by another: an empty string is put on the stream</li>
+ * </ul>
+ * @param input
+ * @param separator non-empty string
+ * @return empty stream if {@code input} is null
+ * @throws {@link IllegalArgumentException} if {@code separator} is empty
+ */
+ public static Stream<String> splitThenStream(@Nullable final String input, final String separator) {
+ if(isEmpty(separator)) {
+ throw new IllegalArgumentException("a non empty separator is required");
+ }
+ if(isEmpty(input)) {
+ return Stream.of();
+ }
+ if(!input.contains(separator)) {
+ return Stream.of(input);
+ }
+
+ return StreamSupport.stream(
+ Spliterators.spliteratorUnknownSize(splitIterator(input, separator), Spliterator.ORDERED),
+ false); // not parallel
+ }
+
+ /**
+ * Creates a stream from the given input sequence around matches of {@code delimiterPattern}.
+ * @param input
+ * @param delimiterPattern
+ * @return
+ */
+ public static Stream<String> splitThenStream(@Nullable final CharSequence input, Pattern delimiterPattern) {
+ if(isEmpty(input)) {
+ return Stream.of();
+ }
+ requires(delimiterPattern, "delimiterPattern");
+ return delimiterPattern.splitAsStream(input);
+ }
+
+
+ public static void splitThenAccept(
+ @Nullable final String input,
+ final String separator,
+ final BiConsumer<String, String> onNonEmptySplit,
+ final Consumer<String> onNonEmptyLhs,
+ final Consumer<String> onNonEmptyRhs) {
+
+ _Strings_FastSplit.splitThenAccept(input, separator, onNonEmptySplit, onNonEmptyLhs, onNonEmptyRhs);
+ }
+
+ public static void splitThenAcceptEmptyAsNull(
+ @Nullable final String input,
+ final String separator,
+ final BiConsumer<String, String> onSplit) {
+
+ _Strings_FastSplit.splitThenAccept(input, separator, onSplit,
+ lhs->onSplit.accept(lhs, null),
+ rhs->onSplit.accept(null, rhs));
+ }
+
+
+ public static Stream<String> grep(@Nullable final String input, @Nullable Predicate<String> matcher){
+ matcher = matcher!=null ? matcher : _Predicates.alwaysTrue();
+ return splitThenStream(input, "\n")
+ .filter(_Strings::isNotEmpty)
+ .filter(matcher)
+ .map(s->s.replace("\r", ""));
+ }
+
+ public static Stream<String> grep(@Nullable final String input, @Nullable String contains){
+ final Predicate<String> matcher = contains!=null ? line->line.contains(contains) : _Predicates.alwaysTrue();
+ return grep(input, matcher);
+ }
+
+
+ // -- REPLACEMENT OPERATORS
+
+ /**
+ * Condenses any whitespace to the given {@code replacement}
+ *
+ * @param input
+ * @param replacement
+ * @return null if {@code input} is null
+ */
+ public static String condenseWhitespaces(@Nullable final String input, final String replacement) {
+ requires(replacement, "replacement");
+ return mapIfPresentElse(input, __->input.replaceAll("\\s+", replacement), null);
+ }
+
+ /**
+ * ...xyz
+ * @param input
+ * @param maxLength
+ * @param ellipsis
+ * @return (non-null), ellipsified version of {@code input}, if {@code input} exceeds length {@code maxLength}
+ */
+ public static String ellipsifyAtStart(
+ @Nullable final CharSequence input,
+ final int maxLength,
+ @NonNull final CharSequence ellipsis) {
+
+ if(input==null) {
+ return "";
+ }
+ if(input.length()<=maxLength) {
+ return input.toString();
+ }
+ final int trimmedLength = maxLength - ellipsis.length();
+ final int end = input.length();
+ final int start = end - trimmedLength;
+ return String.join("", ellipsis, input.subSequence(start, end));
+ }
+
+ /**
+ * abc...
+ * @param input
+ * @param maxLength
+ * @param ellipsis
+ * @return (non-null), ellipsified version of {@code input}, if {@code input} exceeds length {@code maxLength}
+ */
+ public static String ellipsifyAtEnd(
+ @Nullable final CharSequence input,
+ final int maxLength,
+ @NonNull final CharSequence ellipsis) {
+
+ if(input==null) {
+ return "";
+ }
+ if(input.length()<=maxLength) {
+ return input.toString();
+ }
+ final int trimmedLength = maxLength - ellipsis.length();
+ return String.join("", input.subSequence(0, trimmedLength), ellipsis);
+ }
+
+ // -- READ FROM INPUT STREAM
+
+ public static String read(@Nullable final InputStream input, Charset charset) {
+ requires(charset, "charset");
+ if(input==null) {
+ return "";
+ }
+ // see https://stackoverflow.com/questions/309424/how-to-read-convert-an-inputstream-into-a-string-in-java
+ try(Scanner scanner = new Scanner(input, charset.name())){
+ scanner.useDelimiter("\\A");
+ return scanner.hasNext() ? scanner.next() : "";
+ }
+ }
+
+ public static List<String> readAllLines(@Nullable final InputStream input, Charset charset) throws IOException {
+ requires(charset, "charset");
+ if(input==null) {
+ return Collections.emptyList();
+ }
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, charset))) {
+ List<String> result = new ArrayList<>();
+ for (;;) {
+ String line = reader.readLine();
+ if (line == null)
+ break;
+ result.add(line);
+ }
+ return result;
+ }
+ }
+
+ // -- BYTE ARRAY CONVERSION
+
+ /**
+ * Encodes {@code str} into a sequence of bytes using the given {@code charset}.
+ * @param str
+ * @param charset
+ * @return null if {@code str} is null
+ */
+ public static final byte[] toBytes(@Nullable final String str, Charset charset) {
+ requires(charset, "charset");
+ return mapIfPresentElse(str, __->str.getBytes(charset), null);
+ }
+
+ /**
+ * Constructs a new String by decoding the specified array of bytes using the specified {@code charset}.
+ * @param bytes
+ * @param charset
+ * @return null if {@code bytes} is null
+ */
+ public static final String ofBytes(@Nullable final byte[] bytes, Charset charset) {
+ requires(charset, "charset");
+ return mapIfPresentElse(bytes, __->new String(bytes, charset), null);
+ }
+
+ /**
+ * Converts the {@code input} to a byte array using the specified {@code charset},
+ * then applies the byte manipulation operator {@code converter},
+ * then converts the (manipulated) byte array back to a string, again using the specified {@code charset}.
+ * @param input
+ * @param converter
+ * @param charset
+ * @return null if {@code input} is null
+ */
+ public static final String convert(@Nullable final String input, final BytesOperator converter, final Charset charset) {
+ requires(converter, "converter");
+ requires(charset, "charset");
+ return mapIfPresentElse(input, __->ofBytes(converter.apply(toBytes(input, charset)), charset), null);
+ }
+
+ // -- UNARY OPERATOR COMPOSITION
+
+ /**
+ * Monadic StringOperator that allows composition of unary string operators.
+ */
+ public static final class StringOperator {
+
+ private final UnaryOperator<String> operator;
+
+ private StringOperator(UnaryOperator<String> operator) {
+ this.operator = requires(operator, "operator");
+ }
+
+ public String apply(String input) {
+ return operator.apply(input);
+ }
+
+ public StringOperator andThen(UnaryOperator<String> andThen) {
+ return new StringOperator(s->andThen.apply(operator.apply(s)));
+ }
+
+ }
+
+ /**
+ * Returns a monadic StringOperator that allows composition of unary string operators
+ * @return
+ */
+ public static StringOperator operator() {
+ return new StringOperator(UnaryOperator.identity());
+ }
+
+ // -- SPECIAL COMPOSITES
+
+ // using naming convention asXxx...
+
+ public static final StringOperator asLowerDashed = operator()
+ .andThen(_Strings::lower)
+ .andThen(s->_Strings.condenseWhitespaces(s, "-"));
+
+ public static final StringOperator asNormalized = operator()
+ .andThen(s->_Strings.condenseWhitespaces(s, " "));
+
+ public static final StringOperator asNaturalName2 = operator()
+ .andThen(s->_Strings_NaturalNames.naturalName2(s, true));
+
+
+ public static final String asFileNameWithExtension(final String fileName, String fileExtension) {
+ requires(fileName, "fileName");
+ requires(fileExtension, "fileExtension");
+ return suffix(fileName, prefix(fileExtension, "."));
+ }
+
+ // -- SHORTCUTS
+
+ /**
+ * Like {@link _Strings#splitThenStream(String, String)} but also trimming each junk, then discarding
+ * empty chunks.
+ * @return empty stream if {@code input} is null
+ */
+ public static Stream<String> splitThenStreamTrimmed(@Nullable String input, String separator) {
+ return splitThenStream(input, separator)
+ .map(String::trim)
+ .filter(not(String::isEmpty));
+ }
+
+ /**
+ * Like {@link _Strings#splitThenStream(CharSequence, Pattern)} but also trimming each junk,
+ * then discarding empty chunks.
+ * @return empty stream if {@code input} is null
+ */
+ public static Stream<String> splitThenStreamTrimmed(@Nullable CharSequence input, Pattern delimiterPattern) {
+ return splitThenStream(input, delimiterPattern)
+ .map(String::trim)
+ .filter(not(String::isEmpty));
+ }
+
+ public static String base64UrlDecode(final String str) {
+ return _Strings.convert(str, _Bytes.ofUrlBase64, StandardCharsets.UTF_8);
+ }
+
+ public static String base64UrlEncode(final String str) {
+ return _Strings.convert(str, _Bytes.asUrlBase64, StandardCharsets.UTF_8);
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_FastSplit.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_FastSplit.java
new file mode 100644
index 0000000..7e6a529
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_FastSplit.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.base;
+
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+
+import javax.annotation.Nullable;
+
+class _Strings_FastSplit {
+
+ public static void splitThenAccept(
+ @Nullable final String input,
+ final String separator,
+ BiConsumer<String, String> onNonEmptySplit,
+ Consumer<String> onNonEmptyLhs,
+ Consumer<String> onNonEmptyRhs) {
+
+ if(_Strings.isEmpty(input)) {
+ // skip
+ return;
+ }
+
+ // we have a non-empty string
+
+ final int p = input.indexOf(separator);
+ if(p<1){
+ if(p==-1) {
+ // separator not found
+ onNonEmptyLhs.accept(input);
+ return;
+ }
+ if(p==0) {
+ // empty lhs in string
+ if(input.length()>separator.length()) {
+ onNonEmptyRhs.accept(input);
+ }
+ return;
+ }
+ }
+ final int q = p + separator.length();
+ if(q==input.length()) {
+ // empty rhs
+ onNonEmptyLhs.accept(input.substring(0, p));
+ return;
+ }
+ onNonEmptySplit.accept(input.substring(0, p), input.substring(q));
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_HtmlEscaper.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_HtmlEscaper.java
new file mode 100644
index 0000000..fcc090f
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_HtmlEscaper.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+/**
+ *
+ * package private mixin for utility class {@link _Strings}
+ *
+ */
+final class _Strings_HtmlEscaper {
+
+ // as declared int guava's com.google.common.html.HtmlEscapers
+ private static final _Strings.KeyValuePair[] replacements = {
+ _Strings.pair("\"", """),
+ // Note: "'" is not defined in HTML 4.01.
+ _Strings.pair("'", "'"),
+ _Strings.pair("&", "&"),
+ _Strings.pair("<", "<"),
+ _Strings.pair(">", ">"),
+
+ };
+
+ static String htmlEscape(String input) {
+ if(_Strings.isEmpty(input)) {
+ return input;
+ }
+
+ String output = input;
+
+ for(_Strings.KeyValuePair replacement : replacements) {
+ output = output.replace(replacement.getKey(), replacement.getValue());
+ }
+
+ return output;
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_KeyValuePair.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_KeyValuePair.java
new file mode 100644
index 0000000..5adc7a9
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_KeyValuePair.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.Optional;
+
+import static org.apache.isis.commons.internal.exceptions._Exceptions.notImplemented;
+
+/**
+ *
+ * package private mixin for utility class {@link _Strings}
+ *
+ */
+final class _Strings_KeyValuePair implements _Strings.KeyValuePair {
+
+ static _Strings.KeyValuePair of(String key, String value) {
+ return new _Strings_KeyValuePair(key, value);
+ }
+
+ private final String key;
+ private final String value;
+
+ private _Strings_KeyValuePair(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String setValue(String value) {
+ throw notImplemented();
+ }
+
+ /**
+ * Parses a string assumed to be of the form <kbd>key[separator]value</kbd> into its parts.
+ * @param keyValueLiteral
+ * @param separator
+ * @return a non-empty Optional, if (and only if) the {@code keyValueLiteral}
+ * does contain at least one {@code separator}
+ */
+ public static Optional<_Strings.KeyValuePair> parse(String keyValueLiteral, char separator) {
+
+ if(_Strings.isNullOrEmpty(keyValueLiteral)) {
+ return Optional.empty();
+ }
+
+ final int equalsIndex = keyValueLiteral.indexOf(separator);
+ if (equalsIndex == -1) {
+ return Optional.empty();
+ }
+
+ String aKey = keyValueLiteral.substring(0, equalsIndex);
+ String aValue = equalsIndex == keyValueLiteral.length() - 1
+ ? ""
+ : keyValueLiteral.substring(equalsIndex + 1);
+
+ return Optional.of(of(aKey, aValue));
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_NaturalNames.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_NaturalNames.java
new file mode 100644
index 0000000..0f1dd27
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_NaturalNames.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import javax.annotation.Nullable;
+
+/**
+ *
+ * package private mixin for utility class {@link _Strings}
+ *
+ */
+final class _Strings_NaturalNames {
+
+ private static final char SPACE = ' ';
+ /**
+ * Returns a word spaced version of the specified name, so there are spaces
+ * between the words, where each word starts with a capital letter. E.g.,
+ * "NextAvailableDate" is returned as "Next Available Date".
+ *
+ * @param name
+ * @param handleNestedClassNames whether to handle any nested class names, eg 'Foo$Bar'
+ * @return
+ *
+ */
+ static String naturalName2(@Nullable String name, final boolean handleNestedClassNames) {
+
+ if(name==null)
+ return null;
+
+ if(handleNestedClassNames) {
+ // handle any nested class names, eg 'Foo$Bar'
+ final int idx = name.lastIndexOf("$");
+ if(idx != -1) {
+ name = name.substring(idx+1);
+ }
+ }
+
+ final int length = name.length();
+
+ if (length <= 1) {
+ return name.toUpperCase();// ensure first character is upper case
+ }
+
+ final StringBuilder naturalName = new StringBuilder(length);
+
+ char previousCharacter;
+ char character = Character.toUpperCase(name.charAt(0));// ensure first
+ // character is
+ // upper case
+ naturalName.append(character);
+ char nextCharacter = name.charAt(1);
+
+ for (int pos = 2; pos < length; pos++) {
+ previousCharacter = character;
+ character = nextCharacter;
+ nextCharacter = name.charAt(pos);
+
+ if (previousCharacter != SPACE) {
+ if (Character.isUpperCase(character) && !Character.isUpperCase(previousCharacter)) {
+ naturalName.append(SPACE);
+ }
+ if (Character.isUpperCase(character) && Character.isLowerCase(nextCharacter) && Character.isUpperCase(previousCharacter)) {
+ naturalName.append(SPACE);
+ }
+ if (Character.isDigit(character) && !Character.isDigit(previousCharacter)) {
+ naturalName.append(SPACE);
+ }
+ }
+ naturalName.append(character);
+ }
+ naturalName.append(nextCharacter);
+ return naturalName.toString();
+ }
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_SplitIterator.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_SplitIterator.java
new file mode 100644
index 0000000..d613f31
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_SplitIterator.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.Collections;
+import java.util.Iterator;
+
+import javax.annotation.Nullable;
+
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+/**
+ *
+ * package private mixin for utility class {@link _Strings}
+ *
+ */
+final class _Strings_SplitIterator {
+
+ public static Iterator<String> splitIterator(@Nullable final String x, final String delimiter){
+ if(_Strings.isEmpty(delimiter)) {
+ throw new IllegalArgumentException("a non empty delimiter is required");
+ }
+ if(_Strings.isEmpty(x)) {
+ return Collections.<String>emptyIterator();
+ }
+ final int dlen = delimiter.length();
+ return new Iterator<String>() {
+ private int p=0, q=-1;
+
+ private String next = _next();
+
+ private String _next() {
+ if(q==-2)
+ return null;
+ q = x.indexOf(delimiter, p);
+ if(q>-1) {
+ final int p0 = p; p=q+dlen;
+ return x.substring(p0, q);
+ }
+ q = -2; // terminal
+ return x.substring(p, x.length());
+ }
+
+ @Override
+ public boolean hasNext() {
+ return next!=null;
+ }
+
+ @Override
+ public String next() {
+
+ if(!hasNext()) {
+ throw _Exceptions.noSuchElement("end of string already reached");
+ }
+
+ try {
+ return next;
+ } finally {
+ next=_next();
+ }
+ }
+ };
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Timing.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Timing.java
new file mode 100644
index 0000000..3ffc34d
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Timing.java
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.Locale;
+import java.util.function.Supplier;
+
+import org.apache.logging.log4j.Logger;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Time measuring utilities.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Timing {
+
+ private _Timing(){}
+
+ /**
+ * @return a new 'now' started instance of {@link StopWatch}
+ */
+ public static StopWatch now() {
+ return new StopWatch();
+ }
+
+ /**
+ *
+ * @param startedAtNanos
+ * @return a new {@code startedAtSystemNanos} instance of {@link StopWatch}
+ */
+ public static StopWatch atSystemNanos(long startedAtSystemNanos) {
+ return new StopWatch(startedAtSystemNanos);
+ }
+
+ /**
+ * Non thread safe start/stop watch utilizing the currently running
+ * JVM's high-resolution time source.
+ * @implNote using {@link System#nanoTime()} as this is best suited to measure elapsed time
+ */
+ public static final class StopWatch {
+
+ private long t0 = 0;
+ private long t1 = 0;
+ private boolean stopped;
+
+ private StopWatch(long startedAtSystemNanos) {
+ t0 = startedAtSystemNanos;
+ }
+
+ private StopWatch() {
+ start();
+ }
+
+ public StopWatch start() {
+ t0 = System.nanoTime();
+ stopped = false;
+ return this;
+ }
+
+ public StopWatch stop() {
+ t1 = System.nanoTime();
+ stopped = true;
+ return this;
+ }
+
+ public double getSeconds() {
+ return 0.001 * getMillis();
+ }
+
+ /**
+ * @return elapsed nano seconds since started
+ * (or when stopped, the time interval between started and stopped)
+ */
+ public long getNanos() {
+ return stopped ? t1 - t0 : System.nanoTime() - t0 ;
+ }
+
+ /**
+ * @return elapsed micro seconds since started
+ * (or when stopped, the time interval between started and stopped)
+ */
+ public long getMicros() {
+ return getNanos()/1000L;
+ }
+
+ /**
+ * @return elapsed milli seconds since started
+ * (or when stopped, the time interval between started and stopped)
+ */
+ public long getMillis() {
+ return getNanos()/1000_000L;
+ }
+
+ @Override
+ public String toString() {
+ return String.format(Locale.US, "%d ms", getMillis());
+ }
+
+ }
+
+ public static StopWatch run(Runnable runnable) {
+ final StopWatch watch = now();
+ runnable.run();
+ return watch.stop();
+ }
+
+ public static void runVerbose(Logger log, String label, Runnable runnable) {
+ final StopWatch watch = run(runnable);
+ log.info(String.format(Locale.US, "Running '%s' took %d ms", label, watch.getMillis()));
+ }
+
+ public static <T> T callVerbose(Logger log, String label, Supplier<T> callable) {
+ final StopWatch watch = now();
+ T result = callable.get();
+ watch.stop();
+ log.info(String.format(Locale.US, "Calling '%s' took %d ms", label, watch.getMillis()));
+ return result;
+ }
+
+
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Tuples.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Tuples.java
new file mode 100644
index 0000000..6a6076a
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Tuples.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.Tuple;
+import javax.persistence.TupleElement;
+
+import org.apache.isis.commons.collections.Can;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.Value;
+import lombok.val;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides Tuples of arity 2,
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _Tuples {
+
+ private _Tuples(){}
+
+ // -- TUPLE 2
+
+ public static class Tuple2<T1, T2>{
+ private final T1 _1;
+ private final T2 _2;
+
+ private Tuple2(T1 _1, T2 _2) {
+ this._1 = _1;
+ this._2 = _2;
+ }
+
+ /**
+ * @return first element of this tuple
+ */
+ public T1 get_1() { return _1; }
+ /**
+ * @return second element of this tuple
+ */
+ public T2 get_2() { return _2; }
+ }
+
+ public static <T1, T2> Tuple2<T1, T2> pair(T1 _1, T2 _2) {
+ return new Tuple2<T1, T2>(_1, _2);
+ }
+
+ // -- INDEXED
+
+ @Value(staticConstructor = "of")
+ public static class Indexed<T>{
+ int index;
+ T value;
+ }
+
+ public static <T> Indexed<T> indexed(int index, T value) {
+ return Indexed.of(index, value);
+ }
+
+ // -- JAVAX - PERSISTENCE
+
+ //TODO just a sketch yet
+ @Value(staticConstructor = "of")
+ private static final class TypedTuple implements Tuple {
+
+ final Can<Class<? extends Serializable>> types;
+ final List<Serializable> values;
+
+ @Override
+ public <X> X get(TupleElement<X> tupleElement) {
+ throw _Exceptions.notImplemented();
+ }
+
+ @Override
+ public <X> X get(String alias, Class<X> type) {
+ throw _Exceptions.notImplemented();
+ }
+
+ @Override
+ public Object get(String alias) {
+ throw _Exceptions.notImplemented();
+ }
+
+ @Override
+ public <X> X get(int i, Class<X> requiredType) {
+ val value = values.get(i);
+ return _Casts.uncheckedCast(value);
+ }
+
+ @Override
+ public Object get(int i) {
+ return values.get(i);
+ }
+
+ @Override
+ public Object[] toArray() {
+ throw _Exceptions.notImplemented();
+ }
+
+ @Override
+ public List<TupleElement<?>> getElements() {
+ throw _Exceptions.notImplemented();
+ }
+
+ }
+
+ public static Tuple of(Can<Class<? extends Serializable>> types, List<Serializable> values) {
+ return of(types, values);
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java
new file mode 100644
index 0000000..2607220
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java
@@ -0,0 +1,340 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.commons.internal.base;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.concurrent.Callable;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+import javax.annotation.Nullable;
+
+import lombok.val;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ * Provides shortcuts for common 'Optional' idioms.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public final class _With<T> {
+
+ private _With() { }
+
+ // -- OPTION IDIOMS
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).orElse(orElse);}
+ * @param obj (nullable)
+ * @param orElse (nullable)
+ * @return {@code obj!=null ? obj : orElse}
+ */
+ public static <X> X ifPresentElse(@Nullable X obj, @Nullable X orElse) {
+ return obj!=null ? obj : orElse;
+ }
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).orElseGet(elseGet);}
+ * @param obj (nullable)
+ * @param elseGet
+ * @return {@code obj!=null ? obj : elseGet.get()}
+ */
+ public static <X> X ifPresentElseGet(@Nullable X obj, Supplier<X> elseGet) {
+ return obj!=null ? obj : requires(elseGet, "elseGet").get();
+ }
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).orElseThrow(elseThrow);}
+ * @param obj (nullable)
+ * @param elseThrow
+ * @return {@code obj!=null ? obj : throw( elseThrow.get() )}
+ * @throws E
+ */
+ public static <X, E extends Exception> X ifPresentElseThrow(
+ @Nullable X obj,
+ Supplier<E> elseThrow)
+ throws E {
+ if(obj!=null) {
+ return obj;
+ }
+ throw requires(elseThrow, "elseThrow").get();
+ }
+
+ // -- CONSUMER IDIOMS
+
+ /**
+ * Unary identity operator that passes {@code obj} to {@code consumer}.
+ * @param obj (nullable)
+ * @param consumer
+ * @return {@code obj}
+ */
+ public static <X> X accept(@Nullable X obj, Consumer<X> consumer) {
+ requires(consumer, "consumer").accept(obj);
+ return obj;
+ }
+
+ /**
+ * Unary identity operator that passes {@code obj} to {@code ifPresent} if {@code obj} is present.
+ * @param obj (nullable)
+ * @param ifPresent
+ * @return {@code obj}
+ */
+ public static <X> X acceptIfPresent(@Nullable X obj, Consumer<X> ifPresent) {
+ if(obj!=null) {
+ requires(ifPresent, "ifPresent").accept(obj);
+ }
+ return obj;
+ }
+
+ /**
+ * Unary identity operator that passes {@code obj} to {@code ifPresent} if {@code obj} is present,
+ * runs the specified {@code elseRun} otherwise.
+ * @param obj (nullable)
+ * @param ifPresent
+ * @param elseRun
+ * @return {@code obj}
+ */
+ public static <X> X acceptIfPresentElseRun(@Nullable X obj, Consumer<X> ifPresent, Runnable elseRun) {
+ if(obj!=null) {
+ requires(ifPresent, "ifPresent").accept(obj);
+ } else {
+ requires(elseRun, "elseRun").run();
+ }
+ return obj;
+ }
+
+ /**
+ * Unary identity operator that passes {@code obj} to {@code ifPresent} if {@code obj} is present,
+ * throws the specified Exception provided by {@code elseThrow} otherwise.
+ * @param obj (nullable)
+ * @param ifPresent
+ * @param elseThrow
+ * @return {@code obj!=null ? obj : throw( elseThrow.get() ) }
+ * @throws E
+ */
+ public static <X, E extends Exception> X acceptIfPresentElseThrow(
+ @Nullable X obj, Consumer<X> ifPresent, Supplier<E> elseThrow)
+ throws E {
+
+ if(obj!=null) {
+ requires(ifPresent, "ifPresent").accept(obj);
+ } else {
+ throw requires(elseThrow, "elseThrow").get();
+ }
+ return obj;
+ }
+
+ // -- SUPPLIER IDIOMS
+
+ /**
+ * @param obj (nullable)
+ * @param supplier
+ * @return {@code obj!=null ? obj : supplier.get()}
+ */
+ public static <X> X computeIfAbsent(@Nullable X obj, Supplier<X> supplier) {
+ return obj!=null ? obj : requires(supplier, "supplier").get();
+ }
+
+ // -- MAPPING IDIOMS
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).map(mapper).orElse(orElse);}
+ * @param obj (nullable)
+ * @param mapper
+ * @param orElse (nullable)
+ * @return {@code obj!=null ? mapper.apply(obj) : orElse}
+ */
+ public static <X, R> R mapIfPresentElse(@Nullable X obj, Function<X, R> mapper, @Nullable R orElse) {
+ return obj!=null ? requires(mapper, "mapper").apply(obj) : orElse;
+ }
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).map(mapper).orElseGet(elseGet);}
+ * @param obj (nullable)
+ * @param mapper
+ * @param elseGet
+ * @return {@code obj!=null ? mapper.apply(obj) : elseGet.get()}
+ */
+ public static <X, R> R mapIfPresentElseGet(@Nullable X obj, Function<X, R> mapper, Supplier<R> elseGet) {
+ return obj!=null ? requires(mapper, "mapper").apply(obj) : requires(elseGet, "elseGet").get();
+ }
+
+ /**
+ * Equivalent to {@code Optional.ofNullable(obj).map(mapper).orElseThrow(elseThrow);}
+ * @param obj (nullable)
+ * @param mapper
+ * @param elseThrow
+ * @return {@code obj!=null ? mapper.apply(obj) : throw( elseThrow.get() )}
+ * @throws E
+ */
+ public static <X, R, E extends Exception> R mapIfPresentElseThrow(
+ @Nullable X obj,
+ Function<X, R> mapper,
+ Supplier<E> elseThrow)
+ throws E {
+ if(obj!=null) {
+ return requires(mapper, "mapper").apply(obj);
+ }
+ throw requires(elseThrow, "elseThrow").get();
+ }
+
+ // -- PARAMETER NON-NULL CHECK
+
+ /**
+ * Allows for convenient named parameter non-null-check.
+ * @param obj target for the non-null-check
+ * @param paramName to use for the exception message, when the non-null-check fails
+ * @return {@code obj!=null ? obj : throw NullPointerException}
+ * @throws NullPointerException if {@code obj} is {@code null}
+ */
+ public static <T> T requires(@Nullable T obj, String paramName) {
+ if (obj == null) {
+ val msg = String.format("Parameter/Field '%s' is required to be present (not null).", paramName);
+ throw new IllegalArgumentException(msg);
+ }
+ return obj;
+ }
+
+ // -- PARAMETER NON-EMPTY CHECK(S)
+
+ /**
+ * Allows for convenient named parameter non-empty-check.
+ * @param obj target for the non-empty-check
+ * @param paramName to use for the exception message, when the non-empty-check fails
+ * @return {@code obj}
+ * @throws NullPointerException if {@code obj} is {@code null}
+ * @throws IllegalArgumentException if {@code obj} is 'empty'
+ */
+ public static String requiresNotEmpty(@Nullable String obj, String paramName) {
+ if (obj == null) {
+ throw new NullPointerException(String.format("Parameter/Field '%s' is required to be present (not null).", paramName));
+ }
+ if (obj.length()==0) {
+ throw new IllegalArgumentException(String.format("Parameter/Field '%s' is required to be present and not empty.", paramName));
+ }
+ return obj;
+ }
+
+ // -- CONVENIENT CONSTRUCTORS
+
+ /**
+ * Allows for single line instantiation and initialization of an Object.
+ * @param factory
+ * @param initializer
+ * @return a new Object as provided by {@code factory} after calling the {@code initializer} on it
+ */
+ public static <T> T create(Supplier<T> factory, Consumer<T> initializer) {
+ return accept(factory.get(), initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of an ArrayList.
+ * @param initializer
+ * @return a new ArrayList after calling the {@code initializer} on it
+ */
+ public static <X> ArrayList<X> arrayList(Consumer<ArrayList<X>> initializer) {
+ return create(ArrayList::new, initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of a HashSet.
+ * @param initializer
+ * @return a new HashSet after calling the {@code initializer} on it
+ */
+ public static <X> HashSet<X> hashSet(Consumer<HashSet<X>> initializer) {
+ return create(HashSet::new, initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of a TreeSet.
+ * @param initializer
+ * @return a new TreeSet after calling the {@code initializer} on it
+ */
+ public static <X> TreeSet<X> treeSet(Consumer<TreeSet<X>> initializer) {
+ return create(TreeSet::new, initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of a HashMap.
+ * @param initializer
+ * @return a new HashMap after calling the {@code initializer} on it
+ */
+ public static <K, V> HashMap<K, V> hashMap(Consumer<HashMap<K, V>> initializer) {
+ return accept(new HashMap<K, V>(), initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of a TreeMap.
+ * @param initializer
+ * @return a new TreeMap after calling the {@code initializer} on it
+ */
+ public static <K, V> TreeMap<K, V> treeMap(Consumer<TreeMap<K, V>> initializer) {
+ return accept(new TreeMap<K, V>(), initializer);
+ }
+
+ /**
+ * Allows for single line instantiation and initialization of a StringBuilder.
+ * @param initializer
+ * @return a new StringBuilder after calling the {@code initializer} on it
+ */
+ public static StringBuilder stringBuilder(Consumer<StringBuilder> initializer) {
+ return create(StringBuilder::new, initializer);
+ }
+
+ // -- EXCEPTION SWALLOW IDIOMS
+
+ /**
+ * Returns Optional of the callable's result after invocation. Any exception during
+ * invocation will result in an empty Optional.
+ */
+ public static <T> Optional<T> tryCall(Callable<T> callable) {
+ try {
+ val result = callable.call();
+ return Optional.ofNullable(result);
+ } catch (Exception e) {
+ return Optional.empty();
+ }
+ }
+
+ /**
+ * Returns the callable's result after invocation. Any exception during
+ * invocation will result in the defaultValue being returned instead.
+ */
+ public static <T> T tryOrDefault(Callable<T> callable, T defaultValue) {
+ try {
+ return callable.call();
+ } catch (Exception e) {
+ return defaultValue;
+ }
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/package-info.java b/commons/src/main/java/org/apache/isis/commons/internal/base/package-info.java
new file mode 100644
index 0000000..4153ce4
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/package-info.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * <h1>Internal API</h1>
+ * Internal classes, contributing to the internal proprietary API.
+ * These may be changed or removed without notice!
+ * <p>
+ * <b>WARNING</b>:
+ * Do NOT use any of the classes provided by this package!
+ * </p>
+ */
+package org.apache.isis.commons.internal.base;
\ No newline at end of file
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalBidirectionalBinding.java b/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalBidirectionalBinding.java
new file mode 100644
index 0000000..23ae4a9
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalBidirectionalBinding.java
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.binding;
+
+import java.lang.ref.WeakReference;
+
+import org.apache.isis.commons.binding.Bindable;
+import org.apache.isis.commons.binding.ChangeListener;
+import org.apache.isis.commons.binding.Observable;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.val;
+
+//@Log4j2
+abstract class InternalBidirectionalBinding<T>
+implements ChangeListener<T>, InternalUtil.WeakListener {
+
+ public static <T> InternalBidirectionalBinding<T> bind(Bindable<T> left, Bindable<T> right) {
+ checkParameters(left, right);
+ val binding = new GenericBidirectionalBinding<T>(left, right);
+ left.setValue(right.getValue());
+ left.addListener(binding);
+ right.addListener(binding);
+ return binding;
+ }
+
+ public static <T> void unbind(Bindable<T> left, Bindable<T> right) {
+ checkParameters(left, right);
+ val binding = new UntypedBidirectionalBinding(left, right);
+ left.removeListener(binding);
+ right.removeListener(binding);
+ }
+
+ public static void unbind(Object left, Object right) {
+ checkParameters(left, right);
+ val binding = new UntypedBidirectionalBinding(left, right);
+ if (left instanceof Observable) {
+ ((Observable<?>) left).removeListener(binding);
+ }
+ if (right instanceof Observable) {
+ ((Observable<?>) right).removeListener(binding);
+ }
+ }
+
+ protected abstract Object getLeft();
+
+ protected abstract Object getRight();
+
+
+ @Override
+ public int hashCode() {
+ return cachedHash;
+ }
+
+ @Override
+ public boolean isNoLongerReferenced() {
+ return (getLeft() == null) || (getRight() == null);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ final Object left = getLeft();
+ final Object right = getRight();
+ if ((left == null) || (right == null)) {
+ return false;
+ }
+
+ if (obj instanceof InternalBidirectionalBinding) {
+ final InternalBidirectionalBinding<?> otherBinding = (InternalBidirectionalBinding<?>) obj;
+ final Object otherLeft = otherBinding.getLeft();
+ final Object otherRight = otherBinding.getRight();
+ if ((otherLeft == null) || (otherRight == null)) {
+ return false;
+ }
+
+ if (left == otherLeft && right == otherRight) {
+ return true;
+ }
+ if (left == otherRight && right == otherLeft) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // -- HELPER
+
+ private static void checkParameters(@NonNull Object left, @NonNull Object right) {
+ if (left == right) {
+ throw _Exceptions.illegalArgument("Cannot bind to self");
+ }
+ }
+
+ private final int cachedHash;
+
+ private InternalBidirectionalBinding(Object left, Object right) {
+ cachedHash = left.hashCode() * right.hashCode();
+ }
+
+
+ private static class GenericBidirectionalBinding<T> extends InternalBidirectionalBinding<T> {
+ private final WeakReference<Bindable<T>> leftRef;
+ private final WeakReference<Bindable<T>> rightRef;
+ private boolean updating = false;
+
+ private GenericBidirectionalBinding(Bindable<T> left, Bindable<T> right) {
+ super(left, right);
+ leftRef = new WeakReference<Bindable<T>>(left);
+ rightRef = new WeakReference<Bindable<T>>(right);
+ }
+
+ @Override
+ protected Bindable<T> getLeft() {
+ return leftRef.get();
+ }
+
+ @Override
+ protected Bindable<T> getRight() {
+ return rightRef.get();
+ }
+
+ @Override
+ public void changed(final Observable<? extends T> observable, final T oldValue, final T newValue) {
+ if (updating) {
+ return;
+ }
+ val left = getLeft();
+ val right = getRight();
+
+ if ((left == null) || (right == null)) {
+ if (left != null) {
+ left.removeListener(this);
+ }
+ if (right != null) {
+ right.removeListener(this);
+ }
+ return;
+ }
+
+ try {
+ updating = true;
+ if (left == observable) {
+ right.setValue(newValue);
+ } else {
+ left.setValue(newValue);
+ }
+ } catch (RuntimeException e) {
+ try {
+ if (left == observable) {
+ left.setValue(oldValue);
+ } else {
+ right.setValue(oldValue);
+ }
+ } catch (Exception e2) {
+ e2.addSuppressed(e);
+ unbind(left, right);
+ throw _Exceptions.unrecoverableFormatted(
+ "Bidirectional binding failed with an attempt to restore the "
+ + "Observable to the previous value. "
+ + "Removing the bidirectional binding from bindables %s and %s",
+ ""+left,
+ ""+right,
+ e2);
+ }
+ throw _Exceptions.unrecoverable(
+ "Bidirectional binding failed, setting to the previous value", e);
+ } finally {
+ updating = false;
+ }
+
+ }
+ }
+
+ private static class UntypedBidirectionalBinding extends InternalBidirectionalBinding<Object> {
+
+ @Getter private final Object left;
+ @Getter private final Object right;
+
+ public UntypedBidirectionalBinding(Object left, Object right) {
+ super(left, right);
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public void changed(Observable<? extends Object> sourceProperty, Object oldValue, Object newValue) {
+ throw _Exceptions.unexpectedCodeReach();
+ }
+ }
+
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalUtil.java b/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalUtil.java
new file mode 100644
index 0000000..722e9ff
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/binding/InternalUtil.java
@@ -0,0 +1,450 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.binding;
+
+import java.lang.ref.WeakReference;
+import java.util.Arrays;
+import java.util.function.Predicate;
+
+import javax.annotation.Nullable;
+
+import org.apache.isis.commons.binding.ChangeListener;
+import org.apache.isis.commons.binding.InvalidationListener;
+import org.apache.isis.commons.binding.Observable;
+
+import lombok.NonNull;
+
+abstract class InternalUtil<T> {
+
+ // -- WEAK LISTENING STUFF
+
+ static interface WeakListener {
+ boolean isNoLongerReferenced();
+ }
+
+ final static class WeakChangeListener<T> implements ChangeListener<T>, WeakListener {
+
+ private final WeakReference<ChangeListener<T>> ref;
+
+ public WeakChangeListener(@NonNull ChangeListener<T> listener) {
+ this.ref = new WeakReference<ChangeListener<T>>(listener);
+ }
+
+ @Override
+ public boolean isNoLongerReferenced() {
+ return (ref.get() == null);
+ }
+
+ @Override
+ public void changed(Observable<? extends T> observable, T oldValue, T newValue) {
+ ChangeListener<T> listener = ref.get();
+ if (listener != null) {
+ listener.changed(observable, oldValue, newValue);
+ } else {
+ observable.removeListener(this);
+ }
+ }
+
+ }
+
+ final static class WeakInvalidationListener implements InvalidationListener, WeakListener {
+
+ private final WeakReference<InvalidationListener> ref;
+
+ public WeakInvalidationListener(@NonNull InvalidationListener listener) {
+ this.ref = new WeakReference<InvalidationListener>(listener);
+ }
+
+ @Override
+ public boolean isNoLongerReferenced() {
+ return (ref.get() == null);
+ }
+
+ @Override
+ public void invalidated(Observable<?> observable) {
+ InvalidationListener listener = ref.get();
+ if (listener != null) {
+ listener.invalidated(observable);
+ } else {
+ observable.removeListener(this);
+ }
+ }
+ }
+
+
+ // -- LISTENER ADD/REMOVE
+
+ static <T> InternalUtil<T> addListener(
+ @Nullable final InternalUtil<T> helper,
+ @NonNull final Observable<T> observable,
+ @NonNull final InvalidationListener listener) {
+ observable.getValue(); // validate observable
+ return (helper == null)
+ ? new SingleInvalidation<T>(observable, listener)
+ : helper.addListener(listener);
+ }
+
+ static <T> InternalUtil<T> removeListener(
+ @Nullable final InternalUtil<T> helper,
+ @NonNull final InvalidationListener listener) {
+ return (helper == null)
+ ? null
+ : helper.removeListener(listener);
+ }
+
+ static <T> InternalUtil<T> addListener(
+ @Nullable final InternalUtil<T> helper,
+ @NonNull final Observable<T> observable,
+ @NonNull final ChangeListener<? super T> listener) {
+ return (helper == null)
+ ? new SingleChange<T>(observable, listener)
+ : helper.addListener(listener);
+ }
+
+ static <T> InternalUtil<T> removeListener(
+ @Nullable final InternalUtil<T> helper,
+ @NonNull ChangeListener<? super T> listener) {
+ return (helper == null)
+ ? null
+ : helper.removeListener(listener);
+ }
+
+ static <T> void fireValueChanged(InternalUtil<T> helper) {
+ if (helper != null) {
+ helper.fireValueChanged();
+ }
+ }
+
+ // -- COMMON IMPLEMENTATIONS
+
+ protected final Observable<T> observable;
+
+ private InternalUtil(Observable<T> observable) {
+ this.observable = observable;
+ }
+
+ protected abstract InternalUtil<T> addListener(InvalidationListener listener);
+ protected abstract InternalUtil<T> removeListener(InvalidationListener listener);
+
+ protected abstract InternalUtil<T> addListener(ChangeListener<? super T> listener);
+ protected abstract InternalUtil<T> removeListener(ChangeListener<? super T> listener);
+
+ protected abstract void fireValueChanged();
+
+ // -- IMPLEMENTATIONS
+
+ private static class SingleInvalidation<T> extends InternalUtil<T> {
+
+ private final InvalidationListener listener;
+
+ private SingleInvalidation(Observable<T> observable, InvalidationListener listener) {
+ super(observable);
+ this.listener = listener;
+ }
+
+ @Override
+ protected InternalUtil<T> addListener(InvalidationListener listener) {
+ return new Generic<T>(observable, this.listener, listener);
+ }
+
+ @Override
+ protected InternalUtil<T> removeListener(InvalidationListener listener) {
+ return (listener.equals(this.listener))? null : this;
+ }
+
+ @Override
+ protected InternalUtil<T> addListener(ChangeListener<? super T> listener) {
+ return new Generic<T>(observable, this.listener, listener);
+ }
+
+ @Override
+ protected InternalUtil<T> removeListener(ChangeListener<? super T> listener) {
+ return this;
+ }
+
+ @Override
+ protected void fireValueChanged() {
+ try {
+ listener.invalidated(observable);
+ } catch (Exception e) {
+ Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
+ }
+ }
+ }
+
+ private static class SingleChange<T> extends InternalUtil<T> {
+
+ private final ChangeListener<? super T> listener;
+ private T currentValue;
+
+ private SingleChange(Observable<T> observable, ChangeListener<? super T> listener) {
+ super(observable);
+ this.listener = listener;
+ this.currentValue = observable.getValue();
+ }
+
+ @Override
+ protected InternalUtil<T> addListener(InvalidationListener listener) {
+ return new Generic<T>(observable, listener, this.listener);
+ }
+
+ @Override
+ protected InternalUtil<T> removeListener(InvalidationListener listener) {
+ return this;
+ }
+
+ @Override
+ protected InternalUtil<T> addListener(ChangeListener<? super T> listener) {
+ return new Generic<T>(observable, this.listener, listener);
+ }
+
+ @Override
+ protected InternalUtil<T> removeListener(ChangeListener<? super T> listener) {
+ return (listener.equals(this.listener))? null : this;
+ }
+
+ @Override
+ protected void fireValueChanged() {
+ final T oldValue = currentValue;
+ currentValue = observable.getValue();
+ final boolean changed = (currentValue == null)? (oldValue != null) : !currentValue.equals(oldValue);
+ if (changed) {
+ try {
+ listener.changed(observable, oldValue, currentValue);
+ } catch (Exception e) {
+ Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
+ }
+ }
+ }
+ }
+
+ private static class Generic<T> extends InternalUtil<T> {
+
+ private InvalidationListener[] invalidationListeners;
+ private ChangeListener<? super T>[] changeListeners;
+ private int invalidationSize;
+ private int changeSize;
+ private boolean locked;
+ private T currentValue;
+
+ private Generic(Observable<T> observable, InvalidationListener listener0, InvalidationListener listener1) {
+ super(observable);
+ this.invalidationListeners = new InvalidationListener[] {listener0, listener1};
+ this.invalidationSize = 2;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Generic(Observable<T> observable, ChangeListener<? super T> listener0, ChangeListener<? super T> listener1) {
+ super(observable);
+ this.changeListeners = new ChangeListener[] {listener0, listener1};
+ this.changeSize = 2;
+ this.currentValue = observable.getValue();
+ }
+
+ @SuppressWarnings("unchecked")
+ private Generic(Observable<T> observable, InvalidationListener invalidationListener, ChangeListener<? super T> changeListener) {
+ super(observable);
+ this.invalidationListeners = new InvalidationListener[] {invalidationListener};
+ this.invalidationSize = 1;
+ this.changeListeners = new ChangeListener[] {changeListener};
+ this.changeSize = 1;
+ this.currentValue = observable.getValue();
+ }
+
+ @Override
+ protected Generic<T> addListener(InvalidationListener listener) {
+ if (invalidationListeners == null) {
+ invalidationListeners = new InvalidationListener[] {listener};
+ invalidationSize = 1;
+ } else {
+ final int oldCapacity = invalidationListeners.length;
+ if (locked) {
+ final int newCapacity = (invalidationSize < oldCapacity)? oldCapacity : (oldCapacity * 3)/2 + 1;
+ invalidationListeners = Arrays.copyOf(invalidationListeners, newCapacity);
+ } else if (invalidationSize == oldCapacity) {
+ invalidationSize = trimListeners(invalidationSize, invalidationListeners);
+ if (invalidationSize == oldCapacity) {
+ final int newCapacity = (oldCapacity * 3)/2 + 1;
+ invalidationListeners = Arrays.copyOf(invalidationListeners, newCapacity);
+ }
+ }
+ invalidationListeners[invalidationSize++] = listener;
+ }
+ return this;
+ }
+
+ @Override
+ protected InternalUtil<T> removeListener(InvalidationListener listener) {
+ if (invalidationListeners != null) {
+ for (int index = 0; index < invalidationSize; index++) {
+ if (listener.equals(invalidationListeners[index])) {
+ if (invalidationSize == 1) {
+ if (changeSize == 1) {
+ return new SingleChange<T>(observable, changeListeners[0]);
+ }
+ invalidationListeners = null;
+ invalidationSize = 0;
+ } else if ((invalidationSize == 2) && (changeSize == 0)) {
+ return new SingleInvalidation<T>(observable, invalidationListeners[1-index]);
+ } else {
+ final int numMoved = invalidationSize - index - 1;
+ final InvalidationListener[] oldListeners = invalidationListeners;
+ if (locked) {
+ invalidationListeners = new InvalidationListener[invalidationListeners.length];
+ System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
+ }
+ if (numMoved > 0) {
+ System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
+ }
+ invalidationSize--;
+ if (!locked) {
+ invalidationListeners[invalidationSize] = null; // Let gc do its work
+ }
+ }
+ break;
+ }
+ }
+ }
+ return this;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected InternalUtil<T> addListener(ChangeListener<? super T> listener) {
+ if (changeListeners == null) {
+ changeListeners = new ChangeListener[] {listener};
+ changeSize = 1;
+ } else {
+ final int oldCapacity = changeListeners.length;
+ if (locked) {
+ final int newCapacity = (changeSize < oldCapacity)? oldCapacity : (oldCapacity * 3)/2 + 1;
+ changeListeners = Arrays.copyOf(changeListeners, newCapacity);
+ } else if (changeSize == oldCapacity) {
+ changeSize = trimListeners(changeSize, changeListeners);
+ if (changeSize == oldCapacity) {
+ final int newCapacity = (oldCapacity * 3)/2 + 1;
+ changeListeners = Arrays.copyOf(changeListeners, newCapacity);
+ }
+ }
+ changeListeners[changeSize++] = listener;
+ }
+ if (changeSize == 1) {
+ currentValue = observable.getValue();
+ }
+ return this;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected InternalUtil<T> removeListener(ChangeListener<? super T> listener) {
+ if (changeListeners != null) {
+ for (int index = 0; index < changeSize; index++) {
+ if (listener.equals(changeListeners[index])) {
+ if (changeSize == 1) {
+ if (invalidationSize == 1) {
+ return new SingleInvalidation<T>(observable, invalidationListeners[0]);
+ }
+ changeListeners = null;
+ changeSize = 0;
+ } else if ((changeSize == 2) && (invalidationSize == 0)) {
+ return new SingleChange<T>(observable, changeListeners[1-index]);
+ } else {
+ final int numMoved = changeSize - index - 1;
+ final ChangeListener<? super T>[] oldListeners = changeListeners;
+ if (locked) {
+ changeListeners = new ChangeListener[changeListeners.length];
+ System.arraycopy(oldListeners, 0, changeListeners, 0, index);
+ }
+ if (numMoved > 0) {
+ System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);
+ }
+ changeSize--;
+ if (!locked) {
+ changeListeners[changeSize] = null; // Let gc do its work
+ }
+ }
+ break;
+ }
+ }
+ }
+ return this;
+ }
+
+ @Override
+ protected void fireValueChanged() {
+ final InvalidationListener[] curInvalidationList = invalidationListeners;
+ final int curInvalidationSize = invalidationSize;
+ final ChangeListener<? super T>[] curChangeList = changeListeners;
+ final int curChangeSize = changeSize;
+
+ try {
+ locked = true;
+ for (int i = 0; i < curInvalidationSize; i++) {
+ try {
+ curInvalidationList[i].invalidated(observable);
+ } catch (Exception e) {
+ Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
+ }
+ }
+ if (curChangeSize > 0) {
+ final T oldValue = currentValue;
+ currentValue = observable.getValue();
+ final boolean changed = (currentValue == null)? (oldValue != null) : !currentValue.equals(oldValue);
+ if (changed) {
+ for (int i = 0; i < curChangeSize; i++) {
+ try {
+ curChangeList[i].changed(observable, oldValue, currentValue);
+ } catch (Exception e) {
+ Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
+ }
+ }
+ }
+ }
+ } finally {
+ locked = false;
+ }
+ }
+ }
+
+ private static int trimListeners(int size, Object[] listeners) {
+ Predicate<Object> p = t -> t instanceof WeakListener
+ && ((WeakListener)t).isNoLongerReferenced();
+ int index = 0;
+ for (; index < size; index++) {
+ if (p.test(listeners[index])) {
+ break;
+ }
+ }
+ if (index < size) {
+ for (int src = index + 1; src < size; src++) {
+ if (!p.test(listeners[src])) {
+ listeners[index++] = listeners[src];
+ }
+ }
+ int oldSize = size;
+ size = index;
+ for (; index < oldSize; index++) {
+ listeners[index] = null;
+ }
+ }
+
+ return size;
+ }
+
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/binding/_BindableAbstract.java b/commons/src/main/java/org/apache/isis/commons/internal/binding/_BindableAbstract.java
new file mode 100644
index 0000000..abb503d
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/binding/_BindableAbstract.java
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.binding;
+
+import java.lang.ref.WeakReference;
+
+import org.apache.isis.commons.binding.Bindable;
+import org.apache.isis.commons.binding.ChangeListener;
+import org.apache.isis.commons.binding.InvalidationListener;
+import org.apache.isis.commons.binding.Observable;
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
+import lombok.NonNull;
+
+
+/**
+ * <h1>- internal use only -</h1>
+ *
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
+ * These may be changed or removed without notice!
+ * </p>
+ *
+ * @since 2.0
+ */
+public abstract class _BindableAbstract<T> implements Bindable<T> {
+
+ private T value;
+ private Observable<? extends T> observable = null;;
+ private InvalidationListener listener = null;
+ private boolean valid = true;
+ private InternalUtil<T> util = null;
+
+ public _BindableAbstract() {
+ }
+
+ public _BindableAbstract(T initialValue) {
+ this.value = initialValue;
+ }
+
+ @Override
+ public void addListener(InvalidationListener listener) {
+ util = InternalUtil.addListener(util, this, listener);
+ }
+
+ @Override
+ public void removeListener(InvalidationListener listener) {
+ util = InternalUtil.removeListener(util, listener);
+ }
+
+ @Override
+ public void addListener(ChangeListener<? super T> listener) {
+ util = InternalUtil.addListener(util, this, listener);
+ }
+
+ @Override
+ public void removeListener(ChangeListener<? super T> listener) {
+ util = InternalUtil.removeListener(util, listener);
+ }
+
+ @Override
+ public void bindBidirectional(Bindable<T> other) {
+ InternalBidirectionalBinding.bind(this, other);
+ }
+
+ @Override
+ public void unbindBidirectional(Bindable<T> other) {
+ InternalBidirectionalBinding.unbind(this, other);
+ }
+
+ @Override
+ public T getValue() {
+ valid = true;
+ return observable == null
+ ? value
+ : observable.getValue();
+ }
+
+ @Override
+ public void setValue(T newValue) {
+ if (isBound()) {
+ throw _Exceptions.unrecoverable("Cannot set value on a bound bindable.");
+ }
+ if (value != newValue) {
+ value = newValue;
+ markInvalid();
+ }
+ }
+
+ @Override
+ public boolean isBound() {
+ return observable != null;
+ }
+
+ @Override
+ public void bind(@NonNull final Observable<? extends T> newObservable) {
+ if (!newObservable.equals(this.observable)) {
+ unbind();
+ observable = newObservable;
+ if (listener == null) {
+ listener = new WeakInvalidationListener(this);
+ }
+ observable.addListener(listener);
+ markInvalid();
+ }
+ }
+
+ @Override
+ public void unbind() {
+ if (observable != null) {
+ value = observable.getValue();
+ observable.removeListener(listener);
+ observable = null;
+ }
+ }
+
+ protected void fireValueChanged() {
+ InternalUtil.fireValueChanged(util);
+ }
+
+ protected void onInvalidated() {
+ }
+
+ // -- HELPER
+
+ private void markInvalid() {
+ if (valid) {
+ valid = false;
+ onInvalidated();
+ fireValueChanged();
+ }
+ }
+
+ private static class WeakInvalidationListener
+ implements InvalidationListener, InternalUtil.WeakListener {
+
+ private final WeakReference<_BindableAbstract<?>> wref;
+
+ public WeakInvalidationListener(_BindableAbstract<?> ref) {
+ this.wref = new WeakReference<_BindableAbstract<?>>(ref);
+ }
+
+ @Override
+ public void invalidated(Observable<?> observable) {
+ _BindableAbstract<?> ref = wref.get();
+ if (ref == null) {
+ observable.removeListener(this);
+ } else {
+ ref.markInvalid();
+ }
+ }
+
+ @Override
+ public boolean isNoLongerReferenced() {
+ return wref.get() == null;
+ }
+ }
+}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/binding/_Bindables.java b/commons/src/main/java/org/apache/isis/commons/internal/binding/_Bindables.java
new file mode 100644
index 0000000..2086ac2
--- /dev/null
+++ b/commons/src/main/java/org/apache/isis/commons/internal/binding/_Bindables.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.commons.internal.binding;
... 50387 lines suppressed ...