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 2021/05/12 20:26:48 UTC
[isis] branch master updated: ISIS-2297: batch process java sources:
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 bc6f69f ISIS-2297: batch process java sources:
bc6f69f is described below
commit bc6f69f851328a43fdbb1ba994728d17c9590546
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed May 12 22:26:25 2021 +0200
ISIS-2297: batch process java sources:
- Remove unused imports
- Add missing '@Override' annotations
- Remove trailing white spaces on all lines
---
.../apache/isis/commons/binding/Observable.java | 6 +-
.../org/apache/isis/commons/collections/Can.java | 181 +++++++++--------
.../apache/isis/commons/collections/CanVector.java | 22 +-
.../apache/isis/commons/collections/Can_Empty.java | 58 +++---
.../isis/commons/collections/Can_Multiple.java | 62 +++---
.../isis/commons/collections/Can_Singleton.java | 66 +++---
.../isis/commons/collections/Cardinality.java | 4 +-
.../isis/commons/collections/ImmutableEnumSet.java | 22 +-
.../isis/commons/concurrent/AwaitableLatch.java | 2 +-
.../org/apache/isis/commons/functional/Result.java | 68 +++----
.../isis/commons/functional/ThrowingRunnable.java | 12 +-
.../commons/handler/ChainOfResponsibility.java | 24 +--
.../apache/isis/commons/having/HasEnabling.java | 2 +-
.../commons/having/HasTypeSpecificAttributes.java | 2 +-
.../apache/isis/commons/internal/_Constants.java | 10 +-
.../isis/commons/internal/assertions/_Assert.java | 24 +--
.../isis/commons/internal/base/_Blackhole.java | 2 +-
.../apache/isis/commons/internal/base/_Bytes.java | 14 +-
.../apache/isis/commons/internal/base/_Casts.java | 20 +-
.../apache/isis/commons/internal/base/_Either.java | 24 +--
.../apache/isis/commons/internal/base/_Files.java | 46 ++---
.../apache/isis/commons/internal/base/_Lazy.java | 24 +--
.../isis/commons/internal/base/_Lazy_Simple.java | 4 +-
.../commons/internal/base/_Lazy_ThreadSafe.java | 10 +-
.../internal/base/_Lazy_ThreadSafeAndWeak.java | 8 +-
.../isis/commons/internal/base/_NullSafe.java | 64 +++---
.../isis/commons/internal/base/_Objects.java | 38 ++--
.../isis/commons/internal/base/_Oneshot.java | 6 +-
.../isis/commons/internal/base/_Reduction.java | 2 +-
.../apache/isis/commons/internal/base/_Refs.java | 136 ++++++-------
.../isis/commons/internal/base/_Strings.java | 112 +++++-----
.../commons/internal/base/_Strings_FastSplit.java | 4 +-
.../internal/base/_Strings_HtmlEscaper.java | 2 +-
.../internal/base/_Strings_KeyValuePair.java | 6 +-
.../internal/base/_Strings_SplitIterator.java | 4 +-
.../apache/isis/commons/internal/base/_Text.java | 160 +++++++--------
.../apache/isis/commons/internal/base/_Timing.java | 14 +-
.../apache/isis/commons/internal/base/_Tuples.java | 22 +-
.../apache/isis/commons/internal/base/_With.java | 10 +-
.../binding/InternalBidirectionalBinding.java | 18 +-
.../commons/internal/binding/InternalUtil.java | 34 ++--
.../internal/binding/_BindableAbstract.java | 16 +-
.../isis/commons/internal/binding/_Bindables.java | 8 +-
.../commons/internal/binding/_Observables.java | 14 +-
.../commons/internal/codec/_DocumentFactories.java | 20 +-
.../commons/internal/codec/_UrlDecoderUtil.java | 2 +-
.../isis/commons/internal/collections/_Arrays.java | 128 ++++++------
.../commons/internal/collections/_Collections.java | 32 +--
.../isis/commons/internal/collections/_Inbox.java | 8 +-
.../isis/commons/internal/collections/_Lists.java | 14 +-
.../isis/commons/internal/collections/_Maps.java | 118 +++++------
.../commons/internal/collections/_Multimaps.java | 58 +++---
.../isis/commons/internal/collections/_Sets.java | 70 +++----
.../commons/internal/collections/_Streams.java | 16 +-
.../collections/snapshot/_VersionedList.java | 28 +--
.../compare/_Comparators_SequenceCompare.java | 4 +-
.../internal/concurrent/_ConcurrentContext.java | 10 +-
.../internal/concurrent/_ConcurrentTask.java | 70 +++----
.../internal/concurrent/_ConcurrentTaskList.java | 76 +++----
.../commons/internal/concurrent/_ThreadSleep.java | 8 +-
.../isis/commons/internal/context/_Context.java | 10 +-
.../internal/context/_Context_ThreadLocal.java | 16 +-
.../isis/commons/internal/context/_Plugin.java | 8 +-
.../apache/isis/commons/internal/debug/_Probe.java | 24 +--
.../commons/internal/debug/xray/XrayDataModel.java | 60 +++---
.../commons/internal/debug/xray/XrayModel.java | 30 +--
.../internal/debug/xray/XrayModelSimple.java | 6 +-
.../isis/commons/internal/debug/xray/XrayUi.java | 83 ++++----
.../commons/internal/debug/xray/_SwingUtil.java | 6 +-
.../debug/xray/sequence/SequenceDiagram.java | 132 ++++++------
.../internal/debug/xray/sequence/_Graphics.java | 44 ++--
.../commons/internal/exceptions/_Exceptions.java | 56 ++---
.../commons/internal/functions/_Functions.java | 4 +-
.../commons/internal/functions/_Predicates.java | 4 +-
.../apache/isis/commons/internal/graph/_Graph.java | 6 +-
.../apache/isis/commons/internal/hash/_Hashes.java | 16 +-
.../isis/commons/internal/image/_Images.java | 56 ++---
.../isis/commons/internal/ioc/_IocContainer.java | 14 +-
.../commons/internal/ioc/_IocContainer_Spring.java | 22 +-
.../commons/internal/ioc/_ManagedBeanAdapter.java | 2 +-
.../internal/ioc/_ManagedBeanAdapter_Spring.java | 2 +-
.../isis/commons/internal/primitives/_Ints.java | 102 +++++-----
.../isis/commons/internal/primitives/_Longs.java | 46 ++---
.../commons/internal/reflection/_Annotations.java | 70 +++----
.../reflection/_Annotations_AttributeMethods.java | 4 +-
.../reflection/_Annotations_SyntCache.java | 18 +-
...nthesizedMergedAnnotationInvocationHandler.java | 24 +--
.../commons/internal/reflection/_MethodCache.java | 32 +--
.../isis/commons/internal/reflection/_Reflect.java | 80 ++++----
.../isis/commons/internal/resources/_Json.java | 40 ++--
.../commons/internal/resources/_Resources.java | 26 +--
.../isis/commons/internal/resources/_Xml.java | 52 ++---
.../isis/commons/internal/resources/_Yaml.java | 24 +--
.../internal/testing/_SerializationTester.java | 2 +-
.../isis/commons/resource/ResourceCoordinates.java | 48 ++---
.../services/ClassLoadingStrategyAdvisor.java | 8 +-
.../apache/isis/core/config/IsisConfiguration.java | 4 +-
.../IsisBeanFactoryPostProcessorForSpring.java | 60 +++---
.../isis/core/config/beans/IsisBeanMetaData.java | 2 +-
.../core/config/beans/IsisBeanTypeClassifier.java | 32 +--
.../config/beans/IsisBeanTypeClassifierImpl.java | 54 ++---
.../core/config/beans/IsisBeanTypeRegistry.java | 8 +-
.../config/beans/IsisBeanTypeRegistryDefault.java | 34 ++--
.../config/beans/IsisComponentScanInterceptor.java | 22 +-
.../beans/IsisComponentScanInterceptorImpl.java | 36 ++--
.../core/config/beans/ScannedTypeMetaData.java | 26 +--
.../isis/core/config/beans/aoppatch/AopPatch.java | 36 ++--
.../aoppatch/TransactionInterceptorFactory.java | 2 +-
.../core/config/environment/DeploymentType.java | 2 +-
.../config/environment/IsisLocaleInitializer.java | 4 +-
.../metamodel/facets/PublishingPolicies.java | 22 +-
.../metamodel/specloader/IntrospectionMode.java | 4 +-
.../isis/core/config/presets/IsisPresets.java | 24 +--
.../config/viewer/wicket/WebAppContextPath.java | 22 +-
...teractionAwareTransactionalBoundaryHandler.java | 44 ++--
.../interaction/integration/IsisRequestCycle.java | 2 +-
.../core/interaction/scope/InteractionScope.java | 24 +--
.../interaction/scope/InteractionScopeAware.java | 16 +-
.../scope/InteractionScopeLifecycleHandler.java | 2 +-
.../interaction/session/InteractionTracker.java | 20 +-
.../core/interaction/session/IsisInteraction.java | 12 +-
.../jmocking/JUnitRuleMockery2.java | 12 +-
.../internaltestsupport/jmocking/MyMockomatic.java | 2 +-
.../jmocking/PostponedAction.java | 8 +-
.../_testing/FactoryService_forTesting.java | 4 +-
.../_testing/MetaModelContext_forTesting.java | 76 +++----
.../_testing/MethodRemoverForTesting.java | 2 +-
.../_testing/ServiceInjector_forTesting.java | 2 +-
.../_testing/ServiceRegistry_forTesting.java | 8 +-
.../_testing/_InjectorMethodEvaluator.java | 2 +-
.../metamodel/_testing/_ServiceInjectorLegacy.java | 36 ++--
.../metamodel/commons/CanonicalParameterUtil.java | 28 +--
.../core/metamodel/commons/ClassExtensions.java | 4 +-
.../isis/core/metamodel/commons/ClassUtil.java | 4 +-
.../core/metamodel/commons/MethodExtensions.java | 2 +-
.../isis/core/metamodel/commons/MethodUtil.java | 52 ++---
.../isis/core/metamodel/commons/Wormhole.java | 2 +-
.../core/metamodel/consent/InteractionAdvisor.java | 2 +-
.../apache/isis/core/metamodel/consent/Veto.java | 2 +-
.../metamodel/context/HasMetaModelContext.java | 24 +--
.../core/metamodel/context/MetaModelContext.java | 34 ++--
.../metamodel/context/MetaModelContextAware.java | 2 +-
.../context/MetaModelContext_usingIoc.java | 68 +++----
.../core/metamodel/context/MetaModelContexts.java | 2 +-
.../isis/core/metamodel/events/MetamodelEvent.java | 6 +-
.../metamodel/execution/InteractionInternal.java | 18 +-
.../apache/isis/core/metamodel/facetapi/Facet.java | 10 +-
.../core/metamodel/facetapi/FacetAbstract.java | 34 ++--
.../isis/core/metamodel/facetapi/FacetHolder.java | 20 +-
.../core/metamodel/facetapi/FacetHolderImpl.java | 32 +--
.../isis/core/metamodel/facetapi/FeatureType.java | 8 +-
.../core/metamodel/facetapi/HasFacetHolder.java | 14 +-
.../core/metamodel/facetapi/MetaModelRefiner.java | 4 +-
.../core/metamodel/facetapi/MethodRemover.java | 10 +-
.../isis/core/metamodel/facets/ActionSupport.java | 55 ++---
.../isis/core/metamodel/facets/Annotations.java | 44 ++--
.../metamodel/facets/FacetFactoryAbstract.java | 12 +-
.../isis/core/metamodel/facets/FacetedMethod.java | 16 +-
.../metamodel/facets/FacetedMethodParameter.java | 10 +-
.../core/metamodel/facets/ParameterSupport.java | 91 +++++----
...ropertyOrCollectionIdentifyingFacetFactory.java | 4 +-
...rCollectionIdentifyingFacetFactoryAbstract.java | 4 +-
.../core/metamodel/facets/TypedHolderDefault.java | 2 +-
.../facets/actcoll/typeof/TypeOfFacet.java | 28 +--
...nChoicesForCollectionParameterFacetFactory.java | 30 +--
.../actions/action/ActionOverloadingValidator.java | 24 +--
.../explicit/ActionExplicitFacetAbstract.java | 2 +-
.../hidden/HiddenFacetForActionAnnotation.java | 2 +-
.../action/invocation/ActionDomainEventFacet.java | 2 +-
.../invocation/ActionDomainEventFacetAbstract.java | 12 +-
.../action/invocation/ActionInvocationFacet.java | 2 +-
...onInvocationFacetForDomainEventFromDefault.java | 2 +-
.../actions/contributing/ContributingFacet.java | 18 +-
.../contributing/ContributingFacetAbstract.java | 6 +-
...tributingFacetDerivedFromMixinFacetFactory.java | 20 +-
.../ActionDefaultsFacetViaMethodFactory.java | 2 +-
.../annotation/HomePageFacetAnnotationFactory.java | 30 +--
...tionPositionFacetForActionLayoutAnnotation.java | 2 +-
.../CssClassFaFacetForActionLayoutAnnotation.java | 2 +-
.../PromptStyleFacetForActionLayoutAnnotation.java | 2 +-
.../RedirectFacetFromActionLayoutAnnotation.java | 4 +-
...viceMenuFacetDerivedFromDomainServiceFacet.java | 2 +-
.../semantics/ActionSemanticsFacetAbstract.java | 4 +-
.../ActionParameterValidationFacetAbstract.java | 4 +-
.../validate/ActionValidationFacetAbstract.java | 4 +-
.../ActionParameterValidationFacetViaMethod.java | 2 +-
.../method/ActionValidationFacetViaMethod.java | 12 +-
.../ActionValidationFacetViaMethodFactory.java | 12 +-
.../facets/collections/CollectionFacet.java | 36 ++--
.../collections/CollectionFacetAbstract.java | 2 +-
.../CollectionAccessorFacetViaAccessor.java | 4 +-
.../CollectionAnnotationFacetFactory.java | 4 +-
.../javautilcollection/JavaArrayFacet.java | 8 +-
.../javautilcollection/JavaCollectionFacet.java | 10 +-
.../layout/CollectionLayoutFacetFactory.java | 8 +-
.../HiddenFacetForCollectionLayoutAnnotation.java | 4 +-
.../NamedFacetForCollectionLayoutAnnotation.java | 2 +-
.../layout/SortedByFacetForCollectionXml.java | 4 +-
.../annotation/SortedByFacetAnnotationFactory.java | 10 +-
.../collparam/semantics/CollectionSemantics.java | 4 +-
.../facets/fallback/FallbackFacetFactory.java | 4 +-
.../metamodel/facets/jaxb/JaxbFacetFactory.java | 28 +--
...assFacetOnActionFromConfiguredRegexFactory.java | 6 +-
.../facets/members/cssclassfa/CssClassFaFacet.java | 16 +-
.../cssclassfa/CssClassFaFacetAbstract.java | 36 ++--
.../annotprop/CssClassFaFacetOnMemberFactory.java | 2 +-
.../cssclassfa/annotprop/MixinInterceptor.java | 4 +-
.../annotprop/DescribedAsFacetOnMemberFactory.java | 2 +-
.../method/DisableForContextFacetViaMethod.java | 6 +-
.../DisableForContextFacetViaMethodFactory.java | 4 +-
.../facets/members/hidden/HiddenFacetAbstract.java | 18 +-
.../HideForContextFacetViaMethodFactory.java | 18 +-
.../members/layout/group/GroupIdAndName.java | 44 ++--
.../members/layout/group/LayoutGroupFacet.java | 22 +-
.../layout/group/LayoutGroupFacetAbstract.java | 12 +-
.../LayoutGroupFacetFromActionAnnotation.java | 6 +-
...LayoutGroupFacetFromActionLayoutAnnotation.java | 6 +-
...youtGroupFacetFromPropertyLayoutAnnotation.java | 2 +-
.../layout/group/LayoutGroupFacetFromXml.java | 20 +-
.../members/layout/order/LayoutOrderFacet.java | 12 +-
.../layout/order/LayoutOrderFacetAbstract.java | 10 +-
...LayoutOrderFacetFromActionLayoutAnnotation.java | 6 +-
...utOrderFacetFromCollectionLayoutAnnotation.java | 6 +-
...youtOrderFacetFromPropertyLayoutAnnotation.java | 6 +-
.../layout/order/LayoutOrderFacetFromXml.java | 4 +-
.../publish/command/CommandPublishingFacet.java | 14 +-
.../command/CommandPublishingFacetAbstract.java | 4 +-
.../CommandPublishingFacetForActionAnnotation.java | 2 +-
...onPublishingActionFacetForActionAnnotation.java | 2 +-
...ActionFacetForActionAnnotationAsConfigured.java | 2 +-
...tionPublishingActionFacetFromConfiguration.java | 2 +-
.../ExecutionPublishingFacetAbstract.java | 2 +-
...blishingPropertyFacetForPropertyAnnotation.java | 2 +-
...ertyFacetForPropertyAnnotationAsConfigured.java | 4 +-
...onPublishingPropertyFacetFromConfiguration.java | 2 +-
.../ViewModelSemanticCheckingFacetFactory.java | 8 +-
.../autocomplete/AutoCompleteFacetAbstract.java | 4 +-
.../object/bookmarkpolicy/BookmarkPolicyFacet.java | 4 +-
.../BookmarkPolicyFacetAbstract.java | 4 +-
.../BookmarkPolicyFacetFallbackFactory.java | 4 +-
.../callbacks/CreatedCallbackFacetFactory.java | 2 +-
.../PersistCallbackViaSaveMethodFacetFactory.java | 2 +-
.../RemoveCallbackViaDeleteMethodFacetFactory.java | 2 +-
.../choices/ChoicesFacetFromBoundedAbstract.java | 10 +-
.../object/choices/enums/ChoicesFacetEnum.java | 4 +-
...ingValueFacetUsingSemanticsProviderFactory.java | 6 +-
...ssClassFaFacetForDomainObjectLayoutFactory.java | 16 +-
.../object/defaults/DefaultedFacetAbstract.java | 4 +-
.../object/defaults/DefaultsProviderUtil.java | 34 ++--
.../annotcfg/DefaultedFacetAnnotation.java | 12 +-
...tedFacetAnnotationElseConfigurationFactory.java | 2 +-
.../DisabledObjectFacetViaMethodFactory.java | 2 +-
.../DomainObjectAnnotationFacetFactory.java | 14 +-
...itingEnabledFacetForDomainObjectAnnotation.java | 6 +-
.../ImmutableFacetForDomainObjectAnnotation.java | 10 +-
...gePublishingFacetForDomainObjectAnnotation.java | 8 +-
...tityChangePublishingFacetFromConfiguration.java | 4 +-
...atableObjectFacetForDomainObjectAnnotation.java | 2 +-
...PolicyFacetForDomainObjectLayoutAnnotation.java | 2 +-
...lassFaFacetForDomainObjectLayoutAnnotation.java | 2 +-
...sClassFacetForDomainObjectLayoutAnnotation.java | 4 +-
...ObjectLayoutAnnotationUsingCssClassUiEvent.java | 4 +-
...ibedAsFacetForDomainObjectLayoutAnnotation.java | 2 +-
...inObjectLayoutAnnotationUsingLayoutUiEvent.java | 6 +-
.../PagedFacetForDomainObjectLayoutAnnotation.java | 4 +-
...PluralFacetForDomainObjectLayoutAnnotation.java | 4 +-
...ainObjectLayoutAnnotationUsingTitleUiEvent.java | 26 +--
.../object/domainservice/DomainServiceFacet.java | 18 +-
.../DomainServiceFacetAnnotationFactory.java | 8 +-
.../DomainServiceLayoutFacetFactory.java | 10 +-
.../object/encodeable/EncodableFacetAbstract.java | 8 +-
.../annotcfg/EncodableFacetFromConfiguration.java | 2 +-
.../facets/object/entity/EntityFacet.java | 12 +-
.../facets/object/entity/PersistenceStandard.java | 4 +-
.../facets/object/grid/GridFacetDefault.java | 28 +--
.../facets/object/grid/GridFacetFactory.java | 6 +-
.../hidden/method/HiddenObjectFacetViaMethod.java | 4 +-
.../metamodel/facets/object/icon/IconFacet.java | 4 +-
.../RemoveAnnotatedMethodsFacetFactory.java | 4 +-
.../ignore/javalang/RemoveMethodsFacetFactory.java | 10 +-
.../object/immutable/EditingEnabledFacet.java | 6 +-
.../facets/object/immutable/ImmutableFacet.java | 6 +-
.../facets/object/layout/LayoutFacet.java | 4 +-
.../facets/object/layout/LayoutFacetFallback.java | 2 +-
.../mixin/MetaModelValidatorForMixinTypes.java | 10 +-
.../metamodel/facets/object/mixin/MixinFacet.java | 10 +-
.../facets/object/mixin/MixinFacetAbstract.java | 10 +-
.../mixin/MixinFacetForDomainObjectAnnotation.java | 20 +-
.../NavigableParentAnnotationFacetFactory.java | 6 +-
.../objectspecid/ObjectSpecIdFacetAbstract.java | 4 +-
.../ObjectSpecIdMalformedValidator.java | 22 +-
.../impl/ObjectValidPropertiesFacetImpl.java | 2 +-
.../object/parseable/ParseableFacetAbstract.java | 4 +-
.../facets/object/parseable/ParserUtil.java | 6 +-
.../parser/ParseableFacetUsingParser.java | 6 +-
.../ProjectionFacetFromProjectingProperty.java | 2 +-
.../entitychange/EntityChangePublishingFacet.java | 12 +-
.../EntityChangePublishingFacetAbstract.java | 6 +-
.../EntityChangePublishingFacetImpl.java | 2 +-
.../RecreatableObjectFacetAbstract.java | 12 +-
...ObjectFacetDeclarativeInitializingAbstract.java | 22 +-
.../recreatable/RecreatableObjectFacetFactory.java | 14 +-
...ableObjectFacetForXmlRootElementAnnotation.java | 2 +-
.../annotation/TitleAnnotationFacetFactory.java | 2 +-
.../title/methods/TitleFacetViaMethodsFactory.java | 2 +-
.../title/methods/TitleFacetViaTitleMethod.java | 12 +-
.../method/ValidateObjectFacetMethod.java | 2 +-
.../value/annotcfg/ValueFacetAnnotation.java | 12 +-
...ValueFacetAnnotationOrConfigurationFactory.java | 6 +-
.../annotcfg/ValueFacetFromConfiguration.java | 6 +-
.../vsp/ValueFacetUsingSemanticsProvider.java | 2 +-
.../ValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../ValueSemanticsProviderAndFacetAbstract.java | 4 +-
.../value/vsp/ValueSemanticsProviderUtil.java | 28 +--
.../facets/object/viewmodel/ViewModelFacet.java | 6 +-
.../objectvalue/choices/ChoicesFacetAbstract.java | 2 +-
.../mandatory/MandatoryFacetAbstract.java | 4 +-
.../multiline/MultiLineFacetAbstract.java | 4 +-
.../objectvalue/typicallen/TypicalLengthFacet.java | 8 +-
.../ActionParameterAutoCompleteFacetAbstract.java | 4 +-
.../facets/param/autocomplete/MinLengthUtil.java | 6 +-
.../ActionParameterAutoCompleteFacetViaMethod.java | 10 +-
...ParameterAutoCompleteFacetViaMethodFactory.java | 14 +-
...ameterFromJavaxValidationAnnotationFactory.java | 2 +-
.../ActionParameterChoicesFacetAbstract.java | 4 +-
.../choices/ActionParameterChoicesFacetNone.java | 2 +-
...rameterChoicesFacetDerivedFromChoicesFacet.java | 2 +-
...ChoicesFacetDerivedFromChoicesFacetFactory.java | 2 +-
.../method/ActionChoicesFacetViaMethod.java | 8 +-
.../method/ActionChoicesFacetViaMethodFactory.java | 14 +-
.../ActionParameterChoicesFacetViaMethod.java | 14 +-
...ctionParameterChoicesFacetViaMethodFactory.java | 16 +-
.../defaults/ActionParameterDefaultsFacet.java | 6 +-
.../ActionParameterDefaultsFacetAbstract.java | 4 +-
.../ActionParameterDefaultsFacetViaMethod.java | 18 +-
...tionParameterDefaultsFacetViaMethodFactory.java | 18 +-
.../disable/ActionParameterDisabledFacet.java | 2 +-
.../ActionParameterDisabledFacetAbstract.java | 4 +-
.../ActionParameterDisabledFacetViaMethod.java | 12 +-
...tionParameterDisabledFacetViaMethodFactory.java | 18 +-
.../param/hide/ActionParameterHiddenFacet.java | 2 +-
.../hide/ActionParameterHiddenFacetAbstract.java | 10 +-
.../ActionParameterHiddenFacetViaMethod.java | 8 +-
...ActionParameterHiddenFacetViaMethodFactory.java | 16 +-
.../param/layout/ParameterLayoutFacetFactory.java | 4 +-
.../NamedFacetForParameterUsingReflection.java | 2 +-
.../ParameterNameFacetFactoryUsingReflection.java | 8 +-
.../parameter/ParameterAnnotationFacetFactory.java | 4 +-
...cetInvertedByNullableAnnotationOnParameter.java | 6 +-
...fySpecificationFacetForParameterAnnotation.java | 4 +-
.../validate/ActionParameterValidationFacet.java | 10 +-
.../ActionParameterValidationFacetAbstract.java | 4 +-
.../ActionParameterValidationFacetViaMethod.java | 22 +-
...onParameterValidationFacetViaMethodFactory.java | 16 +-
.../PropertyAccessorFacetViaAccessorFactory.java | 4 +-
.../method/PropertyAutoCompleteFacetMethod.java | 8 +-
.../PropertyAutoCompleteFacetMethodFactory.java | 12 +-
...FromJavaxValidationDigitsAnnotationFactory.java | 2 +-
.../method/PropertyChoicesFacetViaMethod.java | 12 +-
.../PropertyChoicesFacetViaMethodFactory.java | 8 +-
...PropertyDefaultFacetDerivedFromTypeFactory.java | 2 +-
.../PropertyDefaultFacetViaMethodFactory.java | 6 +-
...isabledFacetOnPropertyDerivedFromImmutable.java | 6 +-
...FacetOnPropertyDerivedFromImmutableFactory.java | 6 +-
.../ProjectingFacetFromPropertyAnnotation.java | 6 +-
.../property/PropertyAnnotationFacetFactory.java | 4 +-
.../DisabledFacetForPropertyAnnotation.java | 2 +-
...acetInvertedByNullableAnnotationOnProperty.java | 4 +-
...tySetterOrClearFacetForDomainEventAbstract.java | 7 +-
...sfySpecificationFacetForPropertyAnnotation.java | 4 +-
.../RegExFacetForPatternAnnotationOnProperty.java | 2 +-
.../MultiLineFacetForPropertyLayoutAnnotation.java | 2 +-
.../MultiLineFacetForPropertyXml.java | 4 +-
.../NamedFacetForPropertyLayoutAnnotation.java | 2 +-
...romptStyleFacetForPropertyLayoutAnnotation.java | 2 +-
.../propertylayout/PropertyLayoutFacetFactory.java | 30 +--
.../RenderedAdjustedFacetForPropertyXml.java | 2 +-
.../update/PropertySetterFacetFactory.java | 2 +-
.../update/clear/PropertyClearFacet.java | 2 +-
.../clear/PropertyClearFacetViaSetterMethod.java | 2 +-
.../modify/PropertySetterFacetViaSetterMethod.java | 2 +-
.../method/PropertyValidateFacetViaMethod.java | 2 +-
.../PropertyValidateFacetViaMethodFactory.java | 2 +-
.../facets/schema/chg/ChangesDtoValueFacet.java | 2 +-
.../facets/schema/cmd/CommandDtoValueFacet.java | 2 +-
.../schema/ixn/InteractionDtoValueFacet.java | 2 +-
.../ValueSemanticsProviderAbstractTemporal.java | 4 +-
.../BigDecimalValueSemanticsProvider.java | 4 +-
.../value/blobs/BlobValueSemanticsProvider.java | 6 +-
.../facets/value/bytes/ByteValueFacet.java | 2 +-
.../bytes/ByteValueSemanticsProviderAbstract.java | 4 +-
.../chars/CharPrimitiveValueSemanticsProvider.java | 2 +-
.../facets/value/chars/CharValueFacet.java | 2 +-
.../value/clobs/ClobValueSemanticsProvider.java | 4 +-
.../JodaLocalDateValueSemanticsProvider.java | 2 +-
.../JodaLocalDateTimeValueSemanticsProvider.java | 4 +-
.../doubles/DoubleFloatingPointValueFacet.java | 2 +-
.../DoubleValueSemanticsProviderAbstract.java | 4 +-
.../DoubleWrapperValueSemanticsProvider.java | 2 +-
.../facets/value/image/ImageValueFacet.java | 6 +-
.../image/ImageValueSemanticsProviderAbstract.java | 22 +-
...ageValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../JavaAwtImageValueSemanticsProvider.java | 18 +-
.../facets/value/integer/IntegerValueFacet.java | 2 +-
.../localrespath/LocalResourcePathValueFacet.java | 2 +-
.../facets/value/longs/LongValueFacet.java | 2 +-
.../facets/value/markup/MarkupValueFacet.java | 2 +-
.../value/markup/MarkupValueSemanticsProvider.java | 4 +-
.../password/PasswordValueSemanticsProvider.java | 4 +-
.../facets/value/shortint/ShortValueFacet.java | 2 +-
.../value/string/StringValueSemanticsProvider.java | 4 +-
.../facets/value/temporal/TemporalAdjust.java | 28 +--
.../facets/value/temporal/TemporalAdjustUtil.java | 22 +-
.../facets/value/temporal/TemporalValueFacet.java | 18 +-
...ralValueFacetUsingSemanticsProviderFactory.java | 10 +-
.../TemporalValueSemanticsProviderAbstract.java | 68 +++----
...ateValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../localdate/LocalDateValueSemanticsProvider.java | 10 +-
...imeValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../LocalDateTimeValueSemanticsProvider.java | 12 +-
...imeValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../localtime/LocalTimeValueSemanticsProvider.java | 10 +-
...imeValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../OffsetDateTimeValueSemanticsProvider.java | 14 +-
...imeValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../OffsetTimeValueSemanticsProvider.java | 12 +-
...imeValueFacetUsingSemanticsProviderFactory.java | 2 +-
.../ZonedDateTimeValueSemanticsProvider.java | 16 +-
.../metamodel/facets/value/url/URLValueFacet.java | 2 +-
.../facets/value/uuid/UUIDValueFacet.java | 2 +-
.../inspect/IsisModuleCoreMetamodelInspection.java | 2 +-
.../core/metamodel/inspect/model/ActionNode.java | 24 +--
.../metamodel/inspect/model/CollectionNode.java | 16 +-
.../metamodel/inspect/model/FacetAttrNode.java | 16 +-
.../metamodel/inspect/model/FacetGroupNode.java | 16 +-
.../core/metamodel/inspect/model/FacetNode.java | 12 +-
.../isis/core/metamodel/inspect/model/MMNode.java | 14 +-
.../metamodel/inspect/model/MMNodeFactory.java | 8 +-
.../metamodel/inspect/model/ParameterNode.java | 12 +-
.../core/metamodel/inspect/model/PropertyNode.java | 16 +-
.../core/metamodel/inspect/model/TypeNode.java | 20 +-
.../interactions/ActionArgUsabilityContext.java | 20 +-
.../interactions/ActionArgValidityContext.java | 20 +-
.../interactions/ActionArgVisibilityContext.java | 24 +--
.../interactions/ActionUsabilityContext.java | 4 +-
.../interactions/ActionValidityContext.java | 4 +-
.../interactions/ActionVisibilityContext.java | 4 +-
.../interactions/CollectionUsabilityContext.java | 2 +-
.../interactions/CollectionVisibilityContext.java | 2 +-
.../metamodel/interactions/InteractionContext.java | 20 +-
.../interactions/InteractionEventSupplier.java | 4 +-
.../metamodel/interactions/InteractionHead.java | 24 +--
.../metamodel/interactions/InteractionUtils.java | 34 ++--
.../metamodel/interactions/ObjectTitleContext.java | 6 +-
.../interactions/ObjectValidityContext.java | 6 +-
.../interactions/ObjectVisibilityContext.java | 8 +-
.../metamodel/interactions/ParseValueContext.java | 6 +-
.../interactions/PropertyAccessContext.java | 6 +-
.../interactions/PropertyModifyContext.java | 4 +-
.../interactions/PropertyUsabilityContext.java | 2 +-
.../metamodel/interactions/UsabilityContext.java | 2 +-
.../interactions/ValidatingInteractionAdvisor.java | 2 +-
.../metamodel/interactions/ValidityContext.java | 2 +-
.../metamodel/interactions/VisibilityContext.java | 2 +-
.../interactions/managed/ActionInteraction.java | 36 ++--
.../managed/ActionInteractionHead.java | 72 +++----
.../managed/CollectionInteraction.java | 24 +--
.../interactions/managed/HasMetaModel.java | 2 +-
.../interactions/managed/InteractionVeto.java | 38 ++--
.../interactions/managed/ManagedAction.java | 68 +++----
.../interactions/managed/ManagedCollection.java | 28 +--
.../interactions/managed/ManagedFeature.java | 34 ++--
.../interactions/managed/ManagedMember.java | 71 +++----
.../interactions/managed/ManagedParameter.java | 23 ++-
.../interactions/managed/ManagedValue.java | 4 +-
.../interactions/managed/MemberInteraction.java | 40 ++--
.../managed/ParameterNegotiationModel.java | 102 +++++-----
.../interactions/managed/PropertyInteraction.java | 24 +--
.../managed/PropertyNegotiationModel.java | 38 ++--
.../isis/core/metamodel/layout/DeweyOrderSet.java | 2 +-
.../core/metamodel/layout/LayoutFacetUtil.java | 28 +--
.../memberorderfacet/MemberOrderComparator.java | 4 +-
...nnotationEnforcesSupportingMethodValidator.java | 2 +-
.../core/metamodel/methods/MethodByClassMap.java | 4 +-
.../isis/core/metamodel/methods/MethodFinder.java | 64 +++---
.../core/metamodel/methods/MethodFinderUtils.java | 82 ++++----
.../metamodel/methods/MethodLiteralConstants.java | 46 ++---
.../MethodPrefixBasedFacetFactoryAbstract.java | 40 ++--
.../methods/OrphanedSupportingMethodValidator.java | 16 +-
.../metamodel/objectmanager/ObjectManager.java | 26 +--
.../objectmanager/ObjectManagerDefault.java | 10 +-
.../objectmanager/create/ObjectCreator.java | 32 +--
.../create/ObjectCreator_builtinHandlers.java | 118 +++++------
.../objectmanager/detach/ObjectDetacher.java | 16 +-
.../detach/ObjectDetacher_builtinHandlers.java | 34 ++--
.../objectmanager/identify/ObjectBookmarker.java | 16 +-
.../identify/ObjectBookmarker_builtinHandlers.java | 2 +-
.../metamodel/objectmanager/load/ObjectLoader.java | 30 +--
.../load/ObjectLoader_builtinHandlers.java | 82 ++++----
.../objectmanager/query/ObjectBulkLoader.java | 26 +--
.../query/ObjectBulkLoader_builtinHandlers.java | 38 ++--
.../objectmanager/refresh/ObjectRefresher.java | 18 +-
.../refresh/ObjectRefresher_builtinHandlers.java | 40 ++--
.../objectmanager/serialize/ObjectSerializer.java | 16 +-
.../ObjectSerializer_builtinHandlers.java | 22 +-
.../ObjectSpecificationPostProcessorAbstract.java | 4 +-
.../DeriveDisabledFromImmutablePostProcessor.java | 2 +-
.../progmodel/ProgrammingModelService.java | 4 +-
.../metamodel/services/ServiceInjectorDefault.java | 12 +-
.../isis/core/metamodel/services/ServiceUtil.java | 4 +-
.../appfeat/ApplicationFeatureDefault.java | 10 +-
.../core/metamodel/services/appfeat/_Asserts.java | 2 +-
.../classsubstitutor/ClassSubstitutor.java | 44 ++--
.../classsubstitutor/ClassSubstitutorAbstract.java | 2 +-
.../classsubstitutor/ClassSubstitutorDefault.java | 2 +-
.../ClassSubstitutorForCollections.java | 2 +-
.../ClassSubstitutorForDomainObjects.java | 14 +-
.../classsubstitutor/ClassSubstitutorRegistry.java | 16 +-
.../services/events/MetamodelEventService.java | 6 +-
.../services/grid/GridReaderUsingJaxb.java | 6 +-
.../services/grid/GridServiceDefault.java | 10 +-
.../services/layout/LayoutServiceDefault.java | 2 +-
.../services/message/MessageServiceNoop.java | 2 +-
.../services/metamodel/DomainMemberDefault.java | 8 +-
.../services/metamodel/DomainModelDefault.java | 2 +-
.../services/metamodel/MetaModelExportSupport.java | 6 +-
.../services/registry/ServiceRegistryDefault.java | 18 +-
.../services/title/TitleServiceDefault.java | 24 +--
.../title/TitlesAndTranslationsValidator.java | 56 ++---
.../isis/core/metamodel/spec/Hierarchical.java | 2 +-
.../core/metamodel/spec/feature/CurrentHolder.java | 2 +-
.../isis/core/metamodel/spec/feature/MixedIn.java | 6 +-
.../spec/feature/MutableCurrentHolder.java | 2 +-
.../metamodel/spec/feature/ObjectAssociation.java | 2 +-
.../metamodel/specloader/LogicalTypeResolver.java | 4 +-
.../specloader/LogicalTypeResolverDefault.java | 6 +-
.../specloader/ProgrammingModelServiceDefault.java | 26 +--
.../metamodel/specloader/SpecificationCache.java | 2 +-
.../specloader/SpecificationCacheDefault.java | 12 +-
.../metamodel/specloader/SpecificationLoader.java | 60 +++---
.../specloader/SpecificationLoaderDefault.java | 138 ++++++-------
.../SpecificationLoaderDefault_debug.java | 18 +-
.../specloader/specimpl/FacetedMethodsBuilder.java | 112 +++++-----
.../metamodel/specloader/specimpl/Factories.java | 8 +-
.../specloader/specimpl/MemberSortingUtils.java | 4 +-
.../specimpl/ObjectActionParameterAbstract.java | 62 +++---
.../specimpl/OneToManyActionParameterDefault.java | 4 +-
.../specimpl/OneToOneActionParameterDefault.java | 4 +-
.../specloader/typeextract/TypeExtractor.java | 38 ++--
.../validator/MetaModelInvalidException.java | 2 +-
.../specloader/validator/MetaModelValidator.java | 2 +-
.../validator/MetaModelValidatorAbstract.java | 8 +-
...ModelValidatorForAmbiguousMixinAnnotations.java | 12 +-
...etaModelValidatorForConflictingOptionality.java | 8 +-
.../validator/MetaModelVisitingValidator.java | 8 +-
.../MetaModelVisitingValidatorAbstract.java | 10 +-
.../specloader/validator/ValidationFailure.java | 28 +--
.../specloader/validator/ValidationFailures.java | 10 +-
.../apache/isis/core/metamodel/util/EventUtil.java | 2 +-
.../metamodel/util/pchain/ParentChainDefault.java | 2 +-
.../core/metamodel/util/snapshot/XmlSchema.java | 26 +--
.../valuetypes/ValueTypeProviderForBuiltin.java | 2 +-
.../isis/core/runtime/IsisModuleCoreRuntime.java | 2 +-
.../core/runtime/context/IsisAppCommonContext.java | 62 +++---
.../isis/core/runtime/context/RuntimeContext.java | 6 +-
.../core/runtime/context/RuntimeContextBase.java | 20 +-
.../core/runtime/events/MetamodelEventService.java | 18 +-
.../runtime/events/TransactionEventEmitter.java | 8 +-
.../org/apache/isis/core/runtime/events/_Xray.java | 54 ++---
.../runtime/memento/ObjectMementoCollection.java | 8 +-
.../runtime/memento/ObjectMementoForEmpty.java | 4 +-
.../core/runtime/memento/ObjectMementoService.java | 4 +-
.../bookmarks/BookmarkServiceDefault.java | 16 +-
.../runtimeservices/email/EmailServiceDefault.java | 6 +-
.../executor/MemberExecutorServiceDefault.java | 6 +-
.../isis/core/runtimeservices/executor/_Xray.java | 56 ++---
.../factory/FactoryServiceDefault.java | 34 ++--
.../homepage/HomePageResolverServiceDefault.java | 6 +-
.../isis/core/runtimeservices/i18n/po/Block.java | 1 -
.../i18n/po/TranslationServicePoMenu.java | 8 +-
.../interaction/InteractionDtoFactoryDefault.java | 2 +-
.../menubars/MenuBarsLoaderServiceDefault.java | 10 +-
.../menubars/bootstrap3/MenuBarsServiceBS3.java | 26 +--
.../menubars/bootstrap3/ServiceAndAction.java | 2 +-
.../message/MessageServiceDefault.java | 8 +-
.../publish/CommandPublisherDefault.java | 30 +--
.../publish/EntityChangesPublisherDefault.java | 23 ++-
.../EntityPropertyChangePublisherDefault.java | 30 +--
.../publish/ExecutionPublisherDefault.java | 16 +-
.../isis/core/runtimeservices/publish/_Xray.java | 138 ++++++-------
.../ExceptionRecognizerForDataAccessException.java | 26 +--
.../repository/RepositoryServiceDefault.java | 16 +-
.../routing/RoutingServiceDefault.java | 2 +-
.../scratchpad/ScratchpadDefault.java | 2 +
.../runtimeservices/session/AnonymousSession.java | 4 +-
.../session/InteractionFactoryDefault.java | 108 +++++-----
.../isis/core/runtimeservices/session/_Xray.java | 52 ++---
.../transaction/TransactionServiceSpring.java | 126 ++++++------
.../user/ImpersonateMenuAdvisorDefault.java | 1 -
.../user/ImpersonatedUserHolderDefault.java | 1 -
.../userreg/EmailNotificationServiceDefault.java | 2 +-
.../InteractionEventDispatcherTypeSafe.java | 2 +-
.../AbstractCollectionInvocationHandler.java | 8 +-
.../handlers/CollectionInvocationHandler.java | 2 +-
.../DelegatingInvocationHandlerDefault.java | 14 +-
.../wrapper/handlers/ProxyContextHandler.java | 24 +--
.../runtimeservices/xml/XmlServiceDefault.java | 2 +-
.../xmlsnapshot/XmlSnapshotServiceDefault.java | 8 +-
.../isis/core/security/IsisModuleCoreSecurity.java | 2 +-
.../authentication/AuthenticationAbstract.java | 16 +-
.../authentication/AuthenticationContext.java | 16 +-
.../AuthenticationRequestLogonFixture.java | 4 +-
.../health/HealthAuthentication.java | 4 +-
.../authentication/logout/LogoutHandler.java | 16 +-
.../security/authentication/logout/LogoutMenu.java | 24 +--
.../singleuser/SingleUserAuthentication.java | 4 +-
.../standard/RandomCodeGeneratorDefault.java | 2 +-
.../standard/SimpleAuthentication.java | 14 +-
.../apache/isis/core/security/util/XrayUtil.java | 34 ++--
.../transaction/IsisModuleCoreTransaction.java | 2 +-
.../changetracking/EntityChangeTrackerDefault.java | 16 +-
.../changetracking/HasEnlistedEntityChanges.java | 2 +-
.../changetracking/_ChangingEntitiesFactory.java | 4 +-
.../changetracking/_PreAndPostValue.java | 16 +-
.../changetracking/_PropertyChangeRecord.java | 16 +-
.../core/transaction/changetracking/_Xray.java | 56 ++---
.../events/IsisTransactionPlaceholder.java | 2 +-
.../changetracking/events/PostStoreEvent.java | 4 +-
.../changetracking/events/PreStoreEvent.java | 4 +-
.../events/TransactionAfterCompletionEvent.java | 12 +-
.../events/TransactionBeforeCompletionEvent.java | 6 +-
.../apache/isis/core/webapp/modules/WebModule.java | 26 +--
.../core/webapp/modules/WebModuleAbstract.java | 4 +-
.../isis/core/webapp/modules/WebModuleContext.java | 10 +-
.../modules/logonlog/IsisLogOnExceptionFilter.java | 14 +-
.../logonlog/WebModuleLogOnExceptionLogger.java | 2 +-
.../TemplateResourceCachingFilter.java | 6 +-
.../templresources/TemplateResourceServlet.java | 14 +-
...plateResourceServlet_HtmlTemplateVariables.java | 4 +-
.../templresources/WebModuleTemplateResources.java | 2 +-
.../core/webapp/routing/ForwardingServlet.java | 4 +-
.../isis/core/webapp/routing/RedirectServlet.java | 2 +-
.../webappctx/IsisWebAppContextInitializer.java | 30 +--
.../dom/_infra/LibraryPreloadingService.java | 4 +-
.../HasAsciiDocDescription_description.java | 2 +-
.../HasAsciiDocDescription_sources.java | 2 +-
.../dom/_infra/fixtures/DemoFixtureScript.java | 4 -
.../DemoFixtureScriptSpecificationProvider.java | 2 -
.../_infra/resources/AsciiDocReaderService.java | 4 +-
.../resources/MarkupVariableResolverService.java | 4 +-
.../demoapp/dom/_infra/samples/NameSamples.java | 4 -
.../java/demoapp/dom/_infra/seed/SeedService.java | 4 -
.../UrlEncodingServiceNaiveInMemory.java | 24 +--
...utionListenerToCaptureInteractionsInMemory.java | 1 -
.../dom/domain/_interactions/InteractionDtoVm.java | 2 +-
.../ActionLayoutPositionVm_annotatedBelow.java | 4 +-
.../ActionLayoutPositionVm_annotatedPanel.java | 4 +-
...ionLayoutPositionVm_annotatedPanelDropDown.java | 4 +-
.../ActionLayoutPositionVm_annotatedRight.java | 4 +-
.../ActionLayoutPositionVm_layoutBelow.java | 2 +-
.../ActionLayoutPositionVm_layoutPanel.java | 2 +-
...ActionLayoutPositionVm_layoutPanelDropDown.java | 2 +-
.../ActionLayoutPositionVm_layoutRight.java | 2 +-
.../ActionLayoutPromptStyleVm_annotatedInline.java | 4 +-
...ayoutPromptStyleVm_annotatedInlineAsIfEdit.java | 4 +-
.../ActionLayoutPromptStyleVm_annotatedModal.java | 4 +-
...ActionLayoutPromptStyleVm_annotatedSidebar.java | 4 +-
...omainObjectEntityChangePublishingVm_create.java | 2 +-
...omainObjectEntityChangePublishingVm_delete.java | 2 +-
...inObjectEntityChangePublishingVm_updateAll.java | 2 +-
.../other/mixins/CountHolder_explanation.java | 2 +-
.../core/messageservice/MessageServiceDemoVm.java | 4 +-
.../dom/types/isis/markups/vm/IsisMarkupVm.java | 2 +-
.../asciidocs/holder/IsisAsciiDocHolder2.java | 8 +-
.../types/isisext/markdowns/vm/IsisMarkdownVm.java | 2 +-
.../booleans/holder/WrapperBooleanHolder2.java | 6 +-
.../holder/JodaLocalDateTimeHolder2.java | 2 +-
.../jodalocaltime/holder/JodaLocalTimeHolder2.java | 2 +-
.../samples/JodaLocalTimeSamples.java | 2 +-
.../main/java/demoapp/javafx/DemoAppJavaFx.java | 8 +-
.../java/demoapp/webapp/vaadin/DemoAppVaadin.java | 14 +-
.../java/demoapp/web/DemoAppManifestCommon.java | 6 +-
.../main/java/demoapp/web/DemoAppManifestJdo.java | 2 +-
.../main/java/demoapp/web/DemoAppManifestJpa.java | 2 +-
.../web/_infra/utils/ThereCanBeOnlyOne.java | 20 +-
.../java/demoapp/web/linebreaker/LineBreaker.java | 4 +-
.../webapp/wicket/jdo/DemoAppWicketJdo.java | 6 +-
.../webapp/wicket/jpa/DemoAppWicketJpa.java | 8 +-
.../model/IsisModuleExtCommandLogApplib.java | 14 +-
.../commandlog/model/command/CommandModel.java | 22 +-
.../model/command/CommandModelRepository.java | 8 +-
.../commandlog/jdo/IsisModuleExtCommandLogJdo.java | 4 +-
.../commandlog/jdo/entities/CommandJdo.java | 5 +-
.../jdo/entities/CommandJdo_childCommands.java | 2 +-
.../commandlog/jdo/entities/CommandJdo_retry.java | 2 +-
.../jdo/entities/CommandJdo_siblingCommands.java | 2 +-
.../jdo/mixins/Object_recentCommands.java | 2 +-
.../commandlog/jpa/IsisModuleExtCommandLogJpa.java | 2 +-
.../commandlog/jpa/entities/CommandJpa.java | 7 +-
.../jpa/entities/CommandJpaRepository.java | 2 +-
.../primary/mixins/Object_openOnSecondary.java | 1 -
.../IsisModuleExtCommandReplaySecondary.java | 2 +-
.../secondary/job/ReplicateAndReplayJob.java | 1 +
.../jobcallables/ReplicateAndRunCommands.java | 2 +-
.../secondary/mixins/Object_openOnPrimary.java | 1 -
.../flyway/impl/IsisModuleExtFlywayImpl.java | 7 -
.../spring/AutowiringSpringBeanJobFactory.java | 1 +
...OrphanedPermissionManager_relocateSelected.java | 2 +-
.../ApplicationPermissionRepositoryAbstract.java | 1 +
.../dom/mixins/ApplicationPermission_allow.java | 2 +-
.../dom/mixins/ApplicationPermission_changing.java | 2 +-
.../dom/mixins/ApplicationPermission_feature.java | 2 +-
.../dom/mixins/ApplicationPermission_veto.java | 2 +-
.../dom/mixins/ApplicationPermission_viewing.java | 2 +-
.../secman/api/role/dom/ApplicationRole.java | 1 -
.../dom/mixins/ApplicationRole_addPermission.java | 2 +-
.../role/dom/mixins/ApplicationRole_addUser.java | 2 +-
.../role/dom/mixins/ApplicationRole_delete.java | 2 +-
.../mixins/ApplicationRole_removePermissions.java | 2 +-
.../dom/mixins/ApplicationRole_removeUsers.java | 2 +-
.../mixins/ApplicationRole_updateDescription.java | 3 -
.../dom/mixins/ApplicationRole_updateName.java | 2 -
.../dom/mixins/ApplicationTenancy_addChild.java | 2 +-
.../dom/mixins/ApplicationTenancy_addUser.java | 2 +-
.../dom/mixins/ApplicationTenancy_delete.java | 2 +-
.../dom/mixins/ApplicationTenancy_removeChild.java | 2 +-
.../dom/mixins/ApplicationTenancy_removeUser.java | 2 +-
.../dom/mixins/ApplicationTenancy_updateName.java | 2 -
.../ApplicationUserManager_newDelegateUser.java | 4 +-
.../ApplicationUserManager_newLocalUser.java | 4 +-
...pplicationUserManager_newLocalUserAbstract.java | 15 --
.../secman/api/user/dom/ApplicationUser.java | 2 +
.../api/user/dom/ApplicationUserRepository.java | 1 -
.../user/dom/mixins/ApplicationUser_delete.java | 2 +-
.../user/dom/mixins/ApplicationUser_duplicate.java | 2 +-
.../api/user/dom/mixins/ApplicationUser_lock.java | 2 +-
.../dom/mixins/ApplicationUser_removeRoles.java | 2 +-
.../dom/mixins/ApplicationUser_resetPassword.java | 3 +-
.../user/dom/mixins/ApplicationUser_unlock.java | 2 +-
.../mixins/ApplicationUser_updateAccountType.java | 2 +-
.../dom/mixins/ApplicationUser_updateAtPath.java | 3 -
.../mixins/ApplicationUser_updateEmailAddress.java | 2 -
.../mixins/ApplicationUser_updateFaxNumber.java | 2 -
.../dom/mixins/ApplicationUser_updateName.java | 3 -
.../dom/mixins/ApplicationUser_updatePassword.java | 3 +-
.../mixins/ApplicationUser_updatePhoneNumber.java | 2 -
.../dom/mixins/ApplicationUser_updateUsername.java | 1 -
.../perms/ApplicationUser_filterPermissions.java | 3 +-
.../dom/mixins/perms/UserPermissionViewModel.java | 2 +-
.../extensions/secman/api/util/RegexReplacer.java | 6 -
...xtFixturesFixtureResultsRoleAndPermissions.java | 4 +-
.../jdo/permission/dom/ApplicationPermission.java | 3 +
.../secman/jdo/role/dom/ApplicationRole.java | 1 +
.../secman/jdo/user/dom/ApplicationUser.java | 4 +-
.../jdo/user/dom/ApplicationUserRepository.java | 2 -
.../extensions/secman/jdo/util/RegexReplacer.java | 4 -
.../jpa/permission/dom/ApplicationPermission.java | 3 +
.../dom/ApplicationPermissionRepository.java | 3 +-
.../secman/jpa/role/dom/ApplicationRole.java | 1 +
.../secman/jpa/user/dom/ApplicationUser.java | 1 +
.../jpa/user/dom/ApplicationUserRepository.java | 3 -
.../extensions/secman/jpa/util/RegexReplacer.java | 2 -
.../secman/shiro/AuthInfoForApplicationUser.java | 16 +-
...ticationStrategyForIsisModuleSecurityRealm.java | 14 +-
.../shiro/IsisModuleExtSecmanShiroRealm.java | 1 -
...lCollectionForApplicationUserOnSingleRealm.java | 6 +-
...inglePrincipalForApplicationUserInAnyRealm.java | 2 +-
.../ui/components/CollectionContentsAsExcel.java | 2 +-
.../ui/components/ExcelFileModel.java | 54 ++---
.../ui/component/CalendaredCollectionAbstract.java | 14 +-
.../CalendaredCollectionFactoryAbstract.java | 4 +-
.../ui/component/EventProviderAbstract.java | 10 +-
.../component/FullCalendarWithEventHandling.java | 12 +-
.../CalendarableCollectionAsFullCalendar.java | 2 +-
...alendarableCollectionAsFullCalendarFactory.java | 3 +-
.../CalendarEventableCollectionAsFullCalendar.java | 2 +-
...arEventableCollectionAsFullCalendarFactory.java | 3 +-
.../metamodel/facet/PdfJsViewerFacetAbstract.java | 5 +-
.../facet/PdfJsViewerFacetFromAnnotation.java | 7 +-
.../PdfJsViewerFacetFromAnnotationFactory.java | 1 -
.../pdfjs/ui/components/PdfJsViewerPanel.java | 12 +-
.../PdfJsViewerPanelComponentFactory.java | 2 +
.../pdfjs/WicketStuffPdfJsReference.java | 4 +-
.../model/action/ActionUiModelFactoryFx.java | 2 +-
.../javafx/model/action/ActionUiModelFx.java | 12 +-
.../viewer/javafx/model/binding/BindingsFx.java | 68 +++----
.../viewer/javafx/model/context/UiContextFx.java | 20 +-
.../events/IsisModuleIncViewerJavaFxModel.java | 6 +-
.../javafx/model/events/JavaFxViewerConfig.java | 6 +-
.../model/events/PrimaryStageReadyEvent.java | 2 +-
.../viewer/javafx/model/icon/IconService.java | 2 +-
.../incubator/viewer/javafx/model/util/_fx.java | 30 +--
.../javafx/ui/IsisModuleIncViewerJavaFxUi.java | 18 +-
.../javafx/ui/components/UiComponentFactoryFx.java | 34 ++--
.../javafx/ui/components/UiComponentHandlerFx.java | 8 +-
.../ui/components/collections/TableViewFx.java | 48 ++---
.../javafx/ui/components/dialog/Dialogs.java | 30 +--
.../viewer/javafx/ui/components/form/FormPane.java | 22 +-
.../ui/components/form/field/CustomFieldFx.java | 18 +-
.../ui/components/markup/MarkupFieldFactory.java | 28 +--
.../ui/components/number/NumberFieldFactory.java | 12 +-
.../javafx/ui/components/object/ObjectViewFx.java | 82 ++++----
.../ui/components/other/FallbackFieldFactory.java | 4 +-
.../javafx/ui/components/panel/TitledPanel.java | 8 +-
.../components/temporal/TemporalFieldFactory.java | 6 +-
.../ui/components/text/TextFieldFactory.java | 8 +-
.../disabling/DisablingDecoratorForFormField.java | 12 +-
.../decorator/icon/IconDecoratorForMenuItem.java | 4 +-
.../ui/decorator/icon/IconServiceDefault.java | 12 +-
.../prototyping/PrototypingDecoratorForButton.java | 8 +-
.../PrototypingDecoratorForFormField.java | 8 +-
.../prototyping/PrototypingInfoPopupProvider.java | 24 +--
.../viewer/javafx/ui/main/MainViewFx.java | 38 ++--
.../viewer/javafx/ui/main/MenuBuilderFx.java | 14 +-
.../viewer/javafx/ui/main/UiActionHandlerFx.java | 40 ++--
.../viewer/javafx/ui/main/UiContextFxDefault.java | 22 +-
.../viewer/IsisModuleIncViewerJavaFxViewer.java | 6 +-
.../viewer/javafx/viewer/JavafxViewer.java | 2 +-
.../javafx/viewer/JavafxViewerApplication.java | 22 +-
.../model/action/ActionUiModelFactoryVaa.java | 2 +-
.../vaadin/model/action/ActionUiModelVaa.java | 10 +-
.../viewer/vaadin/model/context/UiContextVaa.java | 20 +-
.../incubator/viewer/vaadin/model/util/_vaa.java | 12 +-
.../vaadin/ui/IsisModuleIncViewerVaadinUi.java | 6 +-
.../vaadin/ui/auth/AuthSessionStoreUtil.java | 14 +-
.../viewer/vaadin/ui/auth/LogoutHandlerVaa.java | 12 +-
.../ui/auth/VaadinAuthenticationHandler.java | 34 ++--
.../viewer/vaadin/ui/binding/BindingsVaa.java | 120 +++++------
.../ui/components/UiComponentFactoryVaa.java | 26 +--
.../ui/components/UiComponentHandlerVaa.java | 2 +-
.../vaadin/ui/components/action/ActionDialog.java | 74 +++----
.../vaadin/ui/components/action/ActionForm.java | 20 +-
.../vaadin/ui/components/blob/BlobField.java | 8 +-
.../ui/components/blob/BlobFieldFactory.java | 2 +-
.../vaadin/ui/components/clob/ClobField.java | 8 +-
.../ui/components/clob/ClobFieldFactory.java | 2 +-
.../vaadin/ui/components/debug/DebugField.java | 14 +-
.../vaadin/ui/components/markup/MarkupField.java | 8 +-
.../ui/components/markup/MarkupFieldFactory.java | 2 +-
.../vaadin/ui/components/object/ObjectViewVaa.java | 52 ++---
.../ui/components/other/FallbackFieldFactory.java | 22 +-
.../vaadin/ui/components/temporal/DateField.java | 16 +-
.../components/temporal/TemporalFieldFactory.java | 32 +--
.../ui/components/text/TextFieldFactory.java | 10 +-
.../ui/components/text/uuid/UuidFieldFactory.java | 14 +-
.../vaadin/ui/pages/login/VaadinLoginView.java | 36 ++--
.../viewer/vaadin/ui/pages/main/MainViewVaa.java | 34 ++--
.../ui/pages/main/MainView_createHeader.java | 10 +-
.../vaadin/ui/pages/main/MenuBuilderVaa.java | 8 +-
.../viewer/vaadin/ui/pages/main/TabUtil.java | 12 +-
.../vaadin/ui/pages/main/UiActionHandlerVaa.java | 20 +-
.../vaadin/ui/pages/main/UiContextVaaDefault.java | 20 +-
.../viewer/vaadin/ui/util/LocalResourceUtil.java | 12 +-
.../viewer/IsisModuleIncViewerVaadinViewer.java | 18 +-
.../viewer/vaadin/viewer/IsisServletForVaadin.java | 32 +--
.../applib/IsisModuleExtJaxRsClientApplib.java | 1 -
.../impl/client/JaxRsClientDefault.java | 4 +-
.../jdo/datanucleus/IsisModuleJdoDatanucleus.java | 32 +--
.../config/DnEntityDiscoveryListener.java | 12 +-
.../jdo/datanucleus/config/DnSettings.java | 30 +--
.../jdo/datanucleus/dialect/DnJdoDialect.java | 16 +-
.../entities/DnEntityStateProvider.java | 14 +-
.../metamodel/facets/entity/JdoEntityFacet.java | 2 +-
.../mixins/Persistable_datanucleusVersionLong.java | 2 +-
.../Persistable_datanucleusVersionTimestamp.java | 2 +-
.../jdo/datanucleus/oid/JdoObjectIdSerializer.java | 68 +++----
.../jdo/datanucleus/oid/_JdoObjectIdDecoder.java | 10 +-
.../jdo/datanucleus/oid/_JdoObjectIdEncoder.java | 8 +-
.../integration/metamodel/JdoPropertyUtils.java | 4 +-
.../jdo/metamodel/IsisModuleJdoMetamodel.java | 4 +-
.../jdo/metamodel/JdoProgrammingModel.java | 6 +-
.../jdo/metamodel/beans/JdoBeanTypeClassifier.java | 28 +--
...JdoDatastoreIdentityAnnotationFacetFactory.java | 2 +-
.../JdoDiscriminatorAnnotationFacetFactory.java | 6 +-
...nferredFromJdoDiscriminatorValueAnnotation.java | 2 +-
...cIdFacetForJdoPersistenceCapableAnnotation.java | 2 +-
...doPersistenceCapableAnnotationFacetFactory.java | 18 +-
.../JdoPersistenceCapableFacetAnnotation.java | 10 +-
.../query/JdoQueryAnnotationFacetFactory.java | 16 +-
.../facets/object/query/JdoQueryFacetAbstract.java | 12 +-
.../object/query/JdoQueryFacetAnnotation.java | 2 +-
...etaModelVisitingValidatorForClauseAbstract.java | 18 +-
.../MetaModelVisitingValidatorForFromClause.java | 16 +-
...taModelVisitingValidatorForVariablesClause.java | 10 +-
.../version/JdoVersionAnnotationFacetFactory.java | 6 +-
...DerivedFromJdoColumnAnnotationFacetFactory.java | 6 +-
...ndatoryFromJdoColumnAnnotationFacetFactory.java | 12 +-
...DerivedFromJdoColumnAnnotationFacetFactory.java | 10 +-
.../JdoNotPersistentAnnotationFacetFactory.java | 4 +-
.../JdoNotPersistentFacetAbstract.java | 4 +-
.../JdoPrimaryKeyAnnotationFacetFactory.java | 8 +-
.../primarykey/JdoPrimaryKeyFacetAbstract.java | 4 +-
.../config/JdoEntityDiscoveryListener.java | 2 +-
.../jdo/provider/entities/JdoFacetContext.java | 4 +-
.../facets/object/query/JdoNamedQuery.java | 6 +-
.../persistence/HasPersistenceManager.java | 16 +-
.../jdo/spring/IsisModuleJdoSpring.java | 2 +-
.../exceptions/JdoResourceFailureException.java | 2 +-
...sactionAwarePersistenceManagerFactoryProxy.java | 4 +-
.../jpa/applib/services/JpaSupportService.java | 20 +-
.../jpa/eclipselink/IsisModuleJpaEclipselink.java | 58 +++---
.../jpa/eclipselink/config/ElSettings.java | 24 +--
.../inject/BeanManagerForEntityListeners.java | 20 +-
.../persistence/jpa/eclipselink/inject/_Util.java | 18 +-
.../jpa/integration/IsisModuleJpaIntegration.java | 6 +-
.../metamodel/JpaEntityFacetFactory.java | 166 +++++++--------
.../integration/metamodel/JpaProgrammingModel.java | 6 +-
.../services/JpaSupportServiceUsingSpring.java | 5 +-
.../jpa/metamodel/IsisModuleJpaMetamodel.java | 4 +-
...ndatoryFromJpaColumnAnnotationFacetFactory.java | 14 +-
.../transients/JpaTransientAnnotationFacet.java | 2 +-
.../JpaTransientAnnotationFacetFactory.java | 2 +-
.../ObjectSpecIdFacetForTableAnnotation.java | 2 +-
.../table/JpaTableAnnotationFacetFactory.java | 2 +-
.../object/table/JpaTableFacetAnnotation.java | 4 +-
.../object/table/JpaTableFacetAnnotationImpl.java | 10 +-
.../applayer/ApplicationLayerTestFactory.java | 226 ++++++++++-----------
.../publishing/CommandSubscriberForTesting.java | 4 +-
.../EntityChangesSubscriberForTesting.java | 4 +-
.../EntityPropertyChangeSubscriberForTesting.java | 24 +--
.../testdomain/conf/Configuration_usingJdo.java | 8 +-
.../testdomain/conf/Configuration_usingJpa.java | 8 +-
.../conf/Configuration_usingSpringDataJpa.java | 8 +-
.../conf/Configuration_usingStereotypes.java | 2 +-
.../org/apache/isis/testdomain/jdo/JdoBookDto.java | 26 +--
.../isis/testdomain/jdo/JdoInventoryDao.java | 10 +-
.../isis/testdomain/jdo/JdoInventoryManager.java | 6 +-
.../isis/testdomain/jdo/JdoInventoryResource.java | 38 ++--
.../isis/testdomain/jdo/JdoTestDomainModule.java | 2 +-
.../isis/testdomain/jdo/JdoTestDomainPersona.java | 1 -
.../isis/testdomain/jdo/entities/JdoBook.java | 28 +--
.../isis/testdomain/jdo/entities/JdoProduct.java | 10 +-
.../org/apache/isis/testdomain/jpa/JpaBookDto.java | 26 +--
.../isis/testdomain/jpa/JpaInventoryDao.java | 10 +-
.../isis/testdomain/jpa/JpaInventoryManager.java | 6 +-
.../isis/testdomain/jpa/JpaTestDomainPersona.java | 1 -
.../isis/testdomain/jpa/entities/JpaBook.java | 28 +--
.../isis/testdomain/jpa/entities/JpaInventory.java | 6 +-
.../isis/testdomain/jpa/entities/JpaProduct.java | 12 +-
.../testdomain/jpa/springdata/EmployeeManager.java | 2 +-
.../springdata/EmployeeManager_newEmployee.java | 8 +-
.../jpa/springdata/SpringDataJpaTestModule.java | 6 +-
.../testdomain/model/actnsemantics/BlobDemo.java | 2 +-
.../model/actnsemantics/BlobDemoMenu.java | 2 +-
.../Configuration_usingActionSemantics.java | 4 +-
.../model/bad/AmbiguousMixinAnnotations.java | 28 +--
.../isis/testdomain/model/bad/AmbiguousTitle.java | 10 +-
.../bad/Configuration_usingInvalidDomain.java | 4 +-
.../model/bad/InvalidActionOverloading.java | 4 +-
.../model/bad/InvalidLogicalTypeNameClash.java | 12 +-
.../model/bad/InvalidOrphanedActionSupport.java | 4 +-
.../bad/InvalidOrphanedCollectionSupport.java | 4 +-
.../model/bad/InvalidOrphanedPropertySupport.java | 4 +-
.../bad/InvalidPropertyAnnotationOnAction.java | 6 +-
...ration_usingInvalidDomain_noActionEnforced.java | 2 +-
...validOrphanedActionSupportNoActionEnforced.java | 2 +-
.../model/good/Configuration_usingValidDomain.java | 4 +-
.../testdomain/model/good/ElementTypeAbstract.java | 6 +-
.../testdomain/model/good/ElementTypeConcrete.java | 2 +-
.../model/good/ElementTypeInterface.java | 6 +-
.../ProperActionWithNameStartingWithSetOrGet.java | 16 +-
.../testdomain/model/good/ProperElementTypeVm.java | 12 +-
.../good/ProperLayoutOnPropertyWithLombok.java | 2 +-
.../good/ProperMemberInheritanceAbstract.java | 24 +--
.../good/ProperMemberInheritanceInterface.java | 18 +-
.../ProperMemberInheritance_usingAbstract.java | 8 +-
.../ProperMemberInheritance_usingInterface.java | 8 +-
.../testdomain/model/good/ProperMemberSupport.java | 32 +--
.../model/good/ProperMemberSupport_action.java | 20 +-
.../model/good/ProperMemberSupport_action2.java | 20 +-
.../model/good/ProperMemberSupport_collection.java | 14 +-
.../good/ProperMemberSupport_collection2.java | 16 +-
.../model/good/ProperMemberSupport_property.java | 18 +-
.../model/good/ProperMemberSupport_property2.java | 18 +-
.../model/good/ProperParameterSupport.java | 42 ++--
.../model/good/ProperPrefixedAction.java | 4 +-
.../model/good/ProperPrefixedMember.java | 14 +-
.../Configuration_usingInteractionDomain.java | 2 +-
.../model/interaction/InteractionDemo.java | 22 +-
.../interaction/InteractionDemo_biArgDisabled.java | 4 +-
.../interaction/InteractionDemo_biArgEnabled.java | 8 +-
.../interaction/InteractionDemo_multiEnum.java | 20 +-
.../interaction/InteractionDemo_multiInt.java | 26 +--
.../interaction/InteractionDemo_negotiate.java | 38 ++--
.../interaction/InteractionDemo_noArgDisabled.java | 8 +-
.../interaction/InteractionDemo_noArgEnabled.java | 4 +-
.../model/interaction/InteractionNpmDemo.java | 4 +-
.../InteractionNpmDemo_biArgDisabled.java | 38 ++--
.../InteractionNpmDemo_biArgEnabled.java | 26 +--
.../testdomain/model/interaction/Parameters.java | 8 +-
.../model/layout/Configuration_usingLayout.java | 2 +-
.../isis/testdomain/model/layout/LayoutDemo.java | 2 +-
.../model/stereotypes/MyObject_mixin.java | 4 +-
.../apache/isis/testdomain/rospec/BigComplex.java | 1 -
.../apache/isis/testdomain/rospec/Customer.java | 2 +-
.../isis/testdomain/util/CollectionAssertions.java | 52 ++---
.../apache/isis/testdomain/util/UtilSurefire.java | 2 +-
.../util/interaction/InteractionBoundaryProbe.java | 30 +--
.../util/interaction/InteractionTestAbstract.java | 76 +++----
.../isis/testdomain/util/kv/KVStoreForTesting.java | 26 +--
.../testdomain/util/rest/RestEndpointService.java | 48 ++---
.../PermissionToRoleMapperFromIni.java | 2 +-
.../spring/webmodule/SpringSecurityFilter.java | 1 -
.../subdomains/base/applib/utils/TitleBuilder.java | 1 +
.../subdomains/base/applib/with/WithInterval.java | 2 +
.../applib/IsisModuleSubdomainsDocxApplib.java | 1 -
.../excel/applib/dom/util/CellMarshaller.java | 128 ++++++------
.../excel/applib/dom/util/ExcelConverter.java | 24 +--
.../contributions/ExcelDemoToDoItem_export.java | 2 +-
.../contributions/ExcelDemoToDoItem_export2.java | 2 +-
.../BulkUpdateLineItemForDemoToDoItem.java | 4 +-
.../BulkUpdateManagerForDemoToDoItem.java | 6 +-
.../bulkupdate/BulkUpdateMenuForDemoToDoItem.java | 2 +-
.../demotodoitem/DemoToDoItemRowHandler2.java | 2 +-
.../DemoToDoItem_create_usingExcelFixture.java | 2 +-
.../todomodule/dom/DependenciesComparator.java | 6 +-
.../demoapp/todomodule/dom/ExcelDemoToDoItem.java | 26 +--
.../todomodule/dom/ExcelDemoToDoItemMenu.java | 24 +--
.../ExcelDemoToDoItem_recreate5_for.java | 12 +-
.../subdomains/excel/testing/ExcelFixture.java | 4 +-
.../subdomains/excel/testing/ExcelFixture2.java | 2 +-
.../isis/extensions/zip/dom/impl/ZipService.java | 6 +-
.../demomodule/dom/FakeDataDemoObjectWithAll.java | 6 +-
...eDataDemoObjectWithAll_update_withFakeData.java | 2 +-
.../IsisIntegrationTestAbstractWithFixtures.java | 2 +-
.../api/FixtureScriptWithExecutionStrategy.java | 2 +-
.../isis/testing/fixtures/applib/clock/Clock.java | 6 +-
.../fixturescripts/BuilderScriptAbstract.java | 16 +-
.../fixturescripts/BuilderScriptWithResult.java | 6 +-
.../fixturescripts/BuilderScriptWithoutResult.java | 4 +-
.../applib/fixturescripts/FixtureResult.java | 2 +-
.../applib/fixturescripts/FixtureResultList.java | 4 +-
.../applib/fixturescripts/FixtureScripts.java | 22 +-
.../applib/modules/ModuleWithFixturesService.java | 2 +-
.../applib/services/FixturesLifecycleService.java | 4 +-
.../applib/ExceptionRecognizerTranslate.java | 6 +-
.../applib/IsisIntegrationTestAbstract.java | 4 +-
.../integtestsupport/applib/ThrowableMatchers.java | 6 +-
.../testing/integtestsupport/applib/_Helper.java | 6 +-
.../applib/validate/DomainModelValidator.java | 2 +-
.../unittestsupport/applib/bean/PojoTester.java | 63 ++++--
.../applib/core/jmocking/MyMockomatic.java | 2 +-
.../applib/core/jmocking/PostponedAction.java | 2 +
.../main/java/org/apache/isis/tooling/c4/C4.java | 14 +-
.../isis/tooling/cli/projdoc/ProjectDocModel.java | 2 -
.../j2adoc/convert/J2AdocConverterDefault.java | 1 +
.../isis/tooling/j2adoc/format/UnitFormatter.java | 2 -
.../j2adoc/format/UnitFormatterAbstract.java | 5 -
.../format/UnitFormatterWithSourceAndCallouts.java | 1 +
.../format/UnitFormatterWithSourceAndSections.java | 3 +-
.../j2adoc/util/AsciiDocIncludeTagFilter.java | 12 +-
.../tooling/javamodel/AnalyzerConfigFactory.java | 26 +--
.../javamodel/ast/AnnotationDeclarations.java | 1 -
.../ast/AnnotationMemberDeclarations.java | 8 +-
.../tooling/javamodel/ast/AnyTypeDeclaration.java | 24 +--
.../javamodel/ast/CallableDeclarations.java | 8 -
.../ast/ClassOrInterfaceDeclarations.java | 24 +--
.../isis/tooling/javamodel/ast/CodeClasses.java | 24 +--
.../tooling/javamodel/ast/CompilationUnits.java | 32 +--
.../javamodel/ast/ConstructorDeclarations.java | 3 -
.../javamodel/ast/EnumConstantDeclarations.java | 4 +-
.../tooling/javamodel/ast/EnumDeclarations.java | 28 +--
.../tooling/javamodel/ast/FieldDeclarations.java | 2 -
.../tooling/javamodel/ast/ImportDeclarations.java | 28 +--
.../isis/tooling/javamodel/ast/MemberInfos.java | 12 +-
.../tooling/javamodel/ast/MethodDeclarations.java | 1 -
.../tooling/javamodel/ast/PackageDeclarations.java | 2 +-
.../tooling/javamodel/ast/TypeDeclarations.java | 18 +-
.../isis/tooling/model4adoc/AsciiDocFactory.java | 68 +++----
.../isis/tooling/model4adoc/BlockVisitor.java | 4 +-
.../apache/isis/tooling/model4adoc/NodeWriter.java | 14 +-
.../model4adoc/StructuralNodeTraversor.java | 22 +-
.../tooling/model4adoc/StructuralNodeVisitor.java | 22 +-
.../model4adoc/ast/ContentNodeAbstract.java | 10 +-
.../isis/tooling/model4adoc/ast/SimpleBlock.java | 8 +-
.../isis/tooling/model4adoc/ast/SimpleCell.java | 4 +-
.../isis/tooling/model4adoc/ast/SimpleColumn.java | 2 +-
.../tooling/model4adoc/ast/SimpleDocument.java | 2 +-
.../isis/tooling/model4adoc/ast/SimpleList.java | 4 +-
.../tooling/model4adoc/ast/SimpleListItem.java | 2 +-
.../model4adoc/ast/SimpleStructuralNode.java | 10 +-
.../isis/tooling/model4adoc/ast/SimpleTable.java | 4 +-
.../model4adoc/include/IncludeStatement.java | 16 +-
.../model4adoc/include/IncludeStatements.java | 70 +++----
.../tooling/projectmodel/ArtifactCoordinates.java | 20 +-
.../projectmodel/ArtifactShortNameFactory.java | 2 +-
.../isis/tooling/projectmodel/Dependency.java | 18 +-
.../isis/tooling/projectmodel/ProjectNode.java | 24 +--
.../projectmodel/ProjectNodeFactory_gradle.java | 12 +-
.../isis/tooling/projectmodel/ProjectVisitor.java | 4 +-
.../projectmodel/gradle/GradleBuildArtifact.java | 6 +-
.../projectmodel/gradle/GradleDependencies.java | 2 +-
.../gradle/GradleDependenciesFactory.java | 18 +-
.../gradle/GradleDependenciesWriter.java | 26 +--
.../projectmodel/gradle/GradleSettings.java | 2 +-
.../projectmodel/gradle/GradleSettingsFactory.java | 20 +-
.../projectmodel/gradle/GradleSettingsWriter.java | 26 +--
.../projectmodel/gradle/WriterAbstract.java | 6 +-
.../projectmodel/maven/MavenModelFactory.java | 28 +--
.../projectmodel/maven/SimpleModelResolver.java | 74 +++----
.../projectmodel/sync/GradleDeficiency.java | 2 +-
.../valuetypes/asciidoc/applib/value/AsciiDoc.java | 1 +
.../asciidoc/applib/value/Converter.java | 10 +-
.../metamodel/facets/AsciiDocValueFacet.java | 2 +-
.../facets/AsciiDocValueSemanticsProvider.java | 6 +-
.../ui/vaa/components/AsciiDocFieldFactoryVaa.java | 12 +-
.../ui/vaa/components/AsciiDocFieldVaa.java | 10 +-
.../asciidoc/ui/vaa/components/PrismResources.java | 10 +-
.../ui/wkt/components/AsciiDocComponentWkt.java | 4 +-
.../wkt/components/AsciiDocPanelFactoriesWkt.java | 6 +-
.../ui/wkt/components/prism/PrismResources.java | 4 +-
.../valuetypes/markdown/applib/value/Markdown.java | 1 +
.../metamodel/facets/MarkdownValueFacet.java | 2 +-
.../facets/MarkdownValueSemanticsProvider.java | 4 +-
.../ui/wkt/components/MarkdownComponent.java | 2 +-
.../MarkdownPanelFactoriesForWicket.java | 8 +-
.../sse/metamodel/facets/SseObserveFacet.java | 2 +-
...eObserveFacetForServerSentEventsAnnotation.java | 4 +-
.../ui/wkt/markup/ListeningMarkupComponent.java | 12 +-
.../markup/ListeningMarkupComponent_observing.java | 2 +-
.../ListeningMarkupPanelFactoriesForWicket.java | 12 +-
.../ui/wkt/webmodule/ServerSentEventsServlet.java | 20 +-
.../common/applib/mixins/Object_impersonate.java | 2 -
.../applib/mixins/Object_impersonateWithRoles.java | 1 -
.../applib/mixins/Object_stopImpersonating.java | 3 -
.../isis/viewer/common/model/HasParentUiModel.java | 2 +-
.../apache/isis/viewer/common/model/HasTitle.java | 2 +-
.../isis/viewer/common/model/HasUiComponent.java | 2 +-
.../isis/viewer/common/model/HasUiMenuItem.java | 2 +-
.../viewer/common/model/UiComponentHolder.java | 6 +-
.../viewer/common/model/action/ActionUiModel.java | 6 +-
.../model/action/decorator/ActionUiDecorator.java | 4 +-
.../model/action/form/FormPendingParamUiModel.java | 10 +-
.../common/model/binding/BindingConverter.java | 20 +-
.../binding/NumberConverterForStringComponent.java | 12 +-
.../TemporalConverterForLocalDateComponent.java | 4 +-
.../common/model/branding/BrandingUiModel.java | 8 +-
.../model/branding/BrandingUiModelProvider.java | 10 +-
.../model/components/UiComponentFactory.java | 56 ++---
.../viewer/common/model/debug/DebugUiModel.java | 4 +-
.../model/decorator/confirm/ConfirmDecorator.java | 2 +-
.../model/decorator/confirm/ConfirmUiModel.java | 24 +--
.../model/decorator/danger/DangerDecorator.java | 2 +-
.../decorator/disable/DisablingDecorator.java | 2 +-
.../model/decorator/disable/DisablingUiModel.java | 4 +-
.../model/decorator/icon/FontAwesomeUiModel.java | 8 +-
.../common/model/decorator/icon/IconDecorator.java | 6 +-
.../prototyping/PrototypingDecorator.java | 4 +-
.../decorator/prototyping/PrototypingUiModel.java | 24 +--
.../model/decorator/tooltip/TooltipDecorator.java | 8 +-
.../model/decorator/tooltip/TooltipUiModel.java | 6 +-
.../common/model/feature/ParameterUiModel.java | 22 +-
.../common/model/feature/PropertyUiModel.java | 12 +-
.../viewer/common/model/feature/ScalarUiModel.java | 14 +-
.../common/model/gridlayout/UiGridLayout.java | 66 +++---
.../isis/viewer/common/model/menu/MenuItemDto.java | 12 +-
.../isis/viewer/common/model/menu/MenuUiModel.java | 14 +-
.../common/model/menu/MenuUiModelProvider.java | 14 +-
.../isis/viewer/common/model/menu/MenuVisitor.java | 4 +-
.../viewer/common/model/object/ObjectUiModel.java | 14 +-
.../applib/dtos/ScalarValueDtoV1.java | 6 +-
.../restfulobjects/rendering/RendererFactory.java | 4 +-
.../rendering/ReprRendererAbstract.java | 8 +-
.../viewer/restfulobjects/rendering/Responses.java | 10 +-
.../AbstractObjectMemberReprRenderer.java | 4 +-
.../domainobjects/ActionResultReprRenderer.java | 12 +-
.../rendering/domainobjects/JsonValueEncoder.java | 38 ++--
.../domainobjects/JsonValueEncoder_Converters.java | 10 +-
.../rendering/domainobjects/ListReprRenderer.java | 10 +-
.../domainobjects/ObjectActionReprRenderer.java | 8 +-
.../domainobjects/ObjectAndActionInvocation.java | 30 +--
.../ObjectCollectionReprRenderer.java | 10 +-
.../domainobjects/ObjectPropertyReprRenderer.java | 6 +-
.../domaintypes/TypeListReprRenderer.java | 2 +-
.../service/swagger/internal/TaggerDefault.java | 8 +-
.../internal/ValuePropertyFactoryDefault.java | 4 +-
.../swagger/internal/ValuePropertyPlugin.java | 12 +-
.../rendering/util/JsonWriterUtil.java | 6 +-
..._ensureCompatibleAcceptHeader_ContractTest.java | 24 +--
.../viewer/context/ResourceContext.java | 12 +-
.../restfulobjects/viewer/mappers/FailureUtil.java | 2 +-
.../viewer/mappers/entity/ExceptionDetail.java | 4 +-
.../viewer/mappers/entity/ExceptionPojo.java | 2 +-
.../resources/DomainObjectResourceServerside.java | 6 +-
.../viewer/resources/DomainResourceHelper.java | 74 +++----
.../resources/DomainServiceResourceServerside.java | 12 +-
.../viewer/resources/HomePageReprRenderer.java | 64 +++---
.../resources/HomePageResourceServerside.java | 2 +-
.../resources/InteractionFailureHandler.java | 8 +-
.../viewer/resources/JsonParserHelper.java | 2 +-
.../resources/MenuBarsResourceServerside.java | 6 +-
.../viewer/resources/ObjectActionArgHelper.java | 14 +-
.../resources/ObjectAdapterAccessHelper.java | 16 +-
.../resources/ObjectAdapterUpdateHelper.java | 6 +-
.../viewer/resources/ResourceAbstract.java | 42 ++--
.../viewer/resources/ResourceDescriptor.java | 6 +-
.../viewer/resources/UserResourceServerside.java | 4 +-
.../resources/VersionResourceServerside.java | 2 +-
.../serialization/SerializationStrategy.java | 14 +-
.../IsisRestfulObjectsInteractionFilter.java | 36 ++--
.../auth/AuthenticationStrategyAbstract.java | 1 -
.../wicket/model/common/CommonContextUtils.java | 4 +-
.../wicket/model/common/PageParametersUtils.java | 4 +-
.../wicket/model/hints/IsisSelectorEvent.java | 6 +-
.../links/ActionLinkUiComponentFactoryWkt.java | 2 +-
.../wicket/model/links/LinkAndLabelAbstract.java | 40 ++--
.../wicket/model/mementos/PageParameterNames.java | 2 +-
.../wicket/model/models/ActionPromptProvider.java | 2 +-
.../wicket/model/models/BookmarkTreeNode.java | 16 +-
.../wicket/model/models/BookmarkableModel.java | 2 +-
.../wicket/model/models/BookmarkedPagesModel.java | 2 +-
.../wicket/model/models/FormExecutorContext.java | 4 +-
.../model/models/HintPageParameterSerializer.java | 8 +-
.../wicket/model/models/ManagedObjectModel.java | 40 ++--
.../viewer/wicket/model/models/ModelAbstract.java | 8 +-
.../viewer/wicket/model/models/PendingModel.java | 14 +-
.../RedirectRequestHandlerWithOpenUrlStrategy.java | 8 +-
.../model/models/ScalarModelWithMultiPending.java | 4 +-
.../model/models/ScalarModelWithPending.java | 4 +-
.../wicket/model/models/ServiceActionsModel.java | 6 +-
.../model/models/ToggledMementosProvider.java | 2 +-
.../viewer/wicket/model/util/ComponentHintKey.java | 22 +-
.../isis/viewer/wicket/ui/ComponentFactory.java | 6 +-
.../viewer/wicket/ui/ComponentFactoryAbstract.java | 8 +-
.../ui/actionresponse/ActionResultResponse.java | 24 +--
.../ActionResultResponseHandlingStrategy.java | 34 ++--
.../wicket/ui/app/logout/LogoutHandlerWkt.java | 6 +-
.../ui/app/registry/ComponentFactoryRegistrar.java | 2 +-
.../viewer/wicket/ui/components/LabelBase.java | 8 +-
.../wicket/ui/components/WebComponentBase.java | 12 +-
.../wicket/ui/components/about/AboutPanel.java | 2 +-
.../ui/components/about/JarManifestModel.java | 16 +-
.../ui/components/actioninfo/ActionInfoPanel.java | 2 +-
.../ui/components/actionlink/ActionLinkPanel.java | 2 +-
.../components/actionmenu/CssClassFaBehavior.java | 2 +-
.../actionmenu/serviceactions/CssMenuItem.java | 40 ++--
.../serviceactions/CssMenuItemPanelAbstract.java | 2 +-
.../serviceactions/CssSubMenuItemsPanel.java | 2 +-
.../actionmenu/serviceactions/MenuActionPanel.java | 8 +-
.../serviceactions/ServiceActionsPanel.java | 16 +-
.../serviceactions/ServiceActionsPanelFactory.java | 4 +-
.../serviceactions/TertiaryActionsPanel.java | 4 +-
.../serviceactions/TertiaryMenuPanelFactory.java | 6 +-
.../actionprompt/ActionPromptHeaderPanel.java | 2 +-
.../actions/ActionFormExecutorStrategy.java | 4 +-
.../components/actions/ActionParametersForm.java | 38 ++--
.../actions/ActionParametersFormPanel.java | 2 +-
.../components/actions/ActionParametersPanel.java | 4 +-
.../bookmarkedpages/BookmarkedPagesPanel.java | 6 +-
.../CollectionContentsSortableDataProvider.java | 8 +-
.../ajaxtable/IsisAjaxFallbackDataTable.java | 4 +-
.../ajaxtable/IsisAjaxNavigationToolbar.java | 6 +-
.../ajaxtable/IsisAjaxPagingNavigationLink.java | 6 +-
.../ajaxtable/IsisTotalRecordsToolbar.java | 8 +-
.../ajaxtable/PrototypingMessageProvider.java | 12 +-
.../ajaxtable/columns/ColumnAbstract.java | 10 +-
.../columns/ObjectAdapterToggleboxColumn.java | 16 +-
.../icons/CollectionContentsAsIconsPanel.java | 4 +-
.../unresolved/CollectionContentsHiddenPanel.java | 2 +-
.../ui/components/empty/EmptyCollectionPanel.java | 2 +-
.../entity/EntityComponentFactoryAbstract.java | 8 +-
.../icontitle/EntityIconAndTitlePanelFactory.java | 46 ++---
.../wicket/ui/components/footer/FooterPanel.java | 34 ++--
.../ui/components/layout/bs3/BS3GridPanel.java | 2 +-
.../components/layout/bs3/clearfix/ClearFix.java | 2 +-
...RepeatingViewWithDynamicallyVisibleContent.java | 4 +-
.../wicket/ui/components/layout/bs3/row/Row.java | 4 +-
.../components/layout/bs3/tabs/TabGroupPanel.java | 6 +-
.../ui/components/layout/bs3/tabs/TabPanel.java | 2 +-
.../ui/components/property/PropertyEditPanel.java | 8 +-
.../PropertyEditPromptHeaderPanel.java | 4 +-
.../scalars/ComponentFactoryScalarAbstract.java | 2 +-
.../ui/components/scalars/DateConverterPlugin.java | 6 +-
.../scalars/ScalarPanelSelectAbstract.java | 6 +-
.../scalars/ScalarPanelTextFieldAbstract.java | 28 +--
.../ScalarPanelTextFieldDatePickerAbstract.java | 2 +-
.../ui/components/scalars/TextFieldValueModel.java | 4 +-
.../blobclob/IsisBlobOrClobPanelAbstract.java | 18 +-
.../scalars/blobclob/ResourceLinkVolatile.java | 8 +-
.../scalars/datepicker/DateTimeConfig.java | 18 +-
.../datepicker/TextFieldWithDateTimePicker.java | 18 +-
.../scalars/image/JavaAwtImagePanel.java | 10 +-
.../components/scalars/image/WicketImageUtil.java | 26 +--
.../jdkdates/DateConverterForJavaAbstract.java | 6 +-
.../jodatime/ConverterForJodaLocalTime.java | 8 +-
.../scalars/jodatime/JodaLocalTimePanel.java | 10 +-
.../jodatime/JodaLocalTimePanelFactory.java | 6 +-
.../scalars/markup/MarkupComponent_reloadJs.java | 2 +-
.../scalars/markup/MarkupPanelFactories.java | 12 +-
.../scalars/markup/ParentedMarkupPanel.java | 8 +-
.../scalars/markup/StandaloneMarkupPanel.java | 6 +-
.../components/scalars/primitive/BooleanPanel.java | 2 +-
.../scalars/reference/EntityLinkSelect2Panel.java | 4 +-
.../valuechoices/ValueChoicesSelect2Panel.java | 6 +-
.../components/tree/IsisToWicketTreeAdapter.java | 30 +--
.../ui/components/tree/StandaloneTreePanel.java | 4 +-
.../wicket/ui/components/tree/TreePanel.java | 8 +-
.../components/tree/themes/TreeThemeProvider.java | 6 +-
.../themes/bootstrap/IsisBootstrapTreeTheme.java | 2 +-
.../ui/components/unknown/UnknownModelPanel.java | 6 +-
.../ui/components/voidreturn/VoidReturnPanel.java | 2 +-
.../wicket/ui/components/welcome/WelcomePanel.java | 2 +-
.../ui/components/welcome/WelcomePanelFactory.java | 8 +-
.../ui/components/widgets/bootstrap/FormGroup.java | 2 +-
.../components/widgets/bootstrap/ModalDialog.java | 2 +-
.../widgets/breadcrumbs/BreadcrumbModel.java | 4 +-
.../widgets/buttons/ContainedButtonPanel.java | 2 +-
.../widgets/buttons/ToggleButtonsPanel.java | 2 +-
.../widgets/checkbox/ContainedToggleboxPanel.java | 10 +-
.../entitysimplelink/EntityLinkSimplePanel.java | 4 +-
.../widgets/linkandlabel/ActionLink.java | 6 +-
.../ui/components/widgets/navbar/AvatarImage.java | 4 -
.../ui/components/widgets/navbar/BrandName.java | 2 +-
.../ui/components/widgets/select2/ChoiceExt.java | 4 +-
.../select2/Select2BootstrapCssReference.java | 2 -
.../widgets/select2/Select2ChoiceExt.java | 6 +-
.../widgets/select2/Select2JsReference.java | 4 +-
.../widgets/select2/Select2MultiChoiceExt.java | 22 +-
...tAdapterMementoProviderForReferenceChoices.java | 6 +-
...entoProviderForReferenceObjectAutoComplete.java | 2 +-
...derForReferenceParamOrPropertyAutoComplete.java | 26 +--
...bjectAdapterMementoProviderForValueChoices.java | 8 +-
.../themepicker/IsisWicketThemeSupportDefault.java | 20 +-
.../widgets/themepicker/ThemeChooser.java | 4 +-
.../themepicker/ThemeProviderComposite.java | 30 +--
.../zclip/SimpleClipboardModalWindowPanel.java | 2 +-
.../viewer/wicket/ui/errors/JGrowlBehaviour.java | 10 +-
.../isis/viewer/wicket/ui/errors/JGrowlUtil.java | 18 +-
.../isis/viewer/wicket/ui/pages/PageAbstract.java | 26 +--
.../isis/viewer/wicket/ui/pages/WebPageBase.java | 29 +--
.../accmngt/AccountManagementPageAbstract.java | 8 +-
.../ui/pages/accmngt/EmailAvailableValidator.java | 14 +-
.../pages/accmngt/UsernameAvailableValidator.java | 10 +-
.../password_reset/PasswordResetEmailPanel.java | 4 +-
.../accmngt/password_reset/PasswordResetPanel.java | 4 +-
.../ui/pages/accmngt/register/RegisterPanel.java | 18 +-
.../accmngt/signup/RegistrationFormPanel.java | 3 +-
.../ui/pages/actionprompt/ActionPromptPage.java | 8 +-
.../viewer/wicket/ui/pages/error/ErrorPage.java | 2 +-
.../wicket/ui/pages/login/IsisSignInPanel.java | 4 +-
.../wicket/ui/pages/mmverror/MmvErrorPage.java | 2 +-
.../isis/viewer/wicket/ui/panels/FormAbstract.java | 8 +-
.../wicket/ui/panels/FormExecutorDefault.java | 12 +-
.../viewer/wicket/ui/panels/PanelAbstract.java | 8 +-
.../isis/viewer/wicket/ui/panels/PanelBase.java | 40 ++--
.../wicket/ui/panels/PromptFormAbstract.java | 10 +-
.../wicket/ui/panels/PromptFormPanelAbstract.java | 2 +-
.../isis/viewer/wicket/ui/util/Components.java | 12 +-
.../isis/viewer/wicket/ui/util/Decorators.java | 88 ++++----
.../wicket/ui/util/ExtendedPopoverConfig.java | 12 +-
.../wicket/ui/util/FontAwesomeCssReferenceWkt.java | 2 +-
.../isis/viewer/wicket/ui/util/SSESupport.java | 10 +-
.../isis/viewer/wicket/ui/util/Tooltips.java | 24 +--
.../viewer/wicket/ui/validation/ValidatorBase.java | 6 +-
.../AuthenticatedWebSessionForIsis.java | 2 +-
.../integration/ConverterForObjectAdapter.java | 10 +-
.../ConverterForObjectAdapterMemento.java | 2 +-
.../viewer/integration/LocalizerForIsis.java | 6 +-
.../viewer/integration/WebRequestCycleForIsis.java | 60 +++---
.../ComponentFactoryRegistrarDefault.java | 8 +-
.../ComponentFactoryRegistryDefault.java | 12 +-
.../registries/pages/PageClassRegistryDefault.java | 2 +-
.../services/ImageResourceCacheClassPath.java | 2 +-
.../services/TranslationsResolverWicket.java | 14 +-
.../services/WicketViewerSettingsDefault.java | 2 +-
.../mementos/ObjectMementoServiceWicket.java | 24 +--
.../viewer/services/mementos/ObjectMementoWkt.java | 10 +-
.../viewer/wicketapp/IsisWicketApplication.java | 47 ++---
.../IsisWicketApplication_experimental.java | 20 +-
.../IsisWicketApplication_newPageFactory.java | 34 ++--
.../IsisWicketApplication_newSession.java | 8 +-
...rgetRespondListenerToResetQueryResultCache.java | 4 +-
1372 files changed, 9480 insertions(+), 9533 deletions(-)
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
index 690794c..46caa0e 100644
--- a/commons/src/main/java/org/apache/isis/commons/binding/Observable.java
+++ b/commons/src/main/java/org/apache/isis/commons/binding/Observable.java
@@ -24,11 +24,11 @@ package org.apache.isis.commons.binding;
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/collections/Can.java b/commons/src/main/java/org/apache/isis/commons/collections/Can.java
index 30d27b4..c37e75d 100644
--- a/commons/src/main/java/org/apache/isis/commons/collections/Can.java
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Can.java
@@ -50,23 +50,23 @@ import lombok.NonNull;
import lombok.val;
/**
- *
- * Immutable {@link Iterable}, that can specifically represent 3 possible variants of
- * {@link Cardinality}.
+ *
+ * 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
+ * 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}
+ * <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 {@index}
*/
-public interface Can<T>
+public interface Can<T>
extends Iterable<T>, Comparable<Can<T>>, Serializable {
/**
@@ -75,18 +75,18 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
Cardinality getCardinality();
/**
- * @return number of elements this Can contains
+ * @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
+ * @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>
@@ -94,16 +94,16 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* @param elementIndex
* @return this Can's element with index {@code elementIndex}
* @throws NoSuchElementException when the elementIndex is out of bounds
- * @see {@link #get(int)}
+ * @see {@link #get(int)}
*/
default T getElseFail(final int elementIndex) {
return get(elementIndex)
.orElseThrow(()->new NoSuchElementException(
"no element with elementIndex = " + elementIndex));
}
-
+
/**
- * For convenience allows the argument to be {@code null} treating {@code null}
+ * For convenience allows the argument to be {@code null} treating {@code null}
* equivalent to {@link Can#empty()}.
* @see {@link Comparable#compareTo(Object)}
*/
@@ -114,7 +114,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* @return Stream of elements this Can contains
*/
Stream<T> stream();
-
+
/**
* @return possibly concurrent Stream of elements this Can contains
*/
@@ -132,7 +132,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
default T getFirstOrFail() {
return getFirst().orElseThrow(_Exceptions::noSuchElement);
}
-
+
/**
* @return this Can's last element or an empty Optional if no such element
*/
@@ -147,10 +147,10 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
}
/**
- * @return this Can's single element or an empty Optional if this Can has any cardinality other than ONE
+ * @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
@@ -158,10 +158,10 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
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.
+ * @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);
@@ -214,9 +214,9 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
public static <T> Can<T> of(T ... array) {
return ofArray(array);
}
-
+
/**
- * Returns either a {@code Can} with all the elements from given {@code array}
+ * Returns either a {@code Can} with all the elements from given {@code array}
* or an empty {@code Can} if the {@code array} is {@code null}. Any elements
* equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
* @param <T>
@@ -232,7 +232,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// 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)));
@@ -254,7 +254,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
}
/**
- * Returns either a {@code Can} with all the elements from given {@code collection}
+ * 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>
@@ -269,7 +269,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// 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 maxSize = Math.min(collection.size(), 1024);
val nonNullElements = collection.stream()
.filter(_NullSafe::isPresent)
@@ -289,9 +289,9 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
return Can_Multiple.of(nonNullElements);
}
-
+
/**
- * Returns either a {@code Can} with all the elements from given {@code iterable}
+ * Returns either a {@code Can} with all the elements from given {@code iterable}
* or an empty {@code Can} if the {@code iterable} is {@code null}. Any elements
* equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
* @param <T>
@@ -299,19 +299,19 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* @return non-null
*/
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 enumeration}
+ * Returns either a {@code Can} with all the elements from given {@code enumeration}
* or an empty {@code Can} if the {@code enumeration} is {@code null}. Any elements
* equal to {@code null} are ignored and will not be contained in the resulting {@code Can}.
* <p>
@@ -321,11 +321,11 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* @return non-null
*/
public static <T> Can<T> ofEnumeration(@Nullable Enumeration<T> enumeration) {
-
+
if(enumeration==null) {
return empty();
}
-
+
val elements = new ArrayList<T>();
while(enumeration.hasMoreElements()) {
elements.add(enumeration.nextElement());
@@ -334,7 +334,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
}
/**
- * Returns either a {@code Can} with all the elements from given {@code stream}
+ * 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}.
* <p>
@@ -351,7 +351,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
val nonNullElements = stream
.filter(_NullSafe::isPresent)
- .collect(Collectors.toCollection(()->new ArrayList<>()));
+ .collect(Collectors.toCollection(()->new ArrayList<>()));
val size = nonNullElements.size();
@@ -367,7 +367,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
}
/**
- * Returns either a {@code Can} with all the elements from given {@code instance}
+ * 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>
@@ -378,7 +378,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
if(instance==null || instance.isUnsatisfied()) {
return empty();
}
- if(instance.isResolvable()) {
+ if(instance.isResolvable()) {
return Can_Singleton.of(instance.get());
}
val nonNullElements = instance.stream()
@@ -391,7 +391,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// -- OPERATORS
/**
- * Returns a {@code Can} with all the elements from this {@code Can} but
+ * Returns a {@code Can} with all the elements from this {@code Can} but
* contained in reversed order.
* @return non-null
*/
@@ -410,9 +410,9 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* 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
+ * @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) {
@@ -423,7 +423,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
requires(mapper, "mapper");
- val mappedElements =
+ val mappedElements =
stream()
.map(mapper)
.filter(_NullSafe::isPresent)
@@ -435,7 +435,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// -- CONCATENATION
/**
- * Returns a {@code Can} with all the elements from given {@code can} joined by
+ * 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>
@@ -460,21 +460,22 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// -- TRAVERSAL
Iterator<T> reverseIterator();
-
+
+ @Override
void forEach(@NonNull Consumer<? super T> action);
-
+
/**
- * Similar to {@link #forEach(Consumer)}, but zipps in {@code zippedIn} to iterate through
+ * 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 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
+ * 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>
@@ -483,13 +484,13 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* @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);
-
+
/**
- * Adds the specified element to the list if it is not already present.
+ * Adds the specified element to the list if it is not already present.
* @param element
* @return same or new instance
*/
@@ -499,9 +500,9 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
}
return add(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
@@ -520,7 +521,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* (<tt>index < 0 || index > size()</tt>)
*/
Can<T> add(int index, T element);
-
+
Can<T> replace(int index, T element);
/**
@@ -535,11 +536,11 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* (<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.
@@ -558,9 +559,9 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
* (<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}
@@ -572,24 +573,24 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
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;
}
-
+
// -- PARTIAL EQUALITY
/**
- * Let {@literal n} be the number of elements in {@code other}.
- * Returns whether the first {@literal n} elements of this {@code Can} are
+ * Let {@literal n} be the number of elements in {@code other}.
+ * Returns whether the first {@literal n} elements of this {@code Can} are
* element-wise equal to {@code other}.
* @param other
*/
@@ -601,24 +602,24 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
if(this.size()<other.size()) {
return false;
}
-
+
val thisIterator = this.iterator();
val otherIterator = other.iterator();
-
+
while(otherIterator.hasNext()) {
val otherElement = otherIterator.next();
val thisElement = thisIterator.next();
-
+
if(!thisElement.equals(otherElement)) {
return false;
}
}
- return true;
+ return true;
}
/**
- * Let {@literal n} be the number of elements in {@code other}.
- * Returns whether the last {@literal n} elements of this {@code Can} are
+ * Let {@literal n} be the number of elements in {@code other}.
+ * Returns whether the last {@literal n} elements of this {@code Can} are
* element-wise equal to {@code other}.
* @param other
*/
@@ -630,19 +631,19 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
if(this.size()<other.size()) {
return false;
}
-
+
val thisIterator = this.reverseIterator();
val otherIterator = other.reverseIterator();
-
+
while(otherIterator.hasNext()) {
val otherElement = otherIterator.next();
val thisElement = thisIterator.next();
-
+
if(!thisElement.equals(otherElement)) {
return false;
}
}
- return true;
+ return true;
}
// -- SHORTCUTS FOR PREDICATES
@@ -665,32 +666,32 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
// -- COLLECTORS
- public static <T>
+ public static <T>
Collector<T, ?, Can<T>> toCan() {
-
+
return Collectors.collectingAndThen(
- Collectors.toList(),
+ Collectors.toList(),
Can::ofCollection);
}
// -- CONVERSIONS
-
+
/**
* @return a serializable and immutable List, containing the elements of this Can
*/
List<T> toList();
-
+
/**
* @return a serializable and immutable Set, containing the elements of this Can
*/
Set<T> toSet();
-
+
/**
* @return a serializable and immutable Set, containing the elements of this Can
*/
Set<T> toSet(@NonNull Consumer<T> onDuplicated);
-//XXX to implement when needed
+//XXX to implement when needed
// Set<T> toSortedSet();
// Set<T> toSortedSet(Comparator<T> comparator);
@@ -710,7 +711,7 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
default T[] toArray(T[] a) {
return toList().toArray(a);
}
-
+
/**
* @param elementType the {@code Class} object representing the component
* type of the new array
@@ -718,5 +719,5 @@ extends Iterable<T>, Comparable<Can<T>>, Serializable {
*/
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
index 483aaeb..7a530e6 100644
--- a/commons/src/main/java/org/apache/isis/commons/collections/CanVector.java
+++ b/commons/src/main/java/org/apache/isis/commons/collections/CanVector.java
@@ -26,20 +26,20 @@ 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);
@@ -50,7 +50,7 @@ public final class CanVector<T> implements Iterable<Can<T>>, Serializable {
public int size() {
return size;
}
-
+
@Override
public Iterator<Can<T>> iterator() {
return cans.iterator();
@@ -65,11 +65,11 @@ public final class CanVector<T> implements Iterable<Can<T>>, Serializable {
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
@@ -84,7 +84,7 @@ public final class CanVector<T> implements Iterable<Can<T>>, Serializable {
public static <T> CanVector<T> empty() {
return new CanVector<>(0);
}
-
+
@Override
public boolean equals(Object obj) {
if(this == obj) {
@@ -94,11 +94,11 @@ public final class CanVector<T> implements Iterable<Can<T>>, Serializable {
? 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
index 1bf8c6a..331f356 100644
--- 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
@@ -47,8 +47,8 @@ import lombok.val;
final class Can_Empty<T> implements Can<T> {
private static final long serialVersionUID = 1L;
-
- static final Can_Empty<?> INSTANCE = new Can_Empty<>();
+
+ static final Can_Empty<?> INSTANCE = new Can_Empty<>();
@Override
public Cardinality getCardinality() {
@@ -59,7 +59,7 @@ final class Can_Empty<T> implements Can<T> {
public Stream<T> stream() {
return Stream.empty();
}
-
+
@Override
public Stream<T> parallelStream() {
return Stream.empty();
@@ -74,17 +74,17 @@ final class Can_Empty<T> implements Can<T> {
public Optional<T> getFirst() {
return Optional.empty();
}
-
+
@Override
public Optional<T> getLast() {
return Optional.empty();
}
-
+
@Override
public Optional<T> get(int elementIndex) {
return Optional.empty();
}
-
+
@Override
public boolean contains(T element) {
return false;
@@ -99,31 +99,31 @@ final class Can_Empty<T> implements Can<T> {
public Iterator<T> iterator() {
return Collections.<T>emptyList().iterator();
}
-
+
@Override
public Can<T> reverse() {
return this;
}
-
+
@Override
public Iterator<T> reverseIterator() {
return iterator();
}
-
+
@Override
public void forEach(Consumer<? super T> action) {
}
-
+
@Override
public Can<T> filter(@Nullable Predicate<? super T> predicate) {
return this; // identity
}
-
+
@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();
@@ -133,17 +133,17 @@ final class Can_Empty<T> implements Can<T> {
public Can<T> add(@NonNull T element) {
return Can.ofSingleton(element);
}
-
+
@Override
public Can<T> addUnique(@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) {
@@ -152,7 +152,7 @@ final class Can_Empty<T> implements Can<T> {
}
return Can.ofSingleton(element);
}
-
+
@Override
public Can<T> replace(int index, T element) {
throw _Exceptions.unsupportedOperation("cannot replace an element in an empty Can");
@@ -162,22 +162,22 @@ final class Can_Empty<T> implements Can<T> {
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(final @Nullable Object obj) {
if(INSTANCE == obj) {
@@ -187,7 +187,7 @@ final class Can_Empty<T> implements Can<T> {
? ((Can<?>)obj).isEmpty()
: false;
}
-
+
@Override
public int hashCode() {
return 0;
@@ -196,37 +196,37 @@ final class Can_Empty<T> implements Can<T> {
@Override
public int compareTo(final @Nullable Can<T> other) {
if(other==null) {
- return 0;
+ return 0;
}
// when returning
- // -1 ... this is before other
+ // -1 ... this is before other
// +1 ... this is after other
return Integer.compare(0, other.size()); // all empty Cans are same and come first
}
-
+
@Override
public List<T> toList() {
return Collections.emptyList(); // serializable and immutable
}
-
+
@Override
public Set<T> toSet() {
return Collections.emptySet(); // serializable and immutable
}
-
+
@Override
public Set<T> toSet(@NonNull Consumer<T> onDuplicated) {
return Collections.emptySet(); // 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));
+ 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
index bb5f158..965010d 100644
--- 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
@@ -56,12 +56,12 @@ final class Can_Multiple<T> implements Can<T> {
public Optional<T> getFirst() {
return Optional.of(elements.get(0));
}
-
+
@Override
public Optional<T> getLast() {
return Optional.of(elements.get(size()-1));
}
-
+
@Override
public Cardinality getCardinality() {
return Cardinality.MULTIPLE;
@@ -71,7 +71,7 @@ final class Can_Multiple<T> implements Can<T> {
public Stream<T> stream() {
return elements.stream();
}
-
+
@Override
public Stream<T> parallelStream() {
return elements.parallelStream();
@@ -86,7 +86,7 @@ final class Can_Multiple<T> implements Can<T> {
public int size() {
return elements.size();
}
-
+
@Override
public boolean contains(T element) {
if(element==null) {
@@ -94,10 +94,10 @@ final class Can_Multiple<T> implements Can<T> {
}
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,
+ // 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) {
@@ -115,7 +115,7 @@ final class Can_Multiple<T> implements Can<T> {
public Iterator<T> iterator() {
return Collections.unmodifiableList(elements).iterator();
}
-
+
@Override
public Iterator<T> reverseIterator() {
return new Iterator<T>() {
@@ -127,7 +127,7 @@ final class Can_Multiple<T> implements Can<T> {
}
};
}
-
+
@Override
public Can<T> reverse() {
val reverse = new ArrayList<T>(elements.size());
@@ -136,18 +136,18 @@ final class Can_Multiple<T> implements Can<T> {
}
return Can_Multiple.of(reverse);
}
-
+
@Override
public void forEach(final @NonNull Consumer<? super T> action) {
elements.forEach(action);
}
-
+
@Override
public Can<T> filter(final @Nullable Predicate<? super T> predicate) {
if(predicate==null) {
return this; // identity
}
- val filteredElements =
+ val filteredElements =
stream()
.filter(predicate)
.collect(Collectors.toCollection(ArrayList::new));
@@ -159,7 +159,7 @@ final class Can_Multiple<T> implements Can<T> {
return Can.ofCollection(filteredElements);
}
-
+
@Override
public <R> void zip(@NonNull Iterable<R> zippedIn, @NonNull BiConsumer<? super T, ? super R> action) {
val zippedInIterator = zippedIn.iterator();
@@ -167,7 +167,7 @@ final class Can_Multiple<T> implements Can<T> {
action.accept(t, zippedInIterator.next());
});
}
-
+
@Override
public <R, Z> Can<R> zipMap(@NonNull Iterable<Z> zippedIn, @NonNull BiFunction<? super T, ? super Z, R> mapper) {
val zippedInIterator = zippedIn.iterator();
@@ -177,9 +177,9 @@ final class Can_Multiple<T> implements Can<T> {
@Override
public Can<T> add(@NonNull T element) {
val elementStream = Stream.concat(elements.stream(), Stream.of(element)); // append
- return Can.ofStream(elementStream);
+ return Can.ofStream(elementStream);
}
-
+
@Override
public Can<T> addAll(@NonNull Can<T> other) {
if(other.isEmpty()) {
@@ -190,7 +190,7 @@ final class Can_Multiple<T> implements Can<T> {
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);
@@ -204,26 +204,26 @@ final class Can_Multiple<T> implements Can<T> {
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()
@@ -231,24 +231,24 @@ final class Can_Multiple<T> implements Can<T> {
.collect(Collectors.joining(", "));
return "Can["+literal+"]";
}
-
+
@Override
public boolean equals(Object obj) {
if(obj instanceof Can) {
- return ((Can<?>) obj).isEqualTo(this);
+ return ((Can<?>) obj).isEqualTo(this);
}
return false;
}
-
+
@Override
public int hashCode() {
return elements.hashCode();
}
-
+
@Override
public int compareTo(final @Nullable Can<T> other) {
// when returning
- // -1 ... this (multi-can) is before other
+ // -1 ... this (multi-can) is before other
// +1 ... this (multi-can) is after other
if(other==null
|| other.isEmpty()) {
@@ -256,7 +256,7 @@ final class Can_Multiple<T> implements Can<T> {
}
if(other.isCardinalityOne()) {
final int firstElementComparison = _Objects.compareNonNull(
- this.elements.get(0),
+ this.elements.get(0),
other.getSingletonOrFail());
if(firstElementComparison!=0) {
return firstElementComparison;
@@ -291,19 +291,19 @@ final class Can_Multiple<T> implements Can<T> {
}
return 0; // we compared all elements and found no difference
}
-
+
@Override
public List<T> toList() {
return Collections.unmodifiableList(elements); // serializable and immutable
}
-
+
@Override
public Set<T> toSet() {
val set = _Sets.<T>newHashSet(); // serializable
elements.forEach(set::add);
return Collections.unmodifiableSet(set); // serializable and immutable
}
-
+
@Override
public Set<T> toSet(@NonNull Consumer<T> onDuplicated) {
val set = _Sets.<T>newHashSet(); // serializable
@@ -315,14 +315,14 @@ final class Can_Multiple<T> implements Can<T> {
});
return Collections.unmodifiableSet(set); // 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()));
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
index b8be9b8..cf930ee 100644
--- 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
@@ -65,7 +65,7 @@ final class Can_Singleton<T> implements Can<T> {
public Stream<T> stream() {
return Stream.of(element);
}
-
+
@Override
public Stream<T> parallelStream() {
return Stream.of(element);
@@ -75,12 +75,12 @@ final class Can_Singleton<T> implements Can<T> {
public Optional<T> getFirst() {
return getSingleton();
}
-
+
@Override
public Optional<T> getLast() {
return getSingleton();
}
-
+
@Override
public Optional<T> get(int elementIndex) {
return getSingleton();
@@ -90,7 +90,7 @@ final class Can_Singleton<T> implements Can<T> {
public int size() {
return 1;
}
-
+
@Override
public boolean contains(T element) {
return Objects.equals(this.element, element);
@@ -105,17 +105,17 @@ final class Can_Singleton<T> implements Can<T> {
public Can<T> reverse() {
return this;
}
-
+
@Override
public Iterator<T> reverseIterator() {
return iterator();
}
-
+
@Override
public void forEach(@NonNull Consumer<? super T> action) {
action.accept(this.element);
}
-
+
@Override
public Can<T> filter(@Nullable Predicate<? super T> predicate) {
if(predicate==null) {
@@ -125,22 +125,22 @@ final class Can_Singleton<T> implements Can<T> {
? this // identity
: Can.empty();
}
-
+
@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()) {
@@ -154,23 +154,23 @@ final class Can_Singleton<T> implements Can<T> {
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
+ 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);
+ return Can.ofSingleton(element);
}
throw new IndexOutOfBoundsException(
"cannot replace on singleton with index other than 0; got " + index);
@@ -179,34 +179,34 @@ final class Can_Singleton<T> implements Can<T> {
@Override
public Can<T> remove(int index) {
if(index==0) {
- return Can.empty();
+ 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 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 ((Can<?>) obj).isEqualTo(this);
}
return false;
}
@@ -215,49 +215,49 @@ final class Can_Singleton<T> implements Can<T> {
public int hashCode() {
return element.hashCode();
}
-
+
@Override
public int compareTo(final @Nullable Can<T> other) {
// when returning
- // -1 ... this (singleton) is before other
+ // -1 ... this (singleton) is before other
// +1 ... this (singleton) is after other
if(other==null
|| other.isEmpty()) {
return 1; // all empty Cans are same and come first
}
final int firstElementComparison = _Objects.compareNonNull(
- this.element,
+ this.element,
other.getFirstOrFail());
if(firstElementComparison!=0
|| other.isCardinalityOne()) {
return firstElementComparison; // when both Cans are singletons, just compare by their contained values
}
// at this point firstElementComparison is 0 and other is of cardinality MULTIPLE
- return -1; // singletons come before multi-cans
+ return -1; // singletons come before multi-cans
}
-
+
@Override
public List<T> toList() {
return Collections.singletonList(element); // serializable and immutable
}
-
+
@Override
public Set<T> toSet() {
return Collections.singleton(element); // serializable and immutable
}
-
+
@Override
public Set<T> toSet(@NonNull Consumer<T> onDuplicated) {
return Collections.singleton(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));
@@ -266,6 +266,6 @@ final class Can_Singleton<T> implements Can<T> {
}
-
-
+
+
}
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
index 8ea9374..5d617bb 100644
--- a/commons/src/main/java/org/apache/isis/commons/collections/Cardinality.java
+++ b/commons/src/main/java/org/apache/isis/commons/collections/Cardinality.java
@@ -27,12 +27,12 @@ public enum Cardinality {
* The container is empty.
*/
ZERO,
-
+
/**
* The container has exactly one element.
*/
ONE,
-
+
/**
* The container has at least two elements.
*/
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
index 211a2f2..12378e6 100644
--- a/commons/src/main/java/org/apache/isis/commons/collections/ImmutableEnumSet.java
+++ b/commons/src/main/java/org/apache/isis/commons/collections/ImmutableEnumSet.java
@@ -24,14 +24,14 @@ import java.util.stream.Stream;
/**
* Immutable variant of {@link EnumSet}
- *
+ *
* @since 2.0
*/
-public final class ImmutableEnumSet<E extends Enum<E>>
+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) {
@@ -41,7 +41,7 @@ implements Iterable<E>, java.io.Serializable {
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));
}
@@ -49,15 +49,15 @@ implements Iterable<E>, java.io.Serializable {
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));
}
@@ -65,19 +65,19 @@ implements Iterable<E>, java.io.Serializable {
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
index 6d4ce2d..53d9428 100644
--- a/commons/src/main/java/org/apache/isis/commons/concurrent/AwaitableLatch.java
+++ b/commons/src/main/java/org/apache/isis/commons/concurrent/AwaitableLatch.java
@@ -33,7 +33,7 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor(staticName = "of")
public final class AwaitableLatch {
- private final CountDownLatch countDownLatch;
+ private final CountDownLatch countDownLatch;
public static AwaitableLatch unlocked() {
return of(new CountDownLatch(0));
diff --git a/commons/src/main/java/org/apache/isis/commons/functional/Result.java b/commons/src/main/java/org/apache/isis/commons/functional/Result.java
index 6498cca..0197c68 100644
--- a/commons/src/main/java/org/apache/isis/commons/functional/Result.java
+++ b/commons/src/main/java/org/apache/isis/commons/functional/Result.java
@@ -37,10 +37,10 @@ import lombok.ToString;
import lombok.val;
/**
- * The {@link Result} type represents a value of one of two possible types (a disjoint union).
+ * The {@link Result} type represents a value of one of two possible types (a disjoint union).
* The data constructors {@link Result#success(Object)} and {@link Result#failure(Throwable)}
* represent the two possible values.
- *
+ *
* @since 2.0 {@index}
*/
@RequiredArgsConstructor(access=AccessLevel.PRIVATE, staticName="of")
@@ -50,7 +50,7 @@ public final class Result<L> {
private final L value;
private final Throwable throwable;
private final boolean isSuccess;
-
+
// -- FACTORIES
public static <L> Result<L> of(final @NonNull Callable<L> callable) {
@@ -60,72 +60,72 @@ public final class Result<L> {
return failure(e);
}
}
-
+
public static Result<Void> ofVoid(final @NonNull ThrowingRunnable runnable) {
return of(ThrowingRunnable.toCallable(runnable));
}
-
+
public static <L> Result<L> success(final @Nullable L value) {
return of(value, null, true);
}
-
+
public static <L> Result<L> failure(final @NonNull Throwable throwable) {
return of(null, throwable, false);
}
-
+
// -- FACTORY SHORTCUTS
-
+
public static <L> Result<L> failure(final @NonNull String message) {
return failure(new RuntimeException(message));
}
-
+
public static <L> Result<L> failure(final @NonNull String message, final @NonNull Throwable cause) {
return failure(new RuntimeException(message, cause));
}
-
+
// -- PREDICATES
-
+
public boolean isSuccess() {
return isSuccess;
}
-
+
public boolean isFailure() {
return !isSuccess();
}
-
+
// -- ACCESSORS
-
+
public Optional<L> getValue() {
- return Optional.ofNullable(value);
+ return Optional.ofNullable(value);
}
public Optional<Throwable> getFailure() {
- return Optional.ofNullable(throwable);
+ return Optional.ofNullable(throwable);
}
-
+
// -- PEEKING
-
+
public Result<L> ifSuccess(final @NonNull Consumer<L> valueConsumer){
if(isSuccess()) {
valueConsumer.accept(value);
}
return this;
}
-
+
public Result<L> ifSuccessAndValuePresent(final @NonNull Consumer<L> valueConsumer){
getValue().ifPresent(valueConsumer::accept);
return this;
}
-
+
public Result<L> ifFailure(final @NonNull Consumer<Throwable> exceptionConsumer){
if(isFailure()) {
exceptionConsumer.accept(throwable);
}
return this;
}
-
+
// -- MAP NULL TO FAILURE
-
+
public <E extends Throwable> Result<L> mapSuccessWithEmptyValueToFailure(
final @NonNull Supplier<E> onNullValue){
return isSuccess()
@@ -133,11 +133,11 @@ public final class Result<L> {
? Result.failure(onNullValue.get())
: this;
}
-
+
public <E extends Throwable> Result<L> mapSuccessWithEmptyValueToNoSuchElement(){
return mapSuccessWithEmptyValueToFailure(NoSuchElementException::new);
}
-
+
// -- MAPPING
public <T> Result<T> mapSuccess(final @NonNull Function<L, T> successMapper){
@@ -156,9 +156,9 @@ public final class Result<L> {
return failure(e);
}
}
-
+
// -- FOLDING
-
+
public <T> T fold(
final @NonNull Function<L, T> successMapper,
final @NonNull Function<Throwable, T> failureMapper){
@@ -166,9 +166,9 @@ public final class Result<L> {
? successMapper.apply(value)
: failureMapper.apply(throwable);
}
-
+
// -- EXTRACTION
-
+
@SneakyThrows
public L presentElseFail() {
if (isSuccess()) {
@@ -179,7 +179,7 @@ public final class Result<L> {
}
throw throwable;
}
-
+
@SneakyThrows
public Optional<L> optionalElseFail() {
if (isSuccess()) {
@@ -187,7 +187,7 @@ public final class Result<L> {
}
throw throwable;
}
-
+
@SneakyThrows
public L presentElseThrow(final @NonNull UnaryOperator<Throwable> toThrowable) {
if (isSuccess()) {
@@ -198,7 +198,7 @@ public final class Result<L> {
}
throw toThrowable.apply(throwable);
}
-
+
@SneakyThrows
public Optional<L> optionalElseThrow(final @NonNull UnaryOperator<Throwable> toThrowable) {
if (isSuccess()) {
@@ -206,7 +206,7 @@ public final class Result<L> {
}
throw toThrowable.apply(throwable);
}
-
+
public L presentElse(final @NonNull L defaultValue) {
if (isSuccess()) {
if(value!=null) {
@@ -215,7 +215,7 @@ public final class Result<L> {
}
return defaultValue;
}
-
+
public L presentElseGet(final @NonNull Supplier<L> defaultValueSupplier) {
if (isSuccess()) {
if(value!=null) {
@@ -229,5 +229,5 @@ public final class Result<L> {
throw new NoSuchElementException();
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/functional/ThrowingRunnable.java b/commons/src/main/java/org/apache/isis/commons/functional/ThrowingRunnable.java
index d52b6d9..ffe8df7 100644
--- a/commons/src/main/java/org/apache/isis/commons/functional/ThrowingRunnable.java
+++ b/commons/src/main/java/org/apache/isis/commons/functional/ThrowingRunnable.java
@@ -24,19 +24,19 @@ import lombok.NonNull;
@FunctionalInterface
public interface ThrowingRunnable {
-
+
// -- INTERFACE
-
+
void run() throws Exception;
-
+
// -- UTILITY
-
+
static Callable<Void> toCallable(final @NonNull ThrowingRunnable runnable) {
final Callable<Void> callable = ()->{
- runnable.run();
+ runnable.run();
return null;
};
return callable;
}
-
+
}
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
index 7eef722..32a44e5 100644
--- a/commons/src/main/java/org/apache/isis/commons/handler/ChainOfResponsibility.java
+++ b/commons/src/main/java/org/apache/isis/commons/handler/ChainOfResponsibility.java
@@ -24,9 +24,9 @@ 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,
+ * <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
@@ -37,15 +37,15 @@ 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
+ * @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.
- *
+ * 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
@@ -57,15 +57,15 @@ public interface ChainOfResponsibility<X, R> {
}
/**
- * Creates a new ChainOfResponsibility of given {@code chainOfHandlers}
+ * Creates a new ChainOfResponsibility of given {@code chainOfHandlers}
* @param <X>
* @param <R>
* @param chainOfHandlers
*/
- static <X, R> ChainOfResponsibility<X, R>
+ static <X, R> ChainOfResponsibility<X, R>
of(
final List<? extends ChainOfResponsibility.Handler<? super X, R>> chainOfHandlers) {
-
+
return request -> {
final Optional<R> responseIfAny = chainOfHandlers.stream()
@@ -74,7 +74,7 @@ public interface ChainOfResponsibility<X, R> {
.map(h -> h.handle(request));
return responseIfAny;
};
-
+
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/having/HasEnabling.java b/commons/src/main/java/org/apache/isis/commons/having/HasEnabling.java
index b3c5806..542ec0f 100644
--- a/commons/src/main/java/org/apache/isis/commons/having/HasEnabling.java
+++ b/commons/src/main/java/org/apache/isis/commons/having/HasEnabling.java
@@ -24,5 +24,5 @@ public interface HasEnabling {
// enabled by default
return true;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/having/HasTypeSpecificAttributes.java b/commons/src/main/java/org/apache/isis/commons/having/HasTypeSpecificAttributes.java
index d2cae2b..2192783 100644
--- a/commons/src/main/java/org/apache/isis/commons/having/HasTypeSpecificAttributes.java
+++ b/commons/src/main/java/org/apache/isis/commons/having/HasTypeSpecificAttributes.java
@@ -33,5 +33,5 @@ public interface HasTypeSpecificAttributes {
/** remove type specific attribute */
void removeAttribute(Class<?> type);
-
+
}
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
index e4c6bce..cae3ada 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
@@ -52,7 +52,7 @@ public final class _Constants {
* Convenient e.g. for reflective invocation
*/
public static final Class<?>[] emptyClasses = new Class[0];
-
+
/**
* Convenient e.g. for reflective invocation
*/
@@ -88,16 +88,16 @@ public final class _Constants {
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
index cd62777..f621c24 100644
--- 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
@@ -87,7 +87,7 @@ public final class _Assert {
}
// -- NULL
-
+
public static void assertNull(Object object) {
assertNull(object, (String) null);
}
@@ -103,7 +103,7 @@ public final class _Assert {
fail(lazyMessage.get(), "null", "not null");
}
}
-
+
// -- NOT NULL
public static void assertNotNull(Object object) {
@@ -158,7 +158,7 @@ public final class _Assert {
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);
@@ -170,7 +170,7 @@ public final class _Assert {
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);
@@ -185,31 +185,31 @@ public final class _Assert {
"unexpected type: <%s> is not an instance of <%s> ", ""+type, ""+requiredType));
}
}
-
+
// -- OPEN/CLOSE STATE
public enum OpenCloseState {
- NOT_INITIALIZED,
- OPEN,
+ NOT_INITIALIZED,
+ OPEN,
CLOSED
;
public boolean isNotInitialized() { return this == NOT_INITIALIZED; }
public boolean isOpen() { return this == OPEN; }
public boolean isClosed() { return this == CLOSED; }
-
+
/**
* @param expected - nullable
- * @throws IllegalArgumentException if {@code this} not equal to {@code expected}
+ * @throws IllegalArgumentException if {@code this} not equal to {@code expected}
*/
public void assertEquals(
final @Nullable OpenCloseState expected) {
if (expected != this) {
- throw new IllegalStateException("State is: " + this + "; should be: " + expected);
+ throw new IllegalStateException("State is: " + this + "; should be: " + expected);
}
}
-
+
}
// -- HELPER
@@ -220,7 +220,7 @@ public final class _Assert {
private static void fail(String message, Object expected, Object actual) {
val error = _Exceptions.assertionError(
- buildPrefix(message)
+ 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
index bdfc67f..d1d31a2 100644
--- 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
@@ -25,7 +25,7 @@ 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.
+ * "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>
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
index 21e4090..1f9ba51 100644
--- 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
@@ -50,7 +50,7 @@ public final class _Bytes {
private static final int BUFFER_SIZE = 16 * 1024; // 16k
/**
- * Reads the input stream into an array of byte, then closes the input (-stream).
+ * 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
@@ -62,7 +62,7 @@ public final class _Bytes {
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);
@@ -73,7 +73,7 @@ public final class _Bytes {
input.close();
}
}
-
+
/**
* Reads the input stream into an array of byte, but does not close the input (-stream).
* @param input
@@ -87,7 +87,7 @@ public final class _Bytes {
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);
@@ -260,13 +260,13 @@ public final class _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));
@@ -274,7 +274,7 @@ public final class _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/_Casts.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Casts.java
index 457f945..3689ca9 100644
--- 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
@@ -48,8 +48,8 @@ public final class _Casts {
}
/**
- * 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
+ * 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
@@ -62,13 +62,13 @@ public final class _Casts {
}
requires(cls, "cls");
if(cls.isAssignableFrom(value.getClass())) {
- return Optional.of(cls.cast(value));
+ return Optional.of(cls.cast(value));
}
return Optional.empty();
}
-
+
/**
- * Casts an object to the class or interface represented by given {@code cls} Class object.
+ * 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
@@ -81,13 +81,13 @@ public final class _Casts {
}
requires(cls, "cls");
if(cls.isAssignableFrom(value.getClass())) {
- return cls.cast(value);
+ return cls.cast(value);
}
return null;
}
-
+
/**
- * Dependent on whether left or right can be cast to {@code cls}, the appropriate functional
+ * 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
@@ -98,9 +98,9 @@ public final class _Casts {
* @param onNonCast
*/
public static <T, R, U, V> R castThenApply(
- @Nullable U left,
+ @Nullable U left,
@Nullable V right,
- Class<T> cls,
+ Class<T> cls,
BiFunction<T, T, R> onBothCast,
BiFunction<T, V, R> onLeftCast,
BiFunction<U, T, R> onRightCast,
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
index d85b7a7..1d74f4f 100644
--- 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
@@ -77,19 +77,19 @@ public final class _Either<L, R> {
// -- ACCESSORS
public Optional<L> left() {
- return Optional.ofNullable(left);
+ return Optional.ofNullable(left);
}
public Optional<R> right() {
- return Optional.ofNullable(right);
+ return Optional.ofNullable(right);
}
public L leftIfAny() {
- return left;
+ return left;
}
public R rightIfAny() {
- return right;
+ return right;
}
// -- PREDICATES
@@ -111,21 +111,21 @@ public final class _Either<L, R> {
}
// -- MAPPING
-
+
public <T> _Either<T, R> mapLeft(final @NonNull Function<L, T> leftMapper){
return isLeft()
? _Either.left(leftMapper.apply(left))
: _Either.right(right);
}
-
+
public <T> _Either<L, T> mapRight(final @NonNull Function<R, T> rightMapper){
return isLeft()
? _Either.left(left)
: _Either.right(rightMapper.apply(right));
}
-
+
public <X, Y> _Either<X, Y> bimap(
- final @NonNull Function<L, X> leftMapper,
+ final @NonNull Function<L, X> leftMapper,
final @NonNull Function<R, Y> rightMapper){
return isLeft()
? left(leftMapper.apply(left))
@@ -133,13 +133,13 @@ public final class _Either<L, R> {
}
public <X, Y> _Either<X, Y> bimapNullable(
- final @NonNull Function<L, X> leftMapper,
+ final @NonNull Function<L, X> leftMapper,
final @NonNull Function<R, Y> rightMapper){
return isLeft()
? leftNullable(leftMapper.apply(left))
: rightNullable(rightMapper.apply(right));
}
-
+
public _Either<L, R> mapIfLeft(Function<L, _Either<L, R>> leftRemapper){
return isLeft()
? leftRemapper.apply(left)
@@ -152,13 +152,13 @@ public final class _Either<L, R> {
: rightRemapper.apply(right);
}
-
+
// -- FOLDING
public <T> T fold(BiFunction<L, R, T> biMapper){
return biMapper.apply(left, right);
}
-
+
public <T> T fold(
final @NonNull Function<L, T> leftMapper,
final @NonNull Function<R, T> rightMapper){
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
index f3197c5..98ca5c3 100644
--- 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
@@ -38,8 +38,8 @@ 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
+ * 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
@@ -48,18 +48,18 @@ public class _Files {
* @throws IOException
*/
public static Set<File> searchFiles(
- final File dir,
- final Predicate<File> dirFilter,
+ 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
+ * 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
@@ -68,11 +68,11 @@ public class _Files {
* @throws IOException
*/
public static void searchFiles(
- final File dir,
- final Predicate<File> dirFilter,
+ 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();
@@ -89,12 +89,12 @@ public class _Files {
}
}
}
-
+
/**
- *
+ *
* @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
+ * @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) {
@@ -107,13 +107,13 @@ public class _Files {
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.
+ * @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)) {
@@ -121,19 +121,19 @@ public class _Files {
}
return absolutePath;
}
-
+
/**
- * Deletes given {@link File}. This operation is ignored if the file is a directory or does not exist.
+ * Deletes given {@link File}. This operation is ignored if the file is a directory or does not exist.
* @param file - the file to be deleted (null-able)
*/
@SneakyThrows
public static void deleteFile(@Nullable File file) {
- if(file==null
+ if(file==null
|| !file.exists()
|| file.isDirectory()) {
return; // silently ignore if not an existing file
}
Files.delete(file.toPath());
}
-
+
}
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
index ac967b6..72a69dc 100644
--- 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
@@ -54,29 +54,29 @@ public interface _Lazy<T> extends Supplier<T> {
* 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
+ * Postcondition when memoization throws an exception: isMemoized()->true and get()->null
*/
@Override
public T get();
-
+
/**
* Optionally returns the value, based on whether this lazy got initialized and holds a memoized value.
*/
public Optional<T> getMemoized();
-
+
/**
- * Sets the memoized value, if not already memoized.
+ * 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}.
+ * 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}
*/
@@ -87,8 +87,8 @@ public interface _Lazy<T> extends Supplier<T> {
/**
* Thread-safe variant to {@link _Lazy#of(Supplier)}.
* <p>
- * Concurrent calls to this lazy's get() method will never result in concurrent calls to the
- * specified {@code 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}
*/
@@ -102,14 +102,14 @@ public interface _Lazy<T> extends Supplier<T> {
* The memoized value is held via weak reference, hence may be garbage collected any time.
* <p>
* @param supplier
- * @return an (thread-safe and weakly referenced) instance of _Lacy that initializes with
+ * @return an (thread-safe and weakly referenced) instance of _Lacy that initializes with
* the specified {@code supplier}
- * @implNoteThis This variant does not support {@link _Lazy#isMemoized()},
+ * @implNoteThis This variant does not support {@link _Lazy#isMemoized()},
* since this predicate is undecidable.
*/
public static <T> _Lazy<T> threadSafeAndWeak(Supplier<? extends T> supplier) {
return new _Lazy_ThreadSafeAndWeak<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
index bf951c1..24d7032 100644
--- 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
@@ -27,7 +27,7 @@ import org.apache.isis.commons.internal.exceptions._Exceptions;
import static org.apache.isis.commons.internal.base._With.requires;
/**
- * package private mixin for _Lazy
+ * package private mixin for _Lazy
* @since 2.0
*/
final class _Lazy_Simple<T> implements _Lazy<T> {
@@ -59,7 +59,7 @@ final class _Lazy_Simple<T> implements _Lazy<T> {
memoized = true;
return value = supplier.get();
}
-
+
@Override
public Optional<T> getMemoized() {
return Optional.ofNullable(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
index 444bfe3..1d83f1a 100644
--- 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
@@ -27,7 +27,7 @@ import org.apache.isis.commons.internal.exceptions._Exceptions;
import static org.apache.isis.commons.internal.base._With.requires;
/**
- * package private mixin for _Lazy
+ * package private mixin for _Lazy
* @since 2.0
*/
final class _Lazy_ThreadSafe<T> implements _Lazy<T> {
@@ -43,7 +43,7 @@ final class _Lazy_ThreadSafe<T> implements _Lazy<T> {
@Override
public boolean isMemoized() {
synchronized (this) {
- return memoized;
+ return memoized;
}
}
@@ -62,17 +62,17 @@ final class _Lazy_ThreadSafe<T> implements _Lazy<T> {
return value;
}
memoized = true;
- return value = supplier.get();
+ return value = supplier.get();
}
}
-
+
@Override
public Optional<T> getMemoized() {
synchronized (this) {
return Optional.ofNullable(value);
}
}
-
+
@Override
public void set(T value) {
synchronized (this) {
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafeAndWeak.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafeAndWeak.java
index 7014e62..d86ee9a 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafeAndWeak.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Lazy_ThreadSafeAndWeak.java
@@ -28,7 +28,7 @@ import org.apache.isis.commons.internal.exceptions._Exceptions;
import lombok.NonNull;
/**
- * package private mixin for _Lazy
+ * package private mixin for _Lazy
* @since 2.0
*/
final class _Lazy_ThreadSafeAndWeak<T> implements _Lazy<T> {
@@ -66,15 +66,15 @@ final class _Lazy_ThreadSafeAndWeak<T> implements _Lazy<T> {
}
final T newValue = supplier.get();
weakValueReference = new WeakReference<T>(newValue);
- return newValue;
+ return newValue;
}
}
-
+
@Override
public Optional<T> getMemoized() {
throw _Exceptions.unsupportedOperation("undecidable for weak references");
}
-
+
@Override
public void set(T newValue) {
synchronized (this) {
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
index 0690332..7072935 100644
--- 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
@@ -63,21 +63,21 @@ public final class _NullSafe {
* @return non-null stream object
*/
public static <T> Stream<T> stream(final @Nullable T[] array) {
- return array!=null
- ? Stream.of(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(final @Nullable T nullable) {
- return nullable != null
- ? Stream.of(nullable)
+ return nullable != null
+ ? Stream.of(nullable)
: Stream.empty();
}
@@ -88,11 +88,11 @@ public final class _NullSafe {
* @return non-null stream object
*/
public static <T> Stream<T> stream(final @Nullable Can<T> can){
- return can!=null
- ? can.stream()
+ 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.
@@ -100,7 +100,7 @@ public final class _NullSafe {
* @return non-null stream object
*/
public static <T> Stream<T> stream(final @Nullable Collection<T> coll){
- return coll!=null
+ return coll!=null
? coll.stream()
: Stream.empty();
}
@@ -112,8 +112,8 @@ public final class _NullSafe {
* @return non-null stream object
*/
public static <T> Stream<T> stream(final @Nullable Iterable<T> iterable){
- return iterable!=null
- ? stream(iterable.iterator())
+ return iterable!=null
+ ? stream(iterable.iterator())
: Stream.empty();
}
@@ -126,7 +126,7 @@ public final class _NullSafe {
public static <T> Stream<T> stream(final @Nullable Iterator<T> iterator){
return iterator!=null
? StreamSupport.stream(
- Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED),
+ Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED),
false) //not parallel
: Stream.empty();
}
@@ -138,8 +138,8 @@ public final class _NullSafe {
* @return non-null stream object
*/
public static <T> Stream<T> stream(final @Nullable Stream<T> stream) {
- return stream!=null
- ? stream
+ return stream!=null
+ ? stream
: Stream.empty();
}
@@ -158,6 +158,7 @@ public final class _NullSafe {
// 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) {
+ @Override
public boolean tryAdvance(Consumer<? super T> action) {
if(e.hasMoreElements()) {
action.accept(e.nextElement());
@@ -165,6 +166,7 @@ public final class _NullSafe {
}
return false;
}
+ @Override
public void forEachRemaining(Consumer<? super T> action) {
while(e.hasMoreElements()) {
action.accept(e.nextElement());
@@ -184,7 +186,7 @@ public final class _NullSafe {
return ((Can<?>)pojo).stream();
}
if(pojo.getClass().isArray()) {
- if(Array.getLength(pojo)==0) return Stream.empty();
+ 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);
@@ -203,50 +205,50 @@ public final class _NullSafe {
}
return Stream.of(pojo);
}
-
+
// not null-safe, but for performance reasons not checked (private anyway) ...
-
+
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}
+ *
+ * @apiNote we keep this, arguably provides better code readability than {@code Objects#nonNull}
*/
public static boolean isPresent(final @Nullable Object x) {
return x!=null;
@@ -256,7 +258,7 @@ public final class _NullSafe {
* 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(final @Nullable Object x) {
@@ -306,10 +308,10 @@ public final class _NullSafe {
*/
@Nullable
public static final <K,V> V getOrDefault(
- final @Nullable Map<K, V> map,
- final @Nullable K key,
+ final @Nullable Map<K, V> map,
+ final @Nullable K key,
final @Nullable V defaultValue) {
-
+
if(map==null || key==null) {
return defaultValue;
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Objects.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Objects.java
index e8c15a5..1d680d1 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/base/_Objects.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Objects.java
@@ -42,9 +42,9 @@ public final class _Objects {
/**
* Compares two objects (nulls-first) in natural order.
* <p>
- * @apiNote consider using {@link Comparator#naturalOrder()} combined with
- * {@link Comparator#nullsFirst(Comparator)}.
- * @implNote this utility method does not produce objects on the heap
+ * @apiNote consider using {@link Comparator#naturalOrder()} combined with
+ * {@link Comparator#nullsFirst(Comparator)}.
+ * @implNote this utility method does not produce objects on the heap
* @param a
* @param b
* @return {@code <0} if {@code a < b}, {@code >0} if {@code a > b} else {@code 0}
@@ -55,7 +55,7 @@ public final class _Objects {
if(Objects.equals(a, b)) {
return 0;
}
- // at this point not both can be null, so which ever is null wins
+ // at this point not both can be null, so which ever is null wins
if(a==null) {
return -1;
}
@@ -71,24 +71,24 @@ public final class _Objects {
}
throw _Exceptions.unsupportedOperation("cannot compare objects if non of them is 'comparable'");
}
-
+
/**
* Compares two objects (nulls-last) in natural order.
* <p>
- * @apiNote consider using {@link Comparator#naturalOrder()} combined with
- * {@link Comparator#nullsLast(Comparator)}.
- * @implNote this utility method does not produce objects on the heap
+ * @apiNote consider using {@link Comparator#naturalOrder()} combined with
+ * {@link Comparator#nullsLast(Comparator)}.
+ * @implNote this utility method does not produce objects on the heap
* @param a
* @param b
* @return {@code <0} if {@code a < b}, {@code >0} if {@code a > b} else {@code 0}
* @see Comparable#compareTo(Object)
- * @throws UnsupportedOperationException if neither object is comparable
+ * @throws UnsupportedOperationException if neither object is comparable
*/
public static <T> int compareNullsLast(final @Nullable T a, final @Nullable T b) {
if(Objects.equals(a, b)) {
return 0;
}
- // at this point not both can be null, so which ever is null wins
+ // at this point not both can be null, so which ever is null wins
if(a==null) {
return -1;
}
@@ -107,16 +107,16 @@ public final class _Objects {
/**
* Compares two objects in natural order, both assumed to be non-null.
- *
- * @apiNote consider using {@link Comparator#naturalOrder()}.
+ *
+ * @apiNote consider using {@link Comparator#naturalOrder()}.
* @implNote this utility method does not produce objects on the heap
- * @implNote for performance reasons we don't check for non-null arguments on method entry
- *
+ * @implNote for performance reasons we don't check for non-null arguments on method entry
+ *
* @param a - nun-null
* @param b - nun-null
* @return {@code <0} if {@code a < b}, {@code >0} if {@code a > b} else {@code 0}
* @see Comparable#compareTo(Object)
- * @throws UnsupportedOperationException if neither object is comparable or both are {@code null}
+ * @throws UnsupportedOperationException if neither object is comparable or both are {@code null}
*/
public static <T> int compareNonNull(final /*@NonNull*/ T a, final /*@NonNull*/ T b) {
if (a instanceof Comparable<?>) {
@@ -127,17 +127,17 @@ public final class _Objects {
}
throw _Exceptions.unsupportedOperation("cannot compare objects if non of them is 'comparable'");
}
-
+
// -- HELPER
-
+
private final static int negate(int x) {
// guard against integer overflow
if(x==Integer.MIN_VALUE) {
- return 1;
+ return 1;
}
/*sonar-ignore-on*/
return -x;
/*sonar-ignore-off*/
}
-
+
}
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
index c2c006a..fbbd450 100644
--- 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
@@ -36,7 +36,7 @@ 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;
/**
@@ -48,7 +48,7 @@ public final class _Oneshot implements Serializable {
++ shotCount;
return true;
}
- return false;
+ return false;
}
}
@@ -60,5 +60,5 @@ public final class _Oneshot implements Serializable {
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
index ff7611b..640609b 100644
--- 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
@@ -33,7 +33,7 @@ import static org.apache.isis.commons.internal.base._With.requires;
* Provides a generic (left-fold) reduction class.
* <p>
* Most intuitive example of a reduction is finding the
- * minimum value from a list of values.
+ * minimum value from a list of values.
* See {@code org.apache.isis.commons.internal.base.ReductionTest} for examples.
* <p>
* <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this package! <br/>
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Refs.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Refs.java
index ce167d0..04075f1 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/base/_Refs.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Refs.java
@@ -52,67 +52,67 @@ import lombok.val;
public final class _Refs {
// -- FACTORIES
-
+
public static BooleanReference booleanRef(final boolean value) {
return new BooleanReference(value);
}
-
+
public static IntReference intRef(final int value) {
return new IntReference(value);
}
-
+
public static LongReference longRef(final int value) {
return new LongReference(value);
}
-
+
public static <T> ObjectReference<T> objectRef(final @Nullable T value) {
return new ObjectReference<>(value);
}
-
+
public static StringReference stringRef(final @NonNull String value) {
return new StringReference(value);
}
-
+
// -- IMPLEMENTATIONS
-
+
@FunctionalInterface
public static interface BooleanUnaryOperator {
boolean applyAsBoolean(boolean value);
}
-
+
/**
* Holder of a mutable primitive {@code boolean} value.
- * @since 2.0
+ * @since 2.0
*/
@Data @AllArgsConstructor
public static final class BooleanReference {
private boolean value;
-
+
public boolean update(final @NonNull BooleanUnaryOperator operator) {
return value=operator.applyAsBoolean(value);
}
-
+
public boolean isTrue() {
return value;
}
-
+
public boolean isFalse() {
return !value;
}
}
-
+
/**
* Holder of a mutable primitive {@code int} value.
- * @since 2.0
+ * @since 2.0
*/
@Data @AllArgsConstructor
public static final class IntReference {
private int value;
-
+
public int update(final @NonNull IntUnaryOperator operator) {
return value = operator.applyAsInt(value);
}
-
+
public boolean isSet(int other) {
return value==other;
}
@@ -120,92 +120,92 @@ public final class _Refs {
public int inc() {
return ++value;
}
-
+
public int dec() {
return --value;
}
-
+
}
-
+
/**
* Holder of a mutable primitive {@code long} value.
- * @since 2.0
+ * @since 2.0
*/
@Data @AllArgsConstructor
public static final class LongReference {
private long value;
-
+
public long update(final @NonNull LongUnaryOperator operator) {
return value = operator.applyAsLong(value);
}
-
+
public boolean isSet(long other) {
return value==other;
}
-
+
public long inc() {
return ++value;
}
-
+
public long dec() {
return --value;
}
}
-
+
/**
* Holder of a nullable and mutable {@link Object} value.
- * @since 2.0
+ * @since 2.0
*/
@Setter @ToString @EqualsAndHashCode @AllArgsConstructor
public static final class ObjectReference<T> {
private @Nullable T value;
-
+
public T update(final @NonNull UnaryOperator<T> operator) {
return value = operator.apply(value);
}
-
+
public boolean isSet(final @Nullable T other) {
return value==other;
}
-
+
public Optional<T> getValue() {
return Optional.ofNullable(value);
}
-
+
public T getValueElseGet(Supplier<? extends T> other) {
return getValue().orElseGet(other);
}
-
+
public T getValueElseDefault(T defaultValue) {
return getValue().orElse(defaultValue);
}
-
+
public T getValueElseFail() {
return getValue().orElseThrow(_Exceptions::noSuchElement);
}
-
+
}
-
+
/**
* Holder of a non-null and mutable {@link String} value.
- * @since 2.0
+ * @since 2.0
*/
@Setter @ToString @EqualsAndHashCode @AllArgsConstructor
public static final class StringReference {
private @NonNull String value;
-
+
public String update(final @NonNull UnaryOperator<String> operator) {
return value = Objects.requireNonNull(operator.apply(value));
}
-
+
public boolean isSet(String other) {
return value.equals(other);
}
-
+
public String getValue() {
return value;
}
-
+
/**
* Returns true if and only if this string contains the specified
* sequence of char values.
@@ -216,16 +216,16 @@ public final class _Refs {
public boolean contains(CharSequence s) {
return value.contains(s);
}
-
+
/**
- * At given {@code index} cuts the held {@link String} value into <i>left</i> and <i>right</i>
+ * At given {@code index} cuts the held {@link String} value into <i>left</i> and <i>right</i>
* parts, returns the <i>left</i> part and replaces the held string value with the <i>right</i>
* part.
* <ul>
- * <li>Index underflow returns an empty string and leaves the held value unmodified.</li>
+ * <li>Index underflow returns an empty string and leaves the held value unmodified.</li>
* <li>Index overflow returns the currently held value 'then' assigns the held value an empty string.</li>
- * </ul>
- * @param index - zero based cutting point
+ * </ul>
+ * @param index - zero based cutting point
* @return left - cut off - part of held value (non-null)
*/
public String cutAtIndex(int index) {
@@ -241,18 +241,18 @@ public final class _Refs {
value = value.substring(index);
return left;
}
-
+
/**
* Shortcut to {@code cutAtIndex(value.indexOf(s))}.
* <p>
- * At calculated {@code value.indexOf(s)} cuts the held {@link String} value into
- * <i>left</i> and <i>right</i> parts, returns the <i>left</i> part and replaces the held
+ * At calculated {@code value.indexOf(s)} cuts the held {@link String} value into
+ * <i>left</i> and <i>right</i> parts, returns the <i>left</i> part and replaces the held
* string value with the <i>right</i> part.
* <p>
* When the substring is not found, returns an empty string and leaves the held value unmodified.
- *
+ *
* @param s the substring to search for.
- * @return left - cut off - part of held value (non-null) at the index of the first
+ * @return left - cut off - part of held value (non-null) at the index of the first
* occurrence of the specified substring,
* or an empty string if there is no such occurrence.
* @see #cutAtIndex(int)
@@ -261,18 +261,18 @@ public final class _Refs {
public String cutAtIndexOf(String s) {
return cutAtIndex(value.indexOf(s));
}
-
+
/**
* Shortcut to {@code cutAtIndex(value.lastIndexOf(s))}.
* <p>
- * At calculated {@code value.lastIndexOf(s)} cuts the held {@link String} value into
- * <i>left</i> and <i>right</i> parts, returns the <i>left</i> part and replaces the held
+ * At calculated {@code value.lastIndexOf(s)} cuts the held {@link String} value into
+ * <i>left</i> and <i>right</i> parts, returns the <i>left</i> part and replaces the held
* string value with the <i>right</i> part.
* <p>
* When the substring is not found, returns an empty string and leaves the held value unmodified.
- *
+ *
* @param s the substring to search for.
- * @return left - cut off - part of held value (non-null) at the index of the last
+ * @return left - cut off - part of held value (non-null) at the index of the last
* occurrence of the specified substring,
* or an empty string if there is no such occurrence.
* @see #cutAtIndex(int)
@@ -281,19 +281,19 @@ public final class _Refs {
public String cutAtLastIndexOf(String s) {
return cutAtIndex(value.lastIndexOf(s));
}
-
+
/**
- * Variant of to {@link #cutAtIndexOf(String)}, that drops the specified substring {@code s}.
+ * Variant of to {@link #cutAtIndexOf(String)}, that drops the specified substring {@code s}.
* <p>
- * At calculated {@code value.indexOf(s)} cuts the held {@link String} value into
- * <i>left</i>, <i>dropped</i> and <i>right</i> parts, returns the <i>left</i> part and
+ * At calculated {@code value.indexOf(s)} cuts the held {@link String} value into
+ * <i>left</i>, <i>dropped</i> and <i>right</i> parts, returns the <i>left</i> part and
* replaces the held string value with the <i>right</i> part. Where the <i>dropped</i> part
* identifies as the matching part, that equals the specified substring {@code s}.
* <p>
* When the substring is not found, returns an empty string and leaves the held value unmodified.
- *
+ *
* @param s the substring to search for.
- * @return left - cut off - part of held value (non-null) at the index of the first
+ * @return left - cut off - part of held value (non-null) at the index of the first
* occurrence of the specified substring,
* or an empty string if there is no such occurrence.
* @see #cutAtIndex(int)
@@ -307,19 +307,19 @@ public final class _Refs {
cutAtIndex(s.length());
return left;
}
-
+
/**
- * Variant of to {@link #cutAtLastIndexOf(String)}, that drops the specified substring {@code s}.
+ * Variant of to {@link #cutAtLastIndexOf(String)}, that drops the specified substring {@code s}.
* <p>
- * At calculated {@code value.lastIndexOf(s)} cuts the held {@link String} value into
- * <i>left</i>, <i>dropped</i> and <i>right</i> parts, returns the <i>left</i> part and
+ * At calculated {@code value.lastIndexOf(s)} cuts the held {@link String} value into
+ * <i>left</i>, <i>dropped</i> and <i>right</i> parts, returns the <i>left</i> part and
* replaces the held string value with the <i>right</i> part. Where the <i>dropped</i> part
* identifies as the matching part, that equals the specified substring {@code s}.
* <p>
* When the substring is not found, returns an empty string and leaves the held value unmodified.
- *
+ *
* @param s the substring to search for.
- * @return left - cut off - part of held value (non-null) at the index of the last
+ * @return left - cut off - part of held value (non-null) at the index of the last
* occurrence of the specified substring,
* or an empty string if there is no such occurrence.
* @see #cutAtIndex(int)
@@ -333,7 +333,7 @@ public final class _Refs {
cutAtIndex(s.length());
return left;
}
-
+
}
-
+
}
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
index cac0c85..dcbc44f 100644
--- 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
@@ -95,13 +95,13 @@ public final class _Strings {
* 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}
+ * @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) {
@@ -112,24 +112,24 @@ public final class _Strings {
Arrays.fill(chars, c);
return String.valueOf(chars);
}
-
+
// -- COMPARE
-
+
/**
* Compares two strings lexicographically (and nulls-frist).
- * @apiNote consider using {@link Comparator#naturalOrder()} combined with
- * {@link Comparator#nullsFirst(Comparator)}.
- * @implNote this utility method does not produce objects on the heap
+ * @apiNote consider using {@link Comparator#naturalOrder()} combined with
+ * {@link Comparator#nullsFirst(Comparator)}.
+ * @implNote this utility method does not produce objects on the heap
* @param a
* @param b
* @return {@code -1} if {@code a < b}, {@code 1} if {@code a > b} else {@code 0}
- * @see String#compareTo(String)
+ * @see String#compareTo(String)
*/
public static int compareNullsFirst(final @Nullable String a, final @Nullable String b) {
if(Objects.equals(a, b)) {
return 0;
}
- // at this point not both can be null, so which ever is null wins
+ // at this point not both can be null, so which ever is null wins
if(a==null) {
return -1;
}
@@ -139,22 +139,22 @@ public final class _Strings {
// at this point neither can be null
return a.compareTo(b);
}
-
+
/**
* Compares two strings lexicographically (and nulls-last).
- * @apiNote consider using {@link Comparator#naturalOrder()} combined with
- * {@link Comparator#nullsFirst(Comparator)}.
- * @implNote this utility method does not produce objects on the heap
+ * @apiNote consider using {@link Comparator#naturalOrder()} combined with
+ * {@link Comparator#nullsFirst(Comparator)}.
+ * @implNote this utility method does not produce objects on the heap
* @param a
* @param b
* @return {@code -1} if {@code a < b}, {@code 1} if {@code a > b} else {@code 0}
- * @see String#compareTo(String)
+ * @see String#compareTo(String)
*/
public static int compareNullsLast(final @Nullable String a, final @Nullable String b) {
if(Objects.equals(a, b)) {
return 0;
}
- // at this point not both can be null, so which ever is null wins
+ // at this point not both can be null, so which ever is null wins
if(a==null) {
return 1;
}
@@ -193,12 +193,12 @@ public final class _Strings {
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
+ * @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());
@@ -208,7 +208,7 @@ public final class _Strings {
/**
* @param input
- * @return null if the {@code input} is null or empty, the {@code input} otherwise
+ * @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)) {
@@ -219,7 +219,7 @@ public final class _Strings {
/**
* @param input
- * @return the empty string if the {@code input} is null, the {@code input} otherwise
+ * @return the empty string if the {@code input} is null, the {@code input} otherwise
*/
public static String nullToEmpty(@Nullable String input) {
if(input==null) {
@@ -273,7 +273,7 @@ public final class _Strings {
}
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
@@ -336,12 +336,12 @@ public final class _Strings {
// -- 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
+ * 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
@@ -444,9 +444,9 @@ public final class _Strings {
Spliterators.spliteratorUnknownSize(splitIterator(input, separator), Spliterator.ORDERED),
false); // not parallel
}
-
+
/**
- * Creates a stream from the given input sequence around matches of {@code delimiterPattern}.
+ * Creates a stream from the given input sequence around matches of {@code delimiterPattern}.
* @param input
* @param delimiterPattern
*/
@@ -459,18 +459,18 @@ public final class _Strings {
}
/**
- * Optionally applies {@code onNonEmptySplit} function, based on whether both split parts
- * <i>lhs</i> and <i>rhs</i> are non empty Strings.
+ * Optionally applies {@code onNonEmptySplit} function, based on whether both split parts
+ * <i>lhs</i> and <i>rhs</i> are non empty Strings.
* @param <T>
* @param input
* @param separator
* @param onNonEmptySplit
*/
public static <T> Optional<T> splitThenApplyRequireNonEmpty(
- @Nullable final String input,
- final String separator,
+ @Nullable final String input,
+ final String separator,
final BiFunction<String, String, T> onNonEmptySplit) {
-
+
if(isEmpty(input)) {
return Optional.empty();
}
@@ -490,8 +490,8 @@ public final class _Strings {
}
public static void splitThenAccept(
- @Nullable final String input,
- final String separator,
+ @Nullable final String input,
+ final String separator,
final BiConsumer<String, String> onNonEmptySplit,
final Consumer<String> onNonEmptyLhs,
final Consumer<String> onNonEmptyRhs) {
@@ -500,16 +500,16 @@ public final class _Strings {
}
public static void splitThenAcceptEmptyAsNull(
- @Nullable final String input,
- final String separator,
+ @Nullable final String input,
+ final String separator,
final BiConsumer<String, String> onSplit) {
- _Strings_FastSplit.splitThenAccept(input, separator, onSplit,
- lhs->onSplit.accept(lhs, null),
+ _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")
@@ -517,7 +517,7 @@ public final class _Strings {
.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);
@@ -546,14 +546,14 @@ public final class _Strings {
* @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,
+ @Nullable final CharSequence input,
+ final int maxLength,
@NonNull final CharSequence ellipsis) {
-
+
if(input==null) {
return "";
}
- if(input.length()<=maxLength) {
+ if(input.length()<=maxLength) {
return input.toString();
}
final int trimmedLength = maxLength - ellipsis.length();
@@ -561,7 +561,7 @@ public final class _Strings {
final int start = end - trimmedLength;
return String.join("", ellipsis, input.subSequence(start, end));
}
-
+
/**
* abc...
* @param input
@@ -570,14 +570,14 @@ public final class _Strings {
* @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,
+ @Nullable final CharSequence input,
+ final int maxLength,
@NonNull final CharSequence ellipsis) {
-
+
if(input==null) {
return "";
}
- if(input.length()<=maxLength) {
+ if(input.length()<=maxLength) {
return input.toString();
}
final int trimmedLength = maxLength - ellipsis.length();
@@ -597,15 +597,15 @@ public final class _Strings {
return scanner.hasNext() ? scanner.next() : "";
}
}
-
+
@SneakyThrows
public static String readFromResource(
- final @NonNull Class<?> resourceLocation,
- final @NonNull String resourceName,
+ final @NonNull Class<?> resourceLocation,
+ final @NonNull String resourceName,
final @NonNull Charset charset) {
try(val input = resourceLocation.getResourceAsStream(resourceName)){
- return read(input, charset);
- }
+ return read(input, charset);
+ }
}
// -- BYTE ARRAY CONVERSION
@@ -710,9 +710,9 @@ public final class _Strings {
.map(String::trim)
.filter(not(String::isEmpty));
}
-
+
/**
- * Like {@link _Strings#splitThenStream(CharSequence, Pattern)} but also trimming each junk,
+ * Like {@link _Strings#splitThenStream(CharSequence, Pattern)} but also trimming each junk,
* then discarding empty chunks.
* @return empty stream if {@code input} is null
*/
@@ -721,7 +721,7 @@ public final class _Strings {
.map(String::trim)
.filter(not(String::isEmpty));
}
-
+
public static String base64UrlDecode(final String str) {
return _Strings.convert(str, _Bytes.ofUrlBase64, 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
index 7e6a529..8fb0a23 100644
--- 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
@@ -26,8 +26,8 @@ import javax.annotation.Nullable;
class _Strings_FastSplit {
public static void splitThenAccept(
- @Nullable final String input,
- final String separator,
+ @Nullable final String input,
+ final String separator,
BiConsumer<String, String> onNonEmptySplit,
Consumer<String> onNonEmptyLhs,
Consumer<String> onNonEmptyRhs) {
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
index fcc090f..4cc9fc6 100644
--- 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
@@ -35,7 +35,7 @@ final class _Strings_HtmlEscaper {
_Strings.pair("<", "<"),
_Strings.pair(">", ">"),
- };
+ };
static String htmlEscape(String input) {
if(_Strings.isEmpty(input)) {
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
index 5adc7a9..b97cbb2 100644
--- 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
@@ -61,7 +61,7 @@ final class _Strings_KeyValuePair implements _Strings.KeyValuePair {
* 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}
+ * @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) {
@@ -76,8 +76,8 @@ final class _Strings_KeyValuePair implements _Strings.KeyValuePair {
}
String aKey = keyValueLiteral.substring(0, equalsIndex);
- String aValue = equalsIndex == keyValueLiteral.length() - 1
- ? ""
+ 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_SplitIterator.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Strings_SplitIterator.java
index d613f31..e6c277d 100644
--- 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
@@ -65,11 +65,11 @@ final class _Strings_SplitIterator {
@Override
public String next() {
-
+
if(!hasNext()) {
throw _Exceptions.noSuchElement("end of string already reached");
}
-
+
try {
return next;
} finally {
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/base/_Text.java b/commons/src/main/java/org/apache/isis/commons/internal/base/_Text.java
index 4db5f78..b88effa 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/base/_Text.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Text.java
@@ -64,7 +64,7 @@ public final class _Text {
private _Text() {}
/**
- * Converts given {@code text} into a {@link Stream} of lines,
+ * Converts given {@code text} into a {@link Stream} of lines,
* removing new line characters {@code \n,\r} in the process.
* @param text - nullable
* @return non-null
@@ -74,9 +74,9 @@ public final class _Text {
return _Strings.splitThenStream(text, "\n")
.map(s->s.replace("\r", ""));
}
-
+
/**
- * Converts given {@code text} into a {@link Can} of lines,
+ * Converts given {@code text} into a {@link Can} of lines,
* removing new line characters {@code \n,\r} in the process.
* @param text - nullable
* @return non-null
@@ -84,7 +84,7 @@ public final class _Text {
public static Can<String> getLines(final @Nullable String text){
return Can.ofStream(streamLines(text));
}
-
+
public static Can<String> breakLines(Can<String> lines, int maxChars) {
if(lines.isEmpty()) {
return lines;
@@ -93,15 +93,15 @@ public final class _Text {
.flatMap(line->breakLine(line, maxChars))
.collect(Can.toCan());
}
-
+
/**
- * Reads content from given {@code input} into a {@link Can} of lines,
+ * Reads content from given {@code input} into a {@link Can} of lines,
* removing new line characters {@code \n,\r} in the process.
* @param input - nullable
* @return non-null
*/
public static Can<String> readLines(
- final @Nullable InputStream input,
+ final @Nullable InputStream input,
final @NonNull Charset charset){
if(input==null) {
return Can.empty();
@@ -116,94 +116,94 @@ public final class _Text {
}
return Can.ofCollection(lines);
}
-
+
@SneakyThrows
public static Can<String> readLinesFromResource(
- final @NonNull Class<?> resourceLocation,
- final @NonNull String resourceName,
+ final @NonNull Class<?> resourceLocation,
+ final @NonNull String resourceName,
final @NonNull Charset charset) {
try(val input = resourceLocation.getResourceAsStream(resourceName)){
- return readLines(input, charset);
- }
+ return readLines(input, charset);
+ }
}
-
+
@SneakyThrows
public static Can<String> readLinesFromUrl(
- final @NonNull URL url,
+ final @NonNull URL url,
final @NonNull Charset charset) {
try(val input = url.openStream()){
- return readLines(input, charset);
- }
+ return readLines(input, charset);
+ }
}
-
+
@SneakyThrows
public static Can<String> readLinesFromFile(
- final @NonNull File file,
+ final @NonNull File file,
final @NonNull Charset charset) {
try(val input = new FileInputStream(file)){
- return readLines(input, charset);
- }
+ return readLines(input, charset);
+ }
}
// -- WRITING
-
+
@SneakyThrows
public static void writeLinesToFile(
final @NonNull Iterable<String> lines,
- final @NonNull File file,
+ final @NonNull File file,
final @NonNull Charset charset) {
-
+
try(val bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset))) {
for(val line : lines) {
- bw.append(line).append("\n");
+ bw.append(line).append("\n");
}
- }
+ }
}
-
+
// -- NORMALIZING
-
+
public static String normalize(final @Nullable String text) {
if(text==null) {
return "";
}
return normalize(getLines(text)).stream().collect(Collectors.joining("\n"));
}
-
+
/**
- * Converts given {@code lines} into a {@link Can} of lines,
- * with any empty lines removed that appear
+ * Converts given {@code lines} into a {@link Can} of lines,
+ * with any empty lines removed that appear
* <ul>
* <li>before the first non-empty line</li>
* <li>immediately after an empty line</li>
* <li>after the last non-empty line</li>
* </ul>
- * A line is considered non-empty,
+ * A line is considered non-empty,
* if it contains non-whitespace characters.
- *
+ *
* @param lines
* @return non-null
*/
public static Can<String> normalize(final @NonNull Can<String> lines) {
return removeRepeatedEmptyLines(removeTrailingEmptyLines(removeLeadingEmptyLines(lines)));
}
-
+
/**
- * Converts given {@code lines} into a {@link Can} of lines,
+ * Converts given {@code lines} into a {@link Can} of lines,
* with any empty lines removed that appear before the first non-empty line.
- * A line is considered non-empty,
+ * A line is considered non-empty,
* if it contains non-whitespace characters.
- *
+ *
* @param lines
* @return non-null
*/
public static Can<String> removeLeadingEmptyLines(final @NonNull Can<String> lines) {
-
+
if(lines.isEmpty()) {
return lines;
}
-
- final int[] nonEmptyLineCount = {0};
-
+
+ final int[] nonEmptyLineCount = {0};
+
return lines.stream()
// peek with side-effect
.peek(line->{
@@ -212,24 +212,24 @@ public final class _Text {
.filter(line->nonEmptyLineCount[0]>0)
.collect(Can.toCan());
}
-
+
/**
- * Converts given {@code lines} into a {@link Can} of lines,
+ * Converts given {@code lines} into a {@link Can} of lines,
* with any empty lines removed that appear after the last non-empty line.
- * A line is considered non-empty,
+ * A line is considered non-empty,
* if it contains non-whitespace characters.
- *
+ *
* @param lines
* @return non-null
*/
public static Can<String> removeTrailingEmptyLines(final @NonNull Can<String> lines) {
-
+
if(lines.isEmpty()) {
return lines;
}
-
+
final int lastLineIndex = lines.size()-1;
-
+
final int lastNonEmptyLineIndex = lines.stream()
.mapToInt(indexAndlineToIntFunction((index, line)->hasNonWhiteSpaceChars(line) ? index : -1))
.max()
@@ -238,28 +238,28 @@ public final class _Text {
if(lastLineIndex == lastNonEmptyLineIndex) {
return lines; // reuse immutable object
}
-
+
return lines.stream().limit(1L + lastNonEmptyLineIndex).collect(Can.toCan());
}
-
+
/**
- * Converts given {@code lines} into a {@link Can} of lines,
+ * Converts given {@code lines} into a {@link Can} of lines,
* with any empty lines removed that appear immediately after an empty line.
- * A line is considered non-empty,
+ * A line is considered non-empty,
* if it contains non-whitespace characters.
- *
+ *
* @param lines
* @return non-null
*/
public static Can<String> removeRepeatedEmptyLines(final @NonNull Can<String> lines) {
-
+
// we need at least 2 lines
if(lines.size()<2) {
return lines;
}
-
+
final int[] latestEmptyLineIndex = {-2};
-
+
return streamLineObjects(lines)
.peek(line->{
if(!line.isEmpty()) {
@@ -268,33 +268,33 @@ public final class _Text {
if(latestEmptyLineIndex[0] == line.getIndex()-1) {
line.setMarkedForRemoval(true);
}
- latestEmptyLineIndex[0] = line.getIndex();
+ latestEmptyLineIndex[0] = line.getIndex();
})
.filter(line->!line.isMarkedForRemoval())
.map(Line::getString)
.collect(Can.toCan());
}
-
+
// -- TESTING SUPPORT
-
+
public static void assertTextEquals(final @Nullable String a, final @Nullable String b) {
assertTextEquals(getLines(a), getLines(b));
}
-
+
public static void assertTextEquals(final @NonNull Can<String> a, final @Nullable String b) {
assertTextEquals(a, getLines(b));
}
-
+
public static void assertTextEquals(final @Nullable String a, final @NonNull Can<String> b) {
assertTextEquals(getLines(a), b);
}
-
+
public static void assertTextEquals(final @NonNull Can<String> a, final @NonNull Can<String> b) {
-
+
val na = normalize(a);
val nb = normalize(b);
-
+
val lineNrRef = _Refs.intRef(0);
if(na.size()<=nb.size()) {
@@ -308,19 +308,19 @@ public final class _Text {
_Assert.assertEquals(left, right, ()->String.format("first non matching lineNr %d", lineNr));
});
}
-
+
_Assert.assertEquals(na.size(), nb.size(), ()->String.format("normalized texts differ in number of lines"));
}
-
+
// -- HELPER
-
+
private static boolean hasNonWhiteSpaceChars(String s) {
if(s==null) {
return false;
}
return !s.trim().isEmpty();
}
-
+
@Getter
private static class Line {
private final int index; // zero based
@@ -333,23 +333,23 @@ public final class _Text {
this.string = string;
this.empty = !hasNonWhiteSpaceChars(string);
}
-
+
}
-
+
private static Stream<Line> streamLineObjects(final @NonNull Can<String> lines) {
final int[] indexRef = {0};
return lines.stream().map(line->new Line(indexRef[0]++, line));
}
-
+
private static interface IndexAwareLineToIntFunction {
public int apply(int lineIndex, String line);
}
-
+
private static ToIntFunction<String> indexAndlineToIntFunction(IndexAwareLineToIntFunction mapper) {
final int[] indexRef = {0};
return line->mapper.apply(indexRef[0]++, line);
}
-
+
private static Stream<String> breakLine(String line, final int maxChars) {
line = line.trim();
if(line.length()<=maxChars) {
@@ -357,39 +357,39 @@ public final class _Text {
}
val tokens = Can.ofEnumeration(new StringTokenizer(line, " .-:/_", true))
.map(String.class::cast);
-
+
val constraintLines = _Lists.<String>newArrayList();
val partialSum = _Refs.intRef(0);
val partialCount = _Refs.intRef(0);
-
+
val tokenIterator = tokens.iterator();
-
+
tokens.stream()
.mapToInt(String::length)
.forEach(tokenLen->{
-
+
final int nextLen = partialSum.getValue() + tokenLen;
if(nextLen <= maxChars) {
partialSum.update(x->nextLen);
partialCount.inc();
} else {
-
+
constraintLines.add(
IntStream.range(0, partialCount.getValue())
.mapToObj(__->tokenIterator.next())
.collect(Collectors.joining()));
-
+
partialSum.update(x->tokenLen);
partialCount.setValue(1);
}
});
-
+
// add remaining
constraintLines.add(
IntStream.range(0, partialCount.getValue())
.mapToObj(__->tokenIterator.next())
.collect(Collectors.joining()));
-
+
return constraintLines.stream();
}
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
index 397b1da..3f0e143 100644
--- 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
@@ -48,14 +48,14 @@ public final class _Timing {
}
/**
- *
+ *
* @param startedAtSystemNanos
* @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.
@@ -92,13 +92,13 @@ public final class _Timing {
}
/**
- * @return elapsed nano seconds since started
- * (or when stopped, the time interval between started and stopped)
+ * @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)
@@ -106,7 +106,7 @@ public final class _Timing {
public long getMicros() {
return getNanos()/1000L;
}
-
+
/**
* @return elapsed milli seconds since started
* (or when stopped, the time interval between started and stopped)
@@ -114,7 +114,7 @@ public final class _Timing {
public long getMillis() {
return getNanos()/1000_000L;
}
-
+
@Override
public String toString() {
return String.format(Locale.US, "%d ms", getMillis());
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
index 6a6076a..ba7a0f7 100644
--- 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
@@ -46,7 +46,7 @@ import lombok.val;
public final class _Tuples {
private _Tuples(){}
-
+
// -- TUPLE 2
public static class Tuple2<T1, T2>{
@@ -71,26 +71,26 @@ public final class _Tuples {
public static <T1, T2> Tuple2<T1, T2> pair(T1 _1, T2 _2) {
return new Tuple2<T1, T2>(_1, _2);
}
-
- // -- INDEXED
-
+
+ // -- 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 Can<Class<? extends Serializable>> types;
final List<Serializable> values;
@Override
@@ -128,12 +128,12 @@ public final class _Tuples {
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
index 2607220..5c52622 100644
--- 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
@@ -212,7 +212,7 @@ public final class _With<T> {
/**
* 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
+ * @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}
*/
@@ -229,7 +229,7 @@ public final class _With<T> {
/**
* 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
+ * @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'
@@ -311,10 +311,10 @@ public final class _With<T> {
}
// -- EXCEPTION SWALLOW IDIOMS
-
+
/**
* Returns Optional of the callable's result after invocation. Any exception during
- * invocation will result in an empty Optional.
+ * invocation will result in an empty Optional.
*/
public static <T> Optional<T> tryCall(Callable<T> callable) {
try {
@@ -327,7 +327,7 @@ public final class _With<T> {
/**
* Returns the callable's result after invocation. Any exception during
- * invocation will result in the defaultValue being returned instead.
+ * invocation will result in the defaultValue being returned instead.
*/
public static <T> T tryOrDefault(Callable<T> callable, T defaultValue) {
try {
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
index 23ae4a9..fcbb774 100644
--- 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
@@ -30,7 +30,7 @@ import lombok.NonNull;
import lombok.val;
//@Log4j2
-abstract class InternalBidirectionalBinding<T>
+abstract class InternalBidirectionalBinding<T>
implements ChangeListener<T>, InternalUtil.WeakListener {
public static <T> InternalBidirectionalBinding<T> bind(Bindable<T> left, Bindable<T> right) {
@@ -64,7 +64,7 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
protected abstract Object getRight();
-
+
@Override
public int hashCode() {
return cachedHash;
@@ -104,15 +104,15 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
}
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) {
@@ -148,7 +148,7 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
}
val left = getLeft();
val right = getRight();
-
+
if ((left == null) || (right == null)) {
if (left != null) {
left.removeListener(this);
@@ -158,7 +158,7 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
}
return;
}
-
+
try {
updating = true;
if (left == observable) {
@@ -181,7 +181,7 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
+ "Observable to the previous value. "
+ "Removing the bidirectional binding from bindables %s and %s",
""+left,
- ""+right,
+ ""+right,
e2);
}
throw _Exceptions.unrecoverable(
@@ -189,7 +189,7 @@ implements ChangeListener<T>, InternalUtil.WeakListener {
} finally {
updating = false;
}
-
+
}
}
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
index 722e9ff..e4e253d 100644
--- 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
@@ -31,13 +31,13 @@ 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;
@@ -62,7 +62,7 @@ abstract class InternalUtil<T> {
}
}
-
+
final static class WeakInvalidationListener implements InvalidationListener, WeakListener {
private final WeakReference<InvalidationListener> ref;
@@ -86,42 +86,42 @@ abstract class InternalUtil<T> {
}
}
}
-
+
// -- LISTENER ADD/REMOVE
static <T> InternalUtil<T> addListener(
- @Nullable final InternalUtil<T> helper,
- @NonNull final Observable<T> observable,
+ @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)
+ ? new SingleInvalidation<T>(observable, listener)
: helper.addListener(listener);
}
static <T> InternalUtil<T> removeListener(
- @Nullable final InternalUtil<T> helper,
+ @Nullable final InternalUtil<T> helper,
@NonNull final InvalidationListener listener) {
return (helper == null)
- ? null
+ ? null
: helper.removeListener(listener);
}
static <T> InternalUtil<T> addListener(
- @Nullable final InternalUtil<T> helper,
- @NonNull final Observable<T> observable,
+ @Nullable final InternalUtil<T> helper,
+ @NonNull final Observable<T> observable,
@NonNull final ChangeListener<? super T> listener) {
return (helper == null)
- ? new SingleChange<T>(observable, listener)
+ ? new SingleChange<T>(observable, listener)
: helper.addListener(listener);
}
static <T> InternalUtil<T> removeListener(
- @Nullable final InternalUtil<T> helper,
+ @Nullable final InternalUtil<T> helper,
@NonNull ChangeListener<? super T> listener) {
return (helper == null)
- ? null
+ ? null
: helper.removeListener(listener);
}
@@ -421,9 +421,9 @@ abstract class InternalUtil<T> {
}
}
}
-
+
private static int trimListeners(int size, Object[] listeners) {
- Predicate<Object> p = t -> t instanceof WeakListener
+ Predicate<Object> p = t -> t instanceof WeakListener
&& ((WeakListener)t).isNoLongerReferenced();
int index = 0;
for (; index < size; index++) {
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
index abb503d..2351bbb 100644
--- 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
@@ -31,7 +31,7 @@ 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!
@@ -73,7 +73,7 @@ public abstract class _BindableAbstract<T> implements Bindable<T> {
public void removeListener(ChangeListener<? super T> listener) {
util = InternalUtil.removeListener(util, listener);
}
-
+
@Override
public void bindBidirectional(Bindable<T> other) {
InternalBidirectionalBinding.bind(this, other);
@@ -87,8 +87,8 @@ public abstract class _BindableAbstract<T> implements Bindable<T> {
@Override
public T getValue() {
valid = true;
- return observable == null
- ? value
+ return observable == null
+ ? value
: observable.getValue();
}
@@ -129,16 +129,16 @@ public abstract class _BindableAbstract<T> implements Bindable<T> {
observable = null;
}
}
-
+
protected void fireValueChanged() {
InternalUtil.fireValueChanged(util);
}
protected void onInvalidated() {
}
-
+
// -- HELPER
-
+
private void markInvalid() {
if (valid) {
valid = false;
@@ -147,7 +147,7 @@ public abstract class _BindableAbstract<T> implements Bindable<T> {
}
}
- private static class WeakInvalidationListener
+ private static class WeakInvalidationListener
implements InvalidationListener, InternalUtil.WeakListener {
private final WeakReference<_BindableAbstract<?>> wref;
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
index 2086ac2..74df5d7 100644
--- 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
@@ -22,7 +22,7 @@ import lombok.val;
/**
* <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!
@@ -33,15 +33,15 @@ import lombok.val;
public class _Bindables {
private static class SimpleBindable<T> extends _BindableAbstract<T> {}
-
+
public static <T> _BindableAbstract<T> empty() {
return new SimpleBindable<T>();
}
-
+
public static <T> _BindableAbstract<T> forValue(T initialValue) {
val bindable = new SimpleBindable<T>();
bindable.setValue(initialValue);
return bindable;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/binding/_Observables.java b/commons/src/main/java/org/apache/isis/commons/internal/binding/_Observables.java
index 8a1a458..bbcb9b0 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/binding/_Observables.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/binding/_Observables.java
@@ -26,7 +26,7 @@ import lombok.val;
/**
* <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!
@@ -39,26 +39,26 @@ public class _Observables {
public static class LazyObservable<T> extends _BindableAbstract<T> {
private final _Lazy<T> lazyValue;
-
+
public LazyObservable(Supplier<T> factory) {
this.lazyValue = _Lazy.threadSafe(factory);
}
-
+
@Override
public T getValue() {
return lazyValue.get();
}
-
+
public void invalidate() {
lazyValue.clear();
super.fireValueChanged();
}
-
+
}
-
+
public static <T> LazyObservable<T> forFactory(Supplier<T> factory) {
val bindable = new LazyObservable<T>(factory);
return bindable;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/codec/_DocumentFactories.java b/commons/src/main/java/org/apache/isis/commons/internal/codec/_DocumentFactories.java
index 6c96e8e..a733da0 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/codec/_DocumentFactories.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/codec/_DocumentFactories.java
@@ -32,11 +32,11 @@ import lombok.experimental.UtilityClass;
/**
* <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!
- *
+ *
* @see <a href="https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html">cheatsheetseries.owasp.org</a>
*
* @since 2.0
@@ -50,32 +50,32 @@ public class _DocumentFactories {
df.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); // XML parsers should not be vulnerable to XXE attacks
return df;
}
-
+
public static DocumentBuilder documentBuilder() throws ParserConfigurationException {
return documentBuilderFactory().newDocumentBuilder();
}
-
+
public static TransformerFactory transformerFactory() {
val tf = TransformerFactory.newInstance();
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); // XML transformers should be secured
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); // XML transformers should be secured
return tf;
}
-
+
public static Transformer transformer() throws TransformerConfigurationException {
return transformerFactory().newTransformer();
}
-
+
public static XMLInputFactory xmlInputFactory() {
val xmlInputFactory = XMLInputFactory.newInstance();
-
+
// disables DTDs entirely
xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
// disable external entities
xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
-
+
return xmlInputFactory;
}
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/codec/_UrlDecoderUtil.java b/commons/src/main/java/org/apache/isis/commons/internal/codec/_UrlDecoderUtil.java
index 83d41ce..ea0c462 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/codec/_UrlDecoderUtil.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/codec/_UrlDecoderUtil.java
@@ -25,7 +25,7 @@ import lombok.experimental.UtilityClass;
/**
* <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!
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Arrays.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Arrays.java
index 589f400..57da64e 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Arrays.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Arrays.java
@@ -56,19 +56,19 @@ public final class _Arrays {
// -- PREDICATES
/**
- * Whether given {@code test} predicate evaluates 'true' for any given pair of elements
- * {@code array1[index]} and {@code array2[index]}, with {@code index=[0..n-1]} and {@code n}
- * the number of elements of {@code array1/2}.
+ * Whether given {@code test} predicate evaluates 'true' for any given pair of elements
+ * {@code array1[index]} and {@code array2[index]}, with {@code index=[0..n-1]} and {@code n}
+ * the number of elements of {@code array1/2}.
* @param array1 - nullable
* @param array2 - nullable
* @param test - a predicate
- * @return whether there is any matching pair; false - if array1 and array2 are both empty
- * @throws IllegalArgumentException - if array lengths do not match
+ * @return whether there is any matching pair; false - if array1 and array2 are both empty
+ * @throws IllegalArgumentException - if array lengths do not match
* @throws NullPointerException - if {@code test} is null
*/
public static <T> boolean testAnyMatch(
- @Nullable final T[] array1,
- @Nullable final T[] array2,
+ @Nullable final T[] array1,
+ @Nullable final T[] array2,
final BiPredicate<T, T> test) {
final int s1 = _NullSafe.size(array1);
@@ -91,19 +91,19 @@ public final class _Arrays {
/**
- * Whether given {@code test} predicate evaluates 'true' for all given pairs of elements
- * {@code array1[index]} and {@code array2[index]}, with {@code index=[0..n-1]} and {@code n}
- * the number of elements of {@code array1/2}.
+ * Whether given {@code test} predicate evaluates 'true' for all given pairs of elements
+ * {@code array1[index]} and {@code array2[index]}, with {@code index=[0..n-1]} and {@code n}
+ * the number of elements of {@code array1/2}.
* @param array1 - nullable
* @param array2 - nullable
* @param test - a predicate
- * @return whether all pairs match; true - if array1 and array2 are both empty
- * @throws IllegalArgumentException - if array lengths do not match
+ * @return whether all pairs match; true - if array1 and array2 are both empty
+ * @throws IllegalArgumentException - if array lengths do not match
* @throws NullPointerException - if {@code test} is null
*/
public static <T> boolean testAllMatch(
- @Nullable final T[] array1,
- @Nullable final T[] array2,
+ @Nullable final T[] array1,
+ @Nullable final T[] array2,
final BiPredicate<T, T> test) {
_With.requires(test, "test");
return !testAnyMatch(array1, array2, test.negate());
@@ -171,7 +171,7 @@ public final class _Arrays {
}
return all;
}
-
+
/**
* Returns a new array containing all components {first, *rest}
* @param type (non-null) explicit array element type
@@ -223,7 +223,7 @@ public final class _Arrays {
* have been copied (non-null)
*/
public static <T> T[] toArray(
- final @Nullable Collection<? extends T> collection,
+ final @Nullable Collection<? extends T> collection,
final @NonNull Class<T> componentType) {
return _NullSafe.stream(collection)
.collect(toArray(componentType, collection!=null ? collection.size() : 0));
@@ -238,21 +238,21 @@ public final class _Arrays {
* have been copied (non-null)
*/
public static <T> T[] toArray(
- final @Nullable Iterable<? extends T> iterable,
+ final @Nullable Iterable<? extends T> iterable,
final @NonNull Class<T> componentType) {
-// unnecessary optimization
+// unnecessary optimization
// if(iterable!=null && (iterable instanceof Collection)) {
// return toArray((Collection<? extends T>) iterable, componentType);
// }
return _NullSafe.stream(iterable)
.collect(toArray(componentType));
}
-
+
// -- MODIFICATION
-
+
/**
- * Returns a new array of size {@code array.length - 1} with the element at {@code array[index]} removed.
- *
+ * Returns a new array of size {@code array.length - 1} with the element at {@code array[index]} removed.
+ *
* @param <T>
* @param array
* @param index
@@ -266,17 +266,17 @@ public final class _Arrays {
throw new IllegalArgumentException(msg);
}
final T[] result = Arrays.copyOf(array, array.length - 1);
- // copy the elements from index + 1 till end
- // from original array to the new array
+ // copy the elements from index + 1 till end
+ // from original array to the new array
val remaining = result.length - index;
System.arraycopy(array, index+1, result, index, remaining);
return result;
}
-
+
/**
- * Returns {@code null} if given {@code array} is {@code null} or of length zero,
+ * Returns {@code null} if given {@code array} is {@code null} or of length zero,
* returns given {@code array} otherwise.
- *
+ *
* @param <T>
* @param array
* @return null for empty arrays
@@ -287,7 +287,7 @@ public final class _Arrays {
}
return array;
}
-
+
/**
* Returns a sub-array of given array. The
* sub-array begins at the specified {@code beginIndex} and
@@ -297,7 +297,7 @@ public final class _Arrays {
* @param array
* @param beginIndex the beginning index, inclusive.
* @param endIndex the ending index, exclusive.
- * @return the specified sub-array, which always is a copy
+ * @return the specified sub-array, which always is a copy
* @exception IndexOutOfBoundsException if the
* {@code beginIndex} is negative, or
* {@code endIndex} is larger than the length of
@@ -318,9 +318,9 @@ public final class _Arrays {
}
return Arrays.copyOfRange(array, beginIndex, endIndex);
}
-
-
-
+
+
+
// -- COMPONENT TYPE INFERENCE
/**
@@ -335,7 +335,7 @@ public final class _Arrays {
}
return Optional.ofNullable(arrayType.getComponentType());
}
-
+
// -- ACCESSOR
/**
@@ -358,12 +358,12 @@ public final class _Arrays {
}
// -- TRANSFORMATION
-
+
/**
- * Transforms given {@code array} into a new array of {@code resultElementType} and same size,
- * applying the {@code mapper} function
- * to each element of {@code array}.
- * Returns {@code null} if {@code array} is {@code null};
+ * Transforms given {@code array} into a new array of {@code resultElementType} and same size,
+ * applying the {@code mapper} function
+ * to each element of {@code array}.
+ * Returns {@code null} if {@code array} is {@code null};
* @param <T>
* @param <R>
* @param array
@@ -373,10 +373,10 @@ public final class _Arrays {
*/
@Nullable
public static <T, R> R[] map(
- @Nullable T[] array,
- @NonNull Class<R> resultElementType,
+ @Nullable T[] array,
+ @NonNull Class<R> resultElementType,
@NonNull Function<T, R> mapper) {
-
+
if (array == null) {
return null;
}
@@ -388,12 +388,12 @@ public final class _Arrays {
}
return mappedArray;
}
-
+
/**
- * Transforms given {@code array} into a new object array of same size,
- * applying the {@code mapper} function
- * to each element of {@code array}.
- * Returns {@code null} if {@code array} is {@code null};
+ * Transforms given {@code array} into a new object array of same size,
+ * applying the {@code mapper} function
+ * to each element of {@code array}.
+ * Returns {@code null} if {@code array} is {@code null};
* @param <T>
* @param array
* @param mapper
@@ -401,9 +401,9 @@ public final class _Arrays {
*/
@Nullable
public static <T> Object[] map(
- @Nullable T[] array,
+ @Nullable T[] array,
@NonNull Function<T, ?> mapper) {
-
+
if (array == null) {
return null;
}
@@ -414,12 +414,12 @@ public final class _Arrays {
}
return mappedArray;
}
-
+
/**
- * Transforms given {@code collection} into an array of {@code resultElementType} and same size,
- * applying the {@code mapper} function
- * to each element of {@code collection}.
- * Returns {@code null} if {@code collection} is {@code null};
+ * Transforms given {@code collection} into an array of {@code resultElementType} and same size,
+ * applying the {@code mapper} function
+ * to each element of {@code collection}.
+ * Returns {@code null} if {@code collection} is {@code null};
* @param <T>
* @param <R>
* @param collection
@@ -429,10 +429,10 @@ public final class _Arrays {
*/
@Nullable
public static <T, R> R[] mapCollection(
- @Nullable Collection<T> collection,
- @NonNull Class<R> resultElementType,
+ @Nullable Collection<T> collection,
+ @NonNull Class<R> resultElementType,
@NonNull Function<T, R> mapper) {
-
+
if (collection == null) {
return null;
}
@@ -444,12 +444,12 @@ public final class _Arrays {
}
return mappedArray;
}
-
+
/**
- * Transforms given {@code collection} into an object array of same size,
- * applying the {@code mapper} function
- * to each element of {@code collection}.
- * Returns {@code null} if {@code collection} is {@code null};
+ * Transforms given {@code collection} into an object array of same size,
+ * applying the {@code mapper} function
+ * to each element of {@code collection}.
+ * Returns {@code null} if {@code collection} is {@code null};
* @param <T>
* @param collection
* @param mapper
@@ -457,9 +457,9 @@ public final class _Arrays {
*/
@Nullable
public static <T> Object[] mapCollection(
- @Nullable Collection<T> collection,
+ @Nullable Collection<T> collection,
@NonNull Function<T, ?> mapper) {
-
+
if (collection == null) {
return null;
}
@@ -470,7 +470,7 @@ public final class _Arrays {
}
return mappedArray;
}
-
+
// --
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Collections.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Collections.java
index de050bd..54879dc 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Collections.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Collections.java
@@ -94,7 +94,7 @@ public final class _Collections {
* or represents an array or is of type {@link Can}
*/
public static boolean isCollectionOrArrayOrCanType(final Class<?> cls) {
- return _Collections.isCollectionType(cls)
+ return _Collections.isCollectionType(cls)
|| _Arrays.isArrayType(cls)
|| Can.class.isAssignableFrom(cls);
}
@@ -280,47 +280,47 @@ public final class _Collections {
*/
public static Optional<Class<?>> inferElementType(final @NonNull Parameter param) {
val parameterType = param.getType();
-
- if (_Collections.isCollectionType(parameterType)
+
+ if (_Collections.isCollectionType(parameterType)
|| _Collections.isCanType(parameterType)) {
-
+
return _Generics.streamGenericTypeArgumentsOfParameter(param)
.findFirst();
}
return Optional.empty();
}
-
+
/**
- * Optionally returns the inferred element type for given {@code method}'s return type,
+ * Optionally returns the inferred element type for given {@code method}'s return type,
* based on whether
* it represents a collection and inference is possible.
*/
public static Optional<Class<?>> inferElementType(final @NonNull Method method) {
-
+
val returnType = method.getReturnType();
-
- if (_Collections.isCollectionType(returnType)
+
+ if (_Collections.isCollectionType(returnType)
|| _Collections.isCanType(returnType)) {
-
+
return _Generics.streamGenericTypeArgumentsOfMethodReturnType(method)
.findFirst();
}
return Optional.empty();
}
-
+
/**
* Optionally returns the inferred element type for given {@code field}, based on whether
* it represents a collection and inference is possible.
*/
public static Optional<Class<?>> inferElementType(final @NonNull Field field) {
-
+
val fieldType = field.getType();
-
- if (_Collections.isCollectionType(fieldType)
+
+ if (_Collections.isCollectionType(fieldType)
|| _Collections.isCanType(fieldType)) {
-
+
return _Generics.streamGenericTypeArgumentsOfField(field)
.findFirst();
}
@@ -331,7 +331,7 @@ public final class _Collections {
// -- TO STRING
public static String toStringJoining(
- final @Nullable Collection<?> collection,
+ final @Nullable Collection<?> collection,
final @NonNull String delimiter) {
return _NullSafe.stream(collection)
.map(x->""+x)
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Inbox.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Inbox.java
index cdbc8dd..5d94cbd 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Inbox.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Inbox.java
@@ -27,7 +27,7 @@ import org.apache.isis.commons.collections.Can;
import lombok.val;
/**
- * Allows for thread-safe producer consumer pattern backed by {@link ArrayList}.
+ * Allows for thread-safe producer consumer pattern backed by {@link ArrayList}.
*
* @param <T>
*/
@@ -68,19 +68,19 @@ public class _Inbox<T> implements Serializable {
public boolean isEmpty() {
synchronized($lock) {
return list.isEmpty();
- }
+ }
}
public void clear() {
synchronized($lock) {
list.clear();
- }
+ }
}
public int size() {
synchronized($lock) {
return list.size();
- }
+ }
}
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Lists.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Lists.java
index 3d08f03..726c8c4 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Lists.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Lists.java
@@ -117,7 +117,7 @@ public final class _Lists {
public static <T> ArrayList<T> newArrayList() {
return new ArrayList<T>();
}
-
+
public static <T> ArrayList<T> newArrayList(final int initialSize) {
return new ArrayList<T>(initialSize);
}
@@ -184,18 +184,18 @@ public final class _Lists {
.filter(filter)
.collect(Collectors.toList());
}
-
+
// -- COLLECTORS
- public static <T>
+ public static <T>
Collector<T, ?, List<T>> toUnmodifiable(Supplier<List<T>> collectionFactory) {
-
+
return Collectors.collectingAndThen(
- Collectors.toCollection(collectionFactory),
+ Collectors.toCollection(collectionFactory),
Collections::unmodifiableList);
}
-
- public static <T>
+
+ public static <T>
Collector<T, ?, List<T>> toUnmodifiable() {
return toUnmodifiable(ArrayList::new);
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Maps.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Maps.java
index 6c1eaf8..8dbd5c2 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Maps.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Maps.java
@@ -62,7 +62,7 @@ import lombok.val;
public final class _Maps {
private _Maps(){}
-
+
/**
* A Map that supports value lookup by key and <em>alias</em> keys.
* <p>
@@ -73,7 +73,7 @@ public final class _Maps {
public static interface AliasMap<K, V> extends Map<K, V> {
/**
- *
+ *
* @param key
* @param aliases
* @param value
@@ -88,7 +88,7 @@ public final class _Maps {
* @param value
*/
public V remap(K key, Can<K> aliases, V value);
-
+
}
// -- UNMODIFIABLE MAP
@@ -143,11 +143,11 @@ public final class _Maps {
}
// -- TO STRING
-
+
public static String toString(
- final @Nullable Map<?, ?> map,
+ final @Nullable Map<?, ?> map,
final @NonNull CharSequence delimiter) {
-
+
return map==null
? ""
: map.entrySet()
@@ -155,13 +155,13 @@ public final class _Maps {
.map(Object::toString)
.collect(Collectors.joining(delimiter));
}
-
+
// -- MODIFICATIONS
/**
- * For a given {@code map} either adds or removes the specified {@code key} based on whether
+ * For a given {@code map} either adds or removes the specified {@code key} based on whether
* the map contains the {@code key}.
- * If this is an add operation, then given {@code value} is associated with the {@code key}.
+ * If this is an add operation, then given {@code value} is associated with the {@code key}.
* @param <K>
* @param <V>
* @param map
@@ -170,36 +170,36 @@ public final class _Maps {
* @return whether given map contains the {@code key} after the operation
*/
public static <K, V> boolean toggleElement(
- @NonNull Map<K, V> map,
- @NonNull K key,
+ @NonNull Map<K, V> map,
+ @NonNull K key,
@NonNull V value) {
-
+
val newValue = map.compute(key, (k, v) -> (v==null) ? value : null);
return newValue!=null;
}
-
+
// -- TRANSFORMATIONS
-
+
public static <K, V0, V1> Map<K, V1> mapValues(
@Nullable Map<K, V0> input,
@NonNull Supplier<Map<K, V1>> mapFactory,
@NonNull Function<V0, V1> valueMapper) {
-
+
val resultMap = mapFactory.get();
-
+
if(input==null
|| input.isEmpty()) {
return resultMap;
}
-
+
input.forEach((k, v)->resultMap.put(k, valueMapper.apply(v)));
return resultMap;
}
-
-
+
+
public static <K, V> Map<K, V> filterKeys(
@Nullable Map<K, V> input,
- Predicate<K> keyFilter,
+ Predicate<K> keyFilter,
Supplier<Map<K, V>> factory) {
_With.requires(factory, "factory");
@@ -221,16 +221,16 @@ public final class _Maps {
}
public static <K, V> ListMultimap<V, K> invertToListMultimap(Map<K, V> input) {
- final ListMultimap<V, K> result = _Multimaps.newListMultimap();
+ final ListMultimap<V, K> result = _Multimaps.newListMultimap();
if(input==null) {
return result;
}
- input.forEach((k, v)->result.putElement(v, k));
+ input.forEach((k, v)->result.putElement(v, k));
return result;
}
// -- FACTORIES ...
-
+
// -- HASH MAP
public static <K, V> HashMap<K, V> newHashMap() {
@@ -258,18 +258,18 @@ public final class _Maps {
public static <K, V> TreeMap<K, V> newTreeMap(Comparator<? super K> comparator) {
return new TreeMap<K, V>(comparator);
}
-
+
// -- ALIAS MAP
-
- @Value(staticConstructor = "of")
+
+ @Value(staticConstructor = "of")
private static final class KeyPair<K> {
K key;
Can<K> aliasKeys;
}
-
+
public static <K, V> AliasMap<K, V> newAliasMap(
final Supplier<Map<K, V>> mapFactory){
-
+
_With.requires(mapFactory, "mapFactory");
return new AliasMap<K, V>() {
@@ -282,37 +282,37 @@ public final class _Maps {
@Override public Set<K> keySet() { return delegate.keySet(); }
@Override public Collection<V> values() { return delegate.values(); }
@Override public Set<Entry<K, V>> entrySet() { return delegate.entrySet(); }
-
- @Override
- public V put(K key, V value) {
- return this.put(key, Can.empty(), value);
+
+ @Override
+ public V put(K key, V value) {
+ return this.put(key, Can.empty(), value);
}
-
- @Override
- public void putAll(Map<? extends K, ? extends V> other) {
+
+ @Override
+ public void putAll(Map<? extends K, ? extends V> other) {
if(!_NullSafe.isEmpty(other)) {
- other.forEach((k, v)->this.put(k, v));
+ other.forEach((k, v)->this.put(k, v));
}
}
-
+
@Override
public V put(K key, Can<K> aliases, V value) {
putAliasKeys(key, aliases, /*re-map*/ false);
return delegate.put(key, value);
}
-
+
@Override
public V remap(K key, Can<K> aliases, V value) {
putAliasKeys(key, aliases, /*re-map*/ true);
return delegate.put(key, value);
}
-
+
@Override
public boolean containsKey(Object keyOrAliasKey) {
return delegate.containsKey(keyOrAliasKey) ||
containsAliasKey(keyOrAliasKey);
}
-
+
@Override
public V get(Object keyOrAliasKey) {
@@ -322,43 +322,43 @@ public final class _Maps {
}
return getByAliasKey(keyOrAliasKey);
}
-
- @Override
- public V remove(Object key) {
+
+ @Override
+ public V remove(Object key) {
removeAliasKeysOf(key);
- return delegate.remove(key);
+ return delegate.remove(key);
}
-
- @Override
+
+ @Override
public void clear() {
- delegate.clear();
+ delegate.clear();
clearAliasKeys();
}
-
+
// -- HELPER
-
+
private final Map<K, KeyPair<K>> pairByAliasKey = _Maps.newHashMap();
-
+
private void putAliasKeys(K key, Can<K> aliasKeys, boolean remap) {
if(aliasKeys.isNotEmpty()) {
val keyPair = KeyPair.of(key, aliasKeys);
for(val aliasKey : aliasKeys) {
-
+
val existingKeyPair = pairByAliasKey.put(aliasKey, keyPair);
if(existingKeyPair!=null && !remap) {
-
+
throw _Exceptions.illegalArgument(
- "alias key collision on alias %s: existing-key=%s, new-key=%s",
+ "alias key collision on alias %s: existing-key=%s, new-key=%s",
aliasKey, existingKeyPair.key, keyPair.key);
}
}
}
}
-
+
private V getByAliasKey(Object aliasKey) {
val keyPair = pairByAliasKey.get(aliasKey);
if(keyPair!=null) {
- return delegate.get(keyPair.getKey());
+ return delegate.get(keyPair.getKey());
}
return null;
}
@@ -366,7 +366,7 @@ public final class _Maps {
private boolean containsAliasKey(Object aliasKey) {
return pairByAliasKey.containsKey(aliasKey);
}
-
+
private void removeAliasKeysOf(final Object key) {
//XXX this implementation is slow for large alias maps, since we traverse the entire map
pairByAliasKey.entrySet()
@@ -374,13 +374,13 @@ public final class _Maps {
val keyPair = entry.getValue();
return keyPair.getKey().equals(key);
});
-
+
}
-
+
private void clearAliasKeys() {
pairByAliasKey.clear();
}
-
+
};
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Multimaps.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Multimaps.java
index b86f097..ceff2dc 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Multimaps.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Multimaps.java
@@ -71,30 +71,30 @@ public class _Multimaps {
* @param value
*/
public void putElement(K key, V value);
-
+
/**
* Returns the List to which the specified key is mapped,
* or a new List if this map contains no mapping for the key.
- * <p> In the latter case the List is also put onto this map.
+ * <p> In the latter case the List is also put onto this map.
* @param key
*/
public List<V> getOrElseNew(K key);
-
+
/**
* Returns the List to which the specified key is mapped,
* or an immutable empty List if this map contains no mapping for the key.
- * <p> In the latter case the List is not put onto this map.
+ * <p> In the latter case the List is not put onto this map.
* @param key
*/
default public List<V> getOrElseEmpty(K key) {
return getOrDefault(key, Collections.emptyList());
}
-
+
default public Stream<V> streamElements() {
return values().stream()
.flatMap(Collection::stream);
}
-
+
}
/**
@@ -110,25 +110,25 @@ public class _Multimaps {
* @param value
*/
public void putElement(K key, V value);
-
+
/**
* Returns the Set to which the specified key is mapped,
* or a new Set if this map contains no mapping for the key.
- * <p> In the latter case the Set is also put onto this map.
+ * <p> In the latter case the Set is also put onto this map.
* @param key
*/
public Set<V> getOrElseNew(K key);
-
+
/**
* Returns the Set to which the specified key is mapped,
* or an immutable empty Set if this map contains no mapping for the key.
- * <p> In the latter case the Set is not put onto this map.
+ * <p> In the latter case the Set is not put onto this map.
* @param key
*/
default public Set<V> getOrElseEmpty(K key) {
return getOrDefault(key, Collections.emptySet());
}
-
+
default public Stream<V> streamElements() {
return values().stream()
.flatMap(Collection::stream);
@@ -159,25 +159,25 @@ public class _Multimaps {
* @return null if no such element exists
*/
public V getElement(K1 key, K2 subkey);
-
+
/**
* Returns the Map to which the specified key is mapped,
* or a new Map if this map contains no mapping for the key.
- * <p> In the latter case the Map is also put onto this map.
+ * <p> In the latter case the Map is also put onto this map.
* @param key
*/
public Map<K2, V> getOrElseNew(K1 key);
-
+
/**
* Returns the Map to which the specified key is mapped,
* or an immutable empty Map if this map contains no mapping for the key.
- * <p> In the latter case the Map not is put onto this map.
+ * <p> In the latter case the Map not is put onto this map.
* @param key
*/
default public Map<K2, V> getOrElseEmpty(K1 key) {
return getOrDefault(key, Collections.emptyMap());
}
-
+
default public Stream<V> streamElements() {
return values().stream()
.map(Map::values)
@@ -188,7 +188,7 @@ public class _Multimaps {
public static <K, V> ListMultimap<K, V> newListMultimap(
final Supplier<Map<K, List<V>>> mapFactory,
final Supplier<List<V>> elementCollectionFactory){
-
+
_With.requires(mapFactory, "mapFactory");
_With.requires(elementCollectionFactory, "elementCollectionFactory");
@@ -213,7 +213,7 @@ public class _Multimaps {
public void putElement(K key, V value) {
getOrElseNew(key).add(value);
}
-
+
@Override
public List<V> getOrElseNew(K key) {
val collection = delegate.computeIfAbsent(key, __->elementCollectionFactory.get());
@@ -226,7 +226,7 @@ public class _Multimaps {
public static <K, V, S extends Set<V>> SetMultimap<K, V> newSetMultimap(
final Supplier<? extends Map<K, S>> mapFactory,
final Supplier<S> elementCollectionFactory){
-
+
_With.requires(mapFactory, "mapFactory");
_With.requires(elementCollectionFactory, "elementCollectionFactory");
@@ -251,7 +251,7 @@ public class _Multimaps {
public void putElement(K key, V value) {
getOrElseNew(key).add(value);
}
-
+
@Override
public Set<V> getOrElseNew(K key) {
val collection = delegate.computeIfAbsent(key, __->elementCollectionFactory.get());
@@ -264,7 +264,7 @@ public class _Multimaps {
public static <K1, K2, V> MapMultimap<K1, K2, V> newMapMultimap(
final Supplier<Map<K1, Map<K2, V>>> mapFactory,
final Supplier<Map<K2, V>> elementMapFactory){
-
+
_With.requires(mapFactory, "mapFactory");
_With.requires(elementMapFactory, "elementMapFactory");
@@ -295,7 +295,7 @@ public class _Multimaps {
final Map<K2, V> elementMap = delegate.get(key);
return elementMap!=null ? elementMap.get(subkey) : null;
}
-
+
@Override
public Map<K2, V> getOrElseNew(K1 key) {
val elementMap = delegate.computeIfAbsent(key, __->elementMapFactory.get());
@@ -306,22 +306,22 @@ public class _Multimaps {
}
// -- SHORTCUTS
-
+
/**
* @return HashMap of Lists with given listFactory
*/
public static <K, V> ListMultimap<K, V> newListMultimap(Supplier<List<V>> listFactory){
return newListMultimap(HashMap<K, List<V>>::new, listFactory);
}
-
+
/**
- *
+ *
* @return HashMap of Sets with given setFactory
*/
public static <K, V> SetMultimap<K, V> newSetMultimap(Supplier<Set<V>> setFactory){
return newSetMultimap(HashMap<K, Set<V>>::new, setFactory);
}
-
+
// -- CONVENIENT DEFAULTS
/**
@@ -330,7 +330,7 @@ public class _Multimaps {
public static <K, V> ListMultimap<K, V> newListMultimap(){
return newListMultimap(HashMap<K, List<V>>::new, ArrayList::new);
}
-
+
/**
* @return ConcurrentHashMap of CopyOnWriteArrayList (fully concurrent)
*/
@@ -344,7 +344,7 @@ public class _Multimaps {
public static <K, V> SetMultimap<K, V> newSetMultimap(){
return newSetMultimap(HashMap<K, Set<V>>::new, HashSet::new);
}
-
+
/**
* @return ConcurrentHashMap of ConcurrentHashMap-key-sets (fully concurrent)
*/
@@ -359,7 +359,7 @@ public class _Multimaps {
* @return TreeMap of TreeSets
*/
public static <K, V> SetMultimap<K, V> newSortedSetMultimap(
- @Nullable Comparator<K> keyComparator,
+ @Nullable Comparator<K> keyComparator,
@Nullable Comparator<V> elementComparator){
final Supplier<SortedMap<K, SortedSet<V>>> mapFactory = ()->new TreeMap<K, SortedSet<V>>(keyComparator);
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Sets.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Sets.java
index 5a12b56..8fb429b 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Sets.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Sets.java
@@ -98,7 +98,7 @@ public final class _Sets {
return Stream.of(elements)
.collect(toUnmodifiable(LinkedHashSet::new)); // preserve order
}
-
+
/**
* Copies all elements into a new unmodifiable SortedSet (of natural order).
* @param elements
@@ -114,7 +114,7 @@ public final class _Sets {
Stream.of(elements)
.collect(Collectors.toCollection(TreeSet::new))); // natural order
}
-
+
/**
* Copies all elements from iterable into a new unmodifiable Set preserving iteration order.
@@ -247,7 +247,7 @@ public final class _Sets {
}
/**
- * Returns the intersection (set theory) of two given (sorted) sets,
+ * Returns the intersection (set theory) of two given (sorted) sets,
* retaining order only when natural order.
* Any {@code null} elements are ignored and will not be contained in the resulting set.
* @param a
@@ -266,48 +266,48 @@ public final class _Sets {
.filter(b::contains)
.collect(toUnmodifiableSorted());
}
-
+
/**
- * Returns a new set containing all the elements of {@code a} that are not in {@code b},
- * not retaining any order.
+ * Returns a new set containing all the elements of {@code a} that are not in {@code b},
+ * not retaining any order.
* Any {@code null} elements are ignored and will not be contained in the resulting set.
* @param <T>
* @param a
* @param b
- * @return {@code a - b}, non null, unmodifiable
+ * @return {@code a - b}, non null, unmodifiable
*/
public static <T> Set<T> minus(@Nullable Set<T> a, @Nullable Set<T> b) {
return minus(a, b, HashSet::new);
}
-
+
/**
- * Returns a new (sorted) set containing all the elements of {@code a} that are not in {@code b},
- * retaining order only when natural order.
+ * Returns a new (sorted) set containing all the elements of {@code a} that are not in {@code b},
+ * retaining order only when natural order.
* Any {@code null} elements are ignored and will not be contained in the resulting set.
* @param <T>
* @param a
* @param b
- * @return {@code a - b}, non null, unmodifiable
+ * @return {@code a - b}, non null, unmodifiable
*/
public static <T> SortedSet<T> minusSorted(@Nullable SortedSet<T> a, @Nullable SortedSet<T> b) {
return minusSorted(a, b, TreeSet::new);
}
/**
- * Returns a new set containing all the elements of {@code a} that are not in {@code b},
- * not retaining any order.
+ * Returns a new set containing all the elements of {@code a} that are not in {@code b},
+ * not retaining any order.
* Any {@code null} elements are ignored and will not be contained in the resulting set.
* @param <T>
* @param a
* @param b
* @param collectionFactory
- * @return {@code a - b}, non null, unmodifiable
+ * @return {@code a - b}, non null, unmodifiable
*/
public static <T> Set<T> minus(
- @Nullable Set<T> a,
- @Nullable Set<T> b,
+ @Nullable Set<T> a,
+ @Nullable Set<T> b,
@NonNull Supplier<Set<T>> collectionFactory) {
-
+
if(a==null || a.isEmpty()) {
return Collections.emptySet();
}
@@ -321,22 +321,22 @@ public final class _Sets {
.filter(not(b::contains))
.collect(toUnmodifiable(collectionFactory));
}
-
+
/**
- * Returns a new (sorted) set containing all the elements of {@code a} that are not in {@code b},
- * retaining order only when natural order.
+ * Returns a new (sorted) set containing all the elements of {@code a} that are not in {@code b},
+ * retaining order only when natural order.
* Any {@code null} elements are ignored and will not be contained in the resulting set.
* @param <T>
* @param a
* @param b
* @param collectionFactory
- * @return {@code a - b}, non null, unmodifiable
+ * @return {@code a - b}, non null, unmodifiable
*/
public static <T> SortedSet<T> minusSorted(
- @Nullable SortedSet<T> a,
- @Nullable SortedSet<T> b,
+ @Nullable SortedSet<T> a,
+ @Nullable SortedSet<T> b,
@NonNull Supplier<SortedSet<T>> collectionFactory) {
-
+
if(a==null || a.isEmpty()) {
return Collections.emptySortedSet();
}
@@ -350,36 +350,36 @@ public final class _Sets {
.filter(not(b::contains))
.collect(toUnmodifiableSorted());
}
-
+
// -- COLLECTORS
- public static <T>
+ public static <T>
Collector<T, ?, Set<T>> toUnmodifiable(Supplier<Set<T>> collectionFactory) {
return Collectors.collectingAndThen(
Collectors.toCollection(collectionFactory),
Collections::unmodifiableSet);
}
-
- public static <T>
+
+ public static <T>
Collector<T, ?, Set<T>> toUnmodifiable() {
return toUnmodifiable(HashSet::new);
}
-
- public static <T>
+
+ public static <T>
Collector<T, ?, Set<T>> toUnmodifiablePreservingOrder() {
return toUnmodifiable(LinkedHashSet::new);
}
-
- public static <T>
+
+ public static <T>
Collector<T, ?, SortedSet<T>> toUnmodifiableSorted(Supplier<SortedSet<T>> collectionFactory) {
return Collectors.collectingAndThen(
- Collectors.toCollection(collectionFactory),
+ Collectors.toCollection(collectionFactory),
Collections::unmodifiableSortedSet);
}
- public static <T>
+ public static <T>
Collector<T, ?, SortedSet<T>> toUnmodifiableSorted() {
return toUnmodifiableSorted(TreeSet::new);
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Streams.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Streams.java
index 1bd8317..8e565c7 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/_Streams.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/_Streams.java
@@ -51,7 +51,7 @@ public final class _Streams {
*/
public static <T> Stream<T> concat(
Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d) {
-
+
return Stream.concat(Stream.concat(a, b), Stream.concat(c, d));
}
@@ -59,43 +59,43 @@ public final class _Streams {
* 5 param variant of {@link Stream#concat(Stream, Stream)}
*/
public static <T> Stream<T> concat(
- Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
+ Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
Stream<? extends T> e) {
return Stream.concat(
Stream.concat(Stream.concat(a, b), Stream.concat(c, d)),
e);
}
-
+
/**
* 6 param variant of {@link Stream#concat(Stream, Stream)}
*/
public static <T> Stream<T> concat(
- Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
+ Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
Stream<? extends T> e, Stream<? extends T> f) {
return Stream.concat(
Stream.concat(Stream.concat(a, b), Stream.concat(c, d)),
Stream.concat(e, f));
}
-
+
/**
* 7 param variant of {@link Stream#concat(Stream, Stream)}
*/
public static <T> Stream<T> concat(
- Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
+ Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
Stream<? extends T> e, Stream<? extends T> f, Stream<? extends T> g) {
return Stream.concat(
Stream.concat(Stream.concat(a, b), Stream.concat(c, d)),
Stream.concat(Stream.concat(e, f), g));
}
-
+
/**
* 8 param variant of {@link Stream#concat(Stream, Stream)}
*/
public static <T> Stream<T> concat(
- Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
+ Stream<? extends T> a, Stream<? extends T> b, Stream<? extends T> c, Stream<? extends T> d,
Stream<? extends T> e, Stream<? extends T> f, Stream<? extends T> g, Stream<? extends T> h) {
return Stream.concat(
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/collections/snapshot/_VersionedList.java b/commons/src/main/java/org/apache/isis/commons/internal/collections/snapshot/_VersionedList.java
index 3acf226..b19f9c1 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/collections/snapshot/_VersionedList.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/collections/snapshot/_VersionedList.java
@@ -33,11 +33,11 @@ import lombok.AllArgsConstructor;
import lombok.val;
/**
- * Thread-safe pseudo list, that increments its version each time a snapshot is requested.
+ * Thread-safe pseudo list, that increments its version each time a snapshot is requested.
* <p>
- * This allows to easily keep track of any additions to the list that occurred in between
+ * This allows to easily keep track of any additions to the list that occurred in between
* snapshots.
- *
+ *
* @since 2.0
* @param <T>
*/
@@ -59,12 +59,12 @@ public final class _VersionedList<T> {
public boolean isEmpty() {
return versions.isEmpty();
}
-
+
public Stream<T> stream() {
return versions.stream()
.flatMap(List::stream);
}
-
+
public void forEach(Consumer<T> action) {
for(val ver : versions) {
for(val element : ver) {
@@ -72,7 +72,7 @@ public final class _VersionedList<T> {
}
}
}
-
+
public void forEachParallel(Consumer<T> action) {
for(val ver : versions) {
if(ver.size()>8) {
@@ -84,7 +84,7 @@ public final class _VersionedList<T> {
}
}
}
-
+
}
@@ -152,9 +152,9 @@ public final class _VersionedList<T> {
currentVersion.clear();
}
}
-
+
/**
- * Also handles concurrent additions that occur during traversal.
+ * Also handles concurrent additions that occur during traversal.
* @param action
*/
public void forEach(Consumer<T> action) {
@@ -168,7 +168,7 @@ public final class _VersionedList<T> {
}
/**
- * Also handles concurrent additions that occur during traversal.
+ * Also handles concurrent additions that occur during traversal.
* @param action
*/
public void forEachParallel(Consumer<T> action) {
@@ -180,13 +180,13 @@ public final class _VersionedList<T> {
delta = deltaSince(delta);
}
}
-
+
// -- HELPER
- /**
- * @implNote only call within synchronized block!
+ /**
+ * @implNote only call within synchronized block!
* @param fromIndex low endpoint (inclusive) of the copy
* @param toIndex high endpoint (exclusive) of the copy
*/
@@ -209,7 +209,7 @@ public final class _VersionedList<T> {
private void commit() {
if(!currentVersion.isEmpty()) {
versions.add(currentVersion);
- currentVersion = new ArrayList<>(); // create a new array for others to write to next
+ currentVersion = new ArrayList<>(); // create a new array for others to write to next
}
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/compare/_Comparators_SequenceCompare.java b/commons/src/main/java/org/apache/isis/commons/internal/compare/_Comparators_SequenceCompare.java
index 776b580..343a3e6 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/compare/_Comparators_SequenceCompare.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/compare/_Comparators_SequenceCompare.java
@@ -87,10 +87,10 @@ final class _Comparators_SequenceCompare {
val token2 = components2.nextToken();
int componentCompare = 0;
-
+
val int1 = _Ints.parseInt(token1, 10);
val int2 = _Ints.parseInt(token2, 10);
-
+
if(int1.isPresent() && int2.isPresent()) {
componentCompare = Integer.compare(int1.getAsInt(), int2.getAsInt());
} else {
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentContext.java b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentContext.java
index b74b775..4c8d12b 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentContext.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentContext.java
@@ -25,7 +25,7 @@ import lombok.Builder;
/**
* <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!
@@ -35,15 +35,15 @@ import lombok.Builder;
*/
@Builder
public class _ConcurrentContext {
-
+
@Builder.Default final ExecutorService executorService = null;
@Builder.Default final boolean enableExecutionLogging = true;
-
+
public static _ConcurrentContextBuilder forkJoin() {
return _ConcurrentContext.builder()
.executorService(ForkJoinPool.commonPool());
}
-
+
public static _ConcurrentContextBuilder sequential() {
return _ConcurrentContext.builder();
}
@@ -51,5 +51,5 @@ public class _ConcurrentContext {
public boolean shouldRunSequential() {
return executorService == null;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTask.java b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTask.java
index 6a4a2ac..9c6413e 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTask.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTask.java
@@ -28,7 +28,7 @@ import lombok.val;
/**
* <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!
@@ -37,7 +37,7 @@ import lombok.val;
* @since 2.0
*/
public abstract class _ConcurrentTask<T> implements Runnable {
-
+
public static enum State {
NOT_STARTED,
STARTED,
@@ -46,7 +46,7 @@ public abstract class _ConcurrentTask<T> implements Runnable {
}
public abstract String getName();
-
+
@Getter private State status = State.NOT_STARTED;
@Getter private long startedAtNanos;
@Getter private long completedAtNanos;
@@ -57,14 +57,14 @@ public abstract class _ConcurrentTask<T> implements Runnable {
protected synchronized void preCall() {
if(startedAtNanos>0L) {
val msg = String.format(
- "Cannot start task '%s' again, was already started before",
+ "Cannot start task '%s' again, was already started before",
getName());
throw new IllegalStateException(msg);
}
startedAtNanos = System.nanoTime();
status = State.STARTED;
}
-
+
protected void postCall(T completedWith, Throwable failedWith) {
if(failedWith!=null) {
this.failedAtNanos = System.nanoTime();
@@ -76,12 +76,12 @@ public abstract class _ConcurrentTask<T> implements Runnable {
this.status = State.SUCCEEDED;
}
}
-
+
abstract T innerCall() throws Exception;
-
+
@Override
public final void run() {
-
+
preCall();
try {
val completedWith = innerCall();
@@ -91,22 +91,22 @@ public abstract class _ConcurrentTask<T> implements Runnable {
}
}
-
+
@Override
public String toString() {
return getName();
}
-
+
// -- NAMING
-
+
public _ConcurrentTask<T> withName(String name) {
-
+
_With.requires(name, "name");
-
+
val delegate = this;
-
+
return new _ConcurrentTask<T>() {
-
+
@Override
public T innerCall() throws Exception {
return delegate.innerCall();
@@ -116,19 +116,19 @@ public abstract class _ConcurrentTask<T> implements Runnable {
public String getName() {
return name;
}
-
+
};
-
+
}
-
+
public _ConcurrentTask<T> withName(Supplier<String> nameSupplier) {
-
+
_With.requires(nameSupplier, "nameSupplier");
-
+
val delegate = this;
-
+
return new _ConcurrentTask<T>() {
-
+
@Override
public T innerCall() throws Exception {
return delegate.innerCall();
@@ -138,20 +138,20 @@ public abstract class _ConcurrentTask<T> implements Runnable {
public String getName() {
return nameSupplier.get();
}
-
+
};
-
+
}
-
+
// -- FACTORIES
-
+
public static _ConcurrentTask<Void> of(Runnable runnable) {
-
+
_With.requires(runnable, "runnable");
-
+
return new _ConcurrentTask<Void>() {
-
+
@Override
public Void innerCall() throws Exception {
runnable.run();
@@ -162,16 +162,16 @@ public abstract class _ConcurrentTask<T> implements Runnable {
public String getName() {
return runnable.toString();
}
-
+
};
}
-
+
public static <X> _ConcurrentTask<X> of(Callable<X> callable) {
-
+
_With.requires(callable, "callable");
-
+
return new _ConcurrentTask<X>() {
-
+
@Override
public X innerCall() throws Exception {
return callable.call();
@@ -181,7 +181,7 @@ public abstract class _ConcurrentTask<T> implements Runnable {
public String getName() {
return callable.toString();
}
-
+
};
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTaskList.java b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTaskList.java
index d16584b..423e51d 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTaskList.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ConcurrentTaskList.java
@@ -40,19 +40,19 @@ import lombok.RequiredArgsConstructor;
import lombok.val;
import lombok.extern.log4j.Log4j2;
-@RequiredArgsConstructor(staticName = "named")
+@RequiredArgsConstructor(staticName = "named")
@Log4j2
public class _ConcurrentTaskList {
@Getter private final String name;
-
+
private final List<_ConcurrentTask<?>> tasks = _Lists.newArrayList();
private final AtomicBoolean wasStarted = new AtomicBoolean();
private final CountDownLatch allFinishedLatch = new CountDownLatch(1);
private final AwaitableLatch awaitableLatch = AwaitableLatch.of(allFinishedLatch);
private final LongAdder tasksExecuted = new LongAdder();
private long executionTimeNanos;
-
+
public List<_ConcurrentTask<?>> getTasks() {
return Collections.unmodifiableList(tasks);
}
@@ -62,42 +62,42 @@ public class _ConcurrentTaskList {
public _ConcurrentTaskList addTask(_ConcurrentTask<?> task) {
synchronized (tasks) {
if(wasStarted.get()) {
- val msg = "Tasks already started execution, can no longer modify collection of tasks!";
+ val msg = "Tasks already started execution, can no longer modify collection of tasks!";
throw new IllegalStateException(msg);
}
tasks.add(task);
- }
+ }
return this;
}
public _ConcurrentTaskList addTasks(Collection<? extends _ConcurrentTask<?>> tasks) {
synchronized (this.tasks) {
if(wasStarted.get()) {
- val msg = "Tasks already started execution, can no longer modify collection of tasks!";
+ val msg = "Tasks already started execution, can no longer modify collection of tasks!";
throw new IllegalStateException(msg);
}
this.tasks.addAll(tasks);
}
return this;
}
-
+
// -- EXECUTION
-
+
public _ConcurrentTaskList submit(_ConcurrentContext context) {
-
+
synchronized (tasks) {
if(wasStarted.get()) {
- val msg = "Tasks already started execution, can not start again!";
+ val msg = "Tasks already started execution, can not start again!";
throw new IllegalStateException(msg);
}
wasStarted.set(true);
}
-
+
val t0 = System.nanoTime();
-
+
if(context.shouldRunSequential()) {
for(_ConcurrentTask<?> task : tasks) {
- task.run(); // exceptions are swallowed, to be found in the _ConcurrentTask object
+ task.run(); // exceptions are swallowed, to be found in the _ConcurrentTask object
tasksExecuted.increment();
}
executionTimeNanos = System.nanoTime() - t0;
@@ -105,19 +105,19 @@ public class _ConcurrentTaskList {
allFinishedLatch.countDown();
return this;
}
-
+
// else run with executor ...
-
+
val futures = new ArrayList<Future<?>>(tasks.size());
-
+
for(_ConcurrentTask<?> task : tasks) {
futures.add(context.executorService.submit(task));
}
// now wait for all futures to complete on a separate thread
-
+
val thread = new Thread() {
-
+
@Override
public void run() {
for(Future<?> future : futures) {
@@ -130,42 +130,42 @@ public class _ConcurrentTaskList {
// Restore interrupted state...
Thread.currentThread().interrupt();
}
-
+
}
executionTimeNanos = System.nanoTime() - t0;
-
+
onFinished(context);
allFinishedLatch.countDown();
}
-
+
};
-
+
thread.start();
-
+
return this;
-
+
}
-
+
// -- SYNCHRONICATION
public AwaitableLatch latch() {
return awaitableLatch;
}
-
+
public void await() {
latch().await();
}
-
+
// -- FIELDS/GETTERS
-
+
public Duration getExecutionTime() {
return Duration.of(executionTimeNanos, ChronoUnit.NANOS);
}
-
+
// -- EXECUTION LOGGING
-
+
private void onFinished(_ConcurrentContext context) {
-
+
for(val task: tasks) {
if(task.getFailedWith()!=null) {
log.error("----------------------------------------");
@@ -174,19 +174,19 @@ public class _ConcurrentTaskList {
log.error("----------------------------------------", task.getFailedWith());
}
}
-
+
if(!context.enableExecutionLogging) {
return;
}
-
- log.printf(Level.INFO,
+
+ log.printf(Level.INFO,
"TaskList '%s' running %d/%d tasks %s, took %.3f milliseconds ",
getName(),
tasksExecuted.longValue(),
tasks.size(),
context.shouldRunSequential() ? "sequential" : "concurrent",
- 0.000_001 * executionTimeNanos);
-
+ 0.000_001 * executionTimeNanos);
+
}
// -- SHORTCUTS
@@ -194,10 +194,10 @@ public class _ConcurrentTaskList {
public _ConcurrentTaskList addRunnable(String name, Runnable runnable) {
return addTask(_ConcurrentTask.of(runnable).withName(name));
}
-
+
public _ConcurrentTaskList submit(_ConcurrentContext._ConcurrentContextBuilder contextBuilder) {
return submit(contextBuilder.build());
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ThreadSleep.java b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ThreadSleep.java
index 998e7c8..6c88d58 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ThreadSleep.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/concurrent/_ThreadSleep.java
@@ -23,9 +23,9 @@ import lombok.extern.log4j.Log4j2;
/**
* <h1>- internal use only -</h1>
- *
+ *
* Suspends the current thread for given time duration.
- *
+ *
* <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!
@@ -42,7 +42,7 @@ public class _ThreadSleep {
* @param millis
*/
public static void millis(long millis) {
-
+
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
@@ -50,7 +50,7 @@ public class _ThreadSleep {
// Restore interrupted state...
Thread.currentThread().interrupt();
}
-
+
}
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java b/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
index 9a12043..6f180a9 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
@@ -149,7 +149,7 @@ public final class _Context {
final T existingIfAny2 = _Casts.uncheckedCast(singletonMap.get(type));
if(existingIfAny2!=null) {
return existingIfAny2;
- }
+ }
singletonMap.put(type, t);
return t;
@@ -266,7 +266,7 @@ public final class _Context {
/**
- * Looks up current thread's values for any instances that match the given type, as previously stored
+ * Looks up current thread's values for any instances that match the given type, as previously stored
* with {@link _Context#threadLocalPut(Class, Object)}.
* @param type - the key into the thread-local store
*/
@@ -275,7 +275,7 @@ public final class _Context {
}
/**
- * Looks up current thread's values for any instances that match the given type, as previously stored
+ * Looks up current thread's values for any instances that match the given type, as previously stored
* with {@link _Context#threadLocalPut(Class, Object)}.
* @param type - the key into the thread-local store
* @param requiredType - the required type of the elements in the returned bin
@@ -347,11 +347,11 @@ public final class _Context {
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
if (element.getClassName().startsWith("org.junit.")) {
return true;
- }
+ }
}
return false;
}
-
+
// -- HELPER
private static void tryClose(Object singleton) {
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/context/_Context_ThreadLocal.java b/commons/src/main/java/org/apache/isis/commons/internal/context/_Context_ThreadLocal.java
index 6437975..2351ad4 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/context/_Context_ThreadLocal.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/context/_Context_ThreadLocal.java
@@ -33,16 +33,16 @@ import lombok.val;
/**
* <h1>- internal use only -</h1>
* <p>
- * Package private mixin for _Context.
+ * Package private mixin for _Context.
* Provides a context for storing and retrieving thread local object references.
* </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
- *
+ *
*/
final class _Context_ThreadLocal {
@@ -63,7 +63,7 @@ final class _Context_ThreadLocal {
val threadLocalMap = getOrCreateThreadLocalMap();
threadLocalMap
- .compute(type, (k, v) -> v == null
+ .compute(type, (k, v) -> v == null
? Can.<T>ofSingleton(variant)
: Can.<T>concat(_Casts.uncheckedCast(v), variant));
@@ -88,7 +88,7 @@ final class _Context_ThreadLocal {
}
val bin = threadLocalMap.get(type);
if(bin==null) {
- return Can.empty();
+ return Can.empty();
}
return _Casts.uncheckedCast(bin);
}
@@ -118,18 +118,18 @@ final class _Context_ThreadLocal {
// /**
// * Inheritable... allows to have concurrent computations utilizing the ForkJoinPool.
// */
- // private static final ThreadLocal<Map<Class<?>, Bin<?>>> THREAD_LOCAL_MAP =
+ // private static final ThreadLocal<Map<Class<?>, Bin<?>>> THREAD_LOCAL_MAP =
// InheritableThreadLocal.withInitial(HashMap::new);
/**
* Inheritable... allows to have concurrent computations utilizing the ForkJoinPool.
*/
- private static final ThreadLocal<ThreadKey> THREAD_LOCAL_MAP_KEY =
+ private static final ThreadLocal<ThreadKey> THREAD_LOCAL_MAP_KEY =
InheritableThreadLocal.withInitial(()->ThreadKey.of(Thread.currentThread()));
private static final _Multimaps.MapMultimap<ThreadKey, Class<?>, Can<?>> MAPS_BY_KEY =
- _Multimaps.newConcurrentMapMultimap();
+ _Multimaps.newConcurrentMapMultimap();
private static Map<Class<?>, Can<?>> getThreadLocalMap() {
val key = THREAD_LOCAL_MAP_KEY.get(); // non-null
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java b/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
index 83d48bb..2d98a09 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
@@ -154,22 +154,22 @@ public final class _Plugin {
* @param pluginFullyQualifiedClassName
*/
public static <S> S load(
- Class<S> pluginInterfaceClass,
- File classPath,
+ Class<S> pluginInterfaceClass,
+ File classPath,
String pluginFullyQualifiedClassName) {
try {
ClassLoader parentCL = pluginInterfaceClass.getClassLoader();
URL[] urls = {classPath.toURI().toURL()};
-
+
try(URLClassLoader cl = URLClassLoader.newInstance(urls, parentCL)) {
Class<S> pluginClass = _Casts.uncheckedCast(
cl.loadClass(pluginFullyQualifiedClassName));
S plugin = pluginClass.newInstance();
_Context.putSingleton(pluginInterfaceClass, plugin);
-
+
return plugin;
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
index 40290b2..5d3e945 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
@@ -35,11 +35,11 @@ import lombok.extern.log4j.Log4j2;
/**
* <h1>- internal use only -</h1>
* <p>
- * Replacement for the use of System.out.println when adding temporary debug code,
+ * Replacement for the use of System.out.println when adding temporary debug code,
* that needs to be removed later.
* </p>
- * <p>EXAMPLE:<br/><pre>{@code
- * _Probe probe =
+ * <p>EXAMPLE:<br/><pre>{@code
+ * _Probe probe =
* _Probe.maxCallsThenExitWithStacktrace(1).label("IsisInteractionFactoryDefault");
* probe.println("Hallo World!");
* }
@@ -179,7 +179,7 @@ public class _Probe {
errOut("-------------------------------------");
out=restore_out;
}
-
+
public void run(Runnable runnable) {
val t0 = System.nanoTime();
runnable.run();
@@ -189,20 +189,20 @@ public class _Probe {
}
// -- DEBUG ENTRY POINTS
-
+
public static enum EntryPoint {
USER_INTERACTION
}
-
+
/** idea is to keep these for reuse (so these are not just for temporary troubleshooting) */
public static void entryPoint(EntryPoint entryPoint, String description) {
if(log.isDebugEnabled()) {
log.debug("entering {}: {}", entryPoint.name(), description);
}
}
-
+
// -- CONVENIENT DEBUG TOOLS (STATIC)
-
+
public static String currentThreadId() {
val ct = Thread.currentThread();
return String.format("Thread[%s (%d)])", ct.getName(), ct.getId());
@@ -217,7 +217,7 @@ public class _Probe {
}
- private static final Map<String, String> abbreviations =
+ private static final Map<String, String> abbreviations =
_Maps.unmodifiableEntries(
_Maps.entry("org.apache.isis", "~"),
_Maps.entry("core", "c"),
@@ -246,13 +246,13 @@ public class _Probe {
for(int i=0; i<indent; ++i) {
out.print(indentLiteral);
}
- final String message = "["+label+" "+counterValue+"] "+chars;
+ final String message = "["+label+" "+counterValue+"] "+chars;
out.println(String.format(emphasisFormat, message));
}
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayDataModel.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayDataModel.java
index d95a96d..0573d55 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayDataModel.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayDataModel.java
@@ -41,99 +41,101 @@ import lombok.val;
public abstract class XrayDataModel extends HasIdAndLabel {
public abstract void render(JScrollPane detailPanel);
+ @Override
public abstract String getId();
+ @Override
public abstract String getLabel();
public abstract String getIconResource();
// -- PREDEFINED DATA MODELS
-
+
@Getter
- @EqualsAndHashCode(callSuper = false)
+ @EqualsAndHashCode(callSuper = false)
@RequiredArgsConstructor
public static class KeyValue extends XrayDataModel {
-
+
@EqualsAndHashCode.Exclude
private final Map<String, String> data = new TreeMap<>();
-
+
private final String id;
private final String label;
-
+
@EqualsAndHashCode.Exclude
private final String iconResource = "/xray/key-value.png";
-
+
@Override
public void render(JScrollPane panel) {
String[] columnNames = {"Key", "Value"};
Object[][] tableData = new Object[data.size()][columnNames.length];
-
+
val rowIndex = _Refs.intRef(0);
-
+
data.forEach((k, v)->{
val row = tableData[rowIndex.getValue()];
rowIndex.inc();
row[0] = k;
row[1] = v;
});
-
- val table = _SwingUtil.newTable(tableData, columnNames);
+
+ val table = _SwingUtil.newTable(tableData, columnNames);
table.setFillsViewportHeight(true);
-
+
panel.setViewportView(table);
}
}
-
+
@Getter
- @EqualsAndHashCode(callSuper = false)
+ @EqualsAndHashCode(callSuper = false)
@RequiredArgsConstructor
public static class Sequence extends XrayDataModel {
-
+
@EqualsAndHashCode.Exclude
private final SequenceDiagram data = new SequenceDiagram();
-
+
private final String id;
private final String label;
-
+
@EqualsAndHashCode.Exclude
private final String iconResource = "/xray/sequence.png";
-
+
private final static Color COLOR_SILVER = new Color(0xf5, 0xf5, 0xf5);
private final static Color BACKGROUND_COLOR = COLOR_SILVER;
private final static Color BORDER_COLOR = Color.GRAY;
-
+
public Sequence(String label) {
this(UUID.randomUUID().toString(), label);
}
-
+
@Override
public void render(JScrollPane panel) {
-
+
val dim = data.layout((Graphics2D)panel.getGraphics());
-
+
val canvas = new JPanel() {
private static final long serialVersionUID = 1L;
@Override
public void paintComponent(Graphics _g) {
-
+
val g = (Graphics2D)_g;
g.setColor(BACKGROUND_COLOR);
g.fillRect(0, 0, getWidth(), getHeight());
-
+
data.render(g);
}
};
-
+
if(BORDER_COLOR!=null) {
canvas.setBorder(BorderFactory.createLineBorder(BORDER_COLOR));
}
canvas.setPreferredSize(dim);
-
+
panel.setViewportView(canvas);
-
+
}
-
-
+
+
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModel.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModel.java
index 85c666f..5d1caf5 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModel.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModel.java
@@ -31,7 +31,7 @@ import org.apache.isis.commons.internal.base._Strings;
import lombok.Value;
public interface XrayModel {
-
+
MutableTreeNode getRootNode();
default MutableTreeNode getThreadNode(final ThreadMemento threadMemento) {
return lookupNode(threadMemento.getId())
@@ -40,20 +40,20 @@ public interface XrayModel {
threadMemento.getLabel(),
threadMemento.getId()));
}
-
+
MutableTreeNode addContainerNode(MutableTreeNode parent, String name, String id);
default MutableTreeNode addContainerNode(MutableTreeNode parent, String name) {
return addContainerNode(parent, name, UUID.randomUUID().toString());
}
-
+
<T extends XrayDataModel> T addDataNode(MutableTreeNode parent, T dataModel);
Optional<MutableTreeNode> lookupNode(String id);
-
+
void remove(MutableTreeNode node);
-
+
// -- DATA LOOKUP
-
+
default Optional<XrayDataModel.Sequence> lookupSequence(final @Nullable String sequenceId) {
return _Strings.isNullOrEmpty(sequenceId)
? Optional.empty()
@@ -61,31 +61,31 @@ public interface XrayModel {
.map(node->
(XrayDataModel.Sequence)((DefaultMutableTreeNode) node).getUserObject());
}
-
+
// -- STACKS
-
+
Stack<MutableTreeNode> getNodeStack(String id);
-
+
// -- ID AND LABEL
-
+
abstract class HasIdAndLabel {
public abstract String getId();
public abstract String getLabel();
-
+
@Override
public final String toString() {
return getLabel();
}
-
+
}
-
+
// -- THREAD UTIL
-
+
@Value(staticConstructor = "of")
public static class ThreadMemento {
private final String id;
private final String label;
private final String multilinelabel;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModelSimple.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModelSimple.java
index 361d4c2..c0a7b03 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModelSimple.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayModelSimple.java
@@ -37,7 +37,7 @@ final class XrayModelSimple implements XrayModel {
@Getter(onMethod_ = {@Override})
private final MutableTreeNode rootNode;
-
+
@Override
public MutableTreeNode addContainerNode(
final @NonNull MutableTreeNode parent,
@@ -65,7 +65,7 @@ final class XrayModelSimple implements XrayModel {
}
private final Map<String, MutableTreeNode> nodesById = _Maps.newConcurrentHashMap();
-
+
@Override
public Optional<MutableTreeNode> lookupNode(String id) {
return Optional.ofNullable(nodesById.get(id)) ;
@@ -78,7 +78,7 @@ final class XrayModelSimple implements XrayModel {
}
private final Map<String, Stack<MutableTreeNode>> nodeStacksById = _Maps.newConcurrentHashMap();
-
+
@Override
public Stack<MutableTreeNode> getNodeStack(String id) {
return nodeStacksById.computeIfAbsent(id, __->new Stack<MutableTreeNode>());
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayUi.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayUi.java
index da522ba..3e823b2 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayUi.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/XrayUi.java
@@ -71,7 +71,7 @@ public class XrayUi extends JFrame {
val alreadyRequested = startRequested.getAndSet(true);
if(!alreadyRequested) {
latch = new CountDownLatch(1);
- SwingUtilities.invokeLater(()->new XrayUi(defaultCloseOperation));
+ SwingUtilities.invokeLater(()->new XrayUi(defaultCloseOperation));
}
}
@@ -97,36 +97,36 @@ public class XrayUi extends JFrame {
e.printStackTrace();
}
}
-
+
public static boolean isXrayEnabled() {
return startRequested.get();
}
-
+
protected XrayUi(int defaultCloseOperation) {
//create the root node
root = new DefaultMutableTreeNode("X-ray");
-
+
xrayModel = new XrayModelSimple(root);
//create the tree by passing in the root node
tree = new JTree(root);
tree.setShowsRootHandles(false);
-
+
val detailPanel = layoutUIAndGetDetailPanel(tree);
-
+
tree.getSelectionModel().addTreeSelectionListener((TreeSelectionEvent e) -> {
-
+
val selPath = e.getNewLeadSelectionPath();
if(selPath==null) {
return; // ignore event
}
val selectedNode = (DefaultMutableTreeNode) selPath.getLastPathComponent();
val userObject = selectedNode.getUserObject();
-
+
//detailPanel.removeAll();
-
+
if(userObject instanceof XrayDataModel) {
((XrayDataModel) userObject).render(detailPanel);
} else {
@@ -134,13 +134,13 @@ public class XrayUi extends JFrame {
infoPanel.add(new JLabel("Details"));
detailPanel.setViewportView(infoPanel);
}
-
+
detailPanel.revalidate();
detailPanel.repaint();
-
+
//System.out.println("selected: " + selectedNode.toString());
});
-
+
val popupMenu = new JPopupMenu();
val deleteAction = popupMenu.add(new JMenuItem("Delete"));
deleteAction.addActionListener(new ActionListener() {
@@ -149,16 +149,16 @@ public class XrayUi extends JFrame {
removeSelectedNodes();
}
});
-
+
tree.setCellRenderer(new XrayTreeCellRenderer((DefaultTreeCellRenderer) tree.getCellRenderer()));
-
+
tree.addMouseListener(new MouseListener() {
-
+
@Override public void mouseReleased(MouseEvent e) {}
@Override public void mousePressed(MouseEvent e) {}
@Override public void mouseExited(MouseEvent e) {}
@Override public void mouseEntered(MouseEvent e) {}
-
+
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
@@ -166,12 +166,12 @@ public class XrayUi extends JFrame {
}
}
});
-
+
tree.addKeyListener(new KeyListener() {
@Override public void keyReleased(KeyEvent e) {}
@Override public void keyTyped(KeyEvent e) {}
-
+
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_DELETE) {
@@ -180,12 +180,12 @@ public class XrayUi extends JFrame {
}
});
-
+
this.setDefaultCloseOperation(defaultCloseOperation);
this.setTitle("X-ray Viewer");
this.pack();
this.setSize(800, 600);
-
+
this.setLocationRelativeTo(null);
this.setVisible(true);
@@ -198,11 +198,11 @@ public class XrayUi extends JFrame {
}
});
}
-
+
private void removeSelectedNodes() {
Can.ofArray(tree.getSelectionModel().getSelectionPaths())
.forEach(path->{
- val nodeToBeRemoved = (MutableTreeNode)path.getLastPathComponent();
+ val nodeToBeRemoved = (MutableTreeNode)path.getLastPathComponent();
if(nodeToBeRemoved.getParent()!=null) {
((DefaultTreeModel)tree.getModel()).removeNodeFromParent(nodeToBeRemoved);
xrayModel.remove(nodeToBeRemoved);
@@ -211,52 +211,53 @@ public class XrayUi extends JFrame {
}
private JScrollPane layoutUIAndGetDetailPanel(JTree masterTree) {
-
+
JScrollPane masterScrollPane = new JScrollPane(masterTree);
JScrollPane detailScrollPane = new JScrollPane();
-
+
//Create a split pane with the two scroll panes in it.
val splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
masterScrollPane, detailScrollPane);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(260);
-
+
//Provide minimum sizes for the two components in the split pane.
Dimension minimumSize = new Dimension(100, 50);
masterScrollPane.setMinimumSize(minimumSize);
detailScrollPane.setMinimumSize(minimumSize);
-
+
detailScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
detailScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
detailScrollPane.getVerticalScrollBar().setUnitIncrement(8);
-
+
//Provide a preferred size for the split pane.
splitPane.setPreferredSize(new Dimension(800, 600));
-
+
getContentPane().add(splitPane);
-
+
return detailScrollPane;
}
// -- CUSTOM TREE NODE ICONS
-
+
@RequiredArgsConstructor
class XrayTreeCellRenderer implements TreeCellRenderer {
-
- final DefaultTreeCellRenderer delegate;
+ final DefaultTreeCellRenderer delegate;
+
+ @Override
public Component getTreeCellRendererComponent(
JTree tree,
- Object value,
- boolean selected,
- boolean expanded,
- boolean leaf,
- int row,
+ Object value,
+ boolean selected,
+ boolean expanded,
+ boolean leaf,
+ int row,
boolean hasFocus) {
-
+
val label = (DefaultTreeCellRenderer)
delegate.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
-
+
Object o = ((DefaultMutableTreeNode) value).getUserObject();
if (o instanceof XrayDataModel) {
XrayDataModel dataModel = (XrayDataModel) o;
@@ -269,7 +270,7 @@ public class XrayUi extends JFrame {
return label;
}
}
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/_SwingUtil.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/_SwingUtil.java
index 474f945..4d76d6d 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/_SwingUtil.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/_SwingUtil.java
@@ -31,7 +31,7 @@ import javax.swing.tree.TreePath;
import lombok.val;
final class _SwingUtil {
-
+
static JTable newTable(Object[][] tableData, String[] columnNames) {
val table = new JTable(tableData, columnNames) {
private static final long serialVersionUID = 1L;
@@ -52,7 +52,7 @@ final class _SwingUtil {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getModel().getRoot();
setNodeExpandedState(tree, node, expanded);
}
-
+
@SuppressWarnings("unchecked")
static void setNodeExpandedState(JTree tree, DefaultMutableTreeNode node, boolean expanded) {
for (Object treeNode : Collections.list(node.children())) {
@@ -68,5 +68,5 @@ final class _SwingUtil {
tree.collapsePath(path);
}
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/SequenceDiagram.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/SequenceDiagram.java
index d3d598b..ea97748 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/SequenceDiagram.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/SequenceDiagram.java
@@ -74,7 +74,7 @@ public class SequenceDiagram {
public void exit(String from, String to) {
exit(from, to, null);
}
-
+
public void activate(String participantId) {
val participant = participant(participantId);
val latestConnection = latestConnection();
@@ -89,46 +89,46 @@ public class SequenceDiagram {
.findFirst()
.ifPresent(lifeline->lifeline.endAt = latestConnection);
}
-
+
// -- STYLE OVERRIDE
-
+
private Color connectionArrowColor;
private Color connectionLabelColor;
-
+
public void setConnectionArrowColor(Color connectionArrowColor) {
this.connectionArrowColor = connectionArrowColor;
}
-
+
public void setConnectionLabelColor(Color connectionLabelColor) {
this.connectionLabelColor = connectionLabelColor;
}
// -- HELPER
-
+
private Connection newConnection(
- final Participant from,
- final Participant to,
- final String label,
+ final Participant from,
+ final Participant to,
+ final String label,
final boolean dashedLine) {
return new Connection(
- connections.size(),
- from,
- to,
- label,
- dashedLine,
- getConnectionArrowColor(),
+ connections.size(),
+ from,
+ to,
+ label,
+ dashedLine,
+ getConnectionArrowColor(),
getConnectionLabelColor());
}
-
+
private Participant participant(String participantId) {
return participantsById
.computeIfAbsent(participantId, id->new Participant(aliases.getOrDefault(id, id)));
}
-
+
private Connection latestConnection() {
return Can.ofCollection(connections).getLast().orElse(null);
}
-
+
private Color getConnectionArrowColor() {
return connectionArrowColor!=null
? connectionArrowColor
@@ -140,8 +140,8 @@ public class SequenceDiagram {
? connectionLabelColor
: CONNECTION_LABEL_COLOR;
}
-
-
+
+
// -- RENDERING
private final static Color PARTICIPANT_BACKGROUND_COLOR = _Graphics.COLOR_LIGHTER_GREEN;
@@ -153,10 +153,10 @@ public class SequenceDiagram {
private final static int PARTICIPANT_LINEGAP = 0;
private final static int PARTICIPANT_MAX_CHAR_PER_LINE = 26;
private final static Optional<Font> PARTICIPANT_FONT = _Graphics.lookupFont("Verdana", 12.f);
-
+
private final static Color LIFELINE_BACKGROUND_COLOR = Color.WHITE;
private final static int LIFELINE_WIDTH = 8;
-
+
private final static Color CONNECTION_ARROW_COLOR = _Graphics.COLOR_DARKER_RED;
private final static Color CONNECTION_LABEL_COLOR = Color.BLACK;
private final static int CONNECTION_MARGIN_V = 12;
@@ -175,31 +175,31 @@ public class SequenceDiagram {
final Color arrowColor;
final Color labelColor;
-
+
TextBlock textBlock;
int x_left;
int x_from;
int x_to;
-
+
int y_top;
int y_bottom;
int height;
void layout(Graphics2D g, IntReference y_offset, List<Lifeline> lifelines) {
-
+
x_from = from.getX_middle();
x_to = to.getX_middle();
-
+
val fromConnectsLifeline = lifelines.stream()
.filter(ll->ll.getParticipant().equals(from))
.anyMatch(ll->ll.overlaps(this));
-
+
val toConnectsLifeline = lifelines.stream()
.filter(ll->ll.getParticipant().equals(to))
.anyMatch(ll->ll.overlaps(this));
-
- final int dir = from.getX_middle() < to.getX_middle()
+
+ final int dir = from.getX_middle() < to.getX_middle()
? 1
: -1;
if(fromConnectsLifeline) {
@@ -208,18 +208,18 @@ public class SequenceDiagram {
if(toConnectsLifeline) {
x_to-= dir * LIFELINE_WIDTH / 2;
}
-
+
x_left = Math.min(x_from, x_to);
-
+
y_top = y_offset.getValue() + CONNECTION_MARGIN_V;
-
- textBlock = new TextBlock(label,
- x_left,
+
+ textBlock = new TextBlock(label,
+ x_left,
y_top);
- val dim = textBlock.layout(g.getFontMetrics(),
- CONNECTION_LABEL_PADDING_H,
- CONNECTION_LABEL_PADDING_V,
+ val dim = textBlock.layout(g.getFontMetrics(),
+ CONNECTION_LABEL_PADDING_H,
+ CONNECTION_LABEL_PADDING_V,
CONNECTION_LABEL_LINEGAP,
Integer.MAX_VALUE);
@@ -251,9 +251,9 @@ public class SequenceDiagram {
textBlock = new TextBlock(label, x_left, y_top);
- val dim = textBlock.layout(g.getFontMetrics(),
- PARTICIPANT_PADDING_H,
- PARTICIPANT_PADDING_V,
+ val dim = textBlock.layout(g.getFontMetrics(),
+ PARTICIPANT_PADDING_H,
+ PARTICIPANT_PADDING_V,
PARTICIPANT_LINEGAP,
PARTICIPANT_MAX_CHAR_PER_LINE);
@@ -267,34 +267,34 @@ public class SequenceDiagram {
x_offset.update(x->x + width + PARTICIPANT_MARGIN_H);
}
}
-
+
@Getter @RequiredArgsConstructor
private static class Lifeline {
final @NonNull Participant participant;
final Connection startAt;
Connection endAt;
-
+
int x_left;
int x_right;
int width;
-
+
int y_top;
int y_bottom;
int height;
-
+
void layout(Graphics2D g, int min_y, int max_y) {
-
+
width = LIFELINE_WIDTH;
x_left = participant.getX_middle() - LIFELINE_WIDTH / 2;
x_right = x_left + width;
-
+
y_top = startAt !=null
? startAt.y_bottom
: min_y;
y_bottom = endAt !=null
? endAt.y_bottom
: max_y;
-
+
height = y_bottom - y_top;
}
@@ -308,45 +308,45 @@ public class SequenceDiagram {
return _Ints.Range.of(lowerBound, upperBound).contains(connection.index);
}
}
-
+
public Dimension layout(Graphics2D g) {
PARTICIPANT_FONT.ifPresent(g::setFont);
-
+
val x_offset = _Refs.intRef(PARTICIPANT_MARGIN_H);
val y_offset = _Refs.intRef(0);
-
+
participantsById.values().stream()
.peek(p->p.layout(g, x_offset))
.forEach(p->y_offset.update(x->Math.max(x, p.getHeight())));
-
+
final int width = x_offset.getValue();
y_offset.update(x->x + PARTICIPANT_MARGIN_V);
final int y_offset_first_con = y_offset.getValue();
-
+
CONNECTION_FONT.ifPresent(g::setFont);
connections.stream()
.forEach(c->c.layout(g, y_offset, lifelines));
final int y_offset_last_con = y_offset.getValue();
-
+
final int height = y_offset.update(x->x + 2*PARTICIPANT_MARGIN_V);
this.size = new Dimension(width, height);
-
+
lifelines.stream()
.forEach(ll->ll.layout(g, y_offset_first_con - 3, y_offset_last_con + 3));
-
+
return this.size;
}
public void render(Graphics2D g) {
_Graphics.enableTextAntialiasing(g);
-
+
PARTICIPANT_FONT.ifPresent(g::setFont);
participantsById.values().stream()
@@ -374,23 +374,23 @@ public class SequenceDiagram {
g.drawLine(p.getX_middle(), p.getY_bottom(), p.getX_middle(), size.height - PARTICIPANT_MARGIN_V);
});
-
+
g.setStroke(_Graphics.STROKE_DEFAULT);
-
+
lifelines.stream()
.forEach(ll->{
-
+
// lifeline box
-
+
g.setColor(LIFELINE_BACKGROUND_COLOR);
g.fillRect(ll.getX_left(), ll.getY_top(), ll.getWidth(), ll.getHeight());
g.setColor(PARTICIPANT_BORDER_COLOR);
g.drawRect(ll.getX_left(), ll.getY_top(), ll.getWidth(), ll.getHeight());
});
-
+
CONNECTION_FONT.ifPresent(g::setFont);
-
+
connections.stream()
.forEach(c->{
@@ -402,9 +402,9 @@ public class SequenceDiagram {
? _Graphics.STROKE_DASHED
: _Graphics.STROKE_DEFAULT);
- _Graphics.arrowHorizontal(g,
- c.getX_from(),
- c.getX_to(),
+ _Graphics.arrowHorizontal(g,
+ c.getX_from(),
+ c.getX_to(),
c.getY_bottom());
// connection label
@@ -415,7 +415,7 @@ public class SequenceDiagram {
});
}
-
+
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/_Graphics.java b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/_Graphics.java
index 4183d1b..fdfc6b4 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/_Graphics.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/debug/xray/sequence/_Graphics.java
@@ -43,15 +43,15 @@ final class _Graphics {
final static Color COLOR_LIGHTER_GREEN = new Color(0xd5, 0xe8, 0xd4);
final static Color COLOR_DARKER_GREEN = new Color(0x82, 0xB3, 0x66);
final static Color COLOR_DARKER_RED = new Color(0xB2, 0x00, 0x00);
-
+
final static BasicStroke STROKE_DEFAULT = new BasicStroke(1.0f);
- final static BasicStroke STROKE_DASHED = new BasicStroke(1,
- BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_ROUND,
- 1.0f,
+ final static BasicStroke STROKE_DASHED = new BasicStroke(1,
+ BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_ROUND,
+ 1.0f,
new float[] { 2f, 0f, 2f },
2f);
-
+
static Optional<Font> lookupFont(String fontName, float size) {
val ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
for (Font font : ge.getAllFonts()) {
@@ -61,13 +61,13 @@ final class _Graphics {
}
return Optional.empty();
}
-
+
static void arrowHorizontal(Graphics2D g, int m0, int m1, int y) {
-
+
g.drawLine(m0, y, m1, y);
// arrow head
-
+
final int dir = m1<m0 ? 1 : -1;
val origStroke = g.getStroke();
@@ -78,24 +78,24 @@ final class _Graphics {
}
g.setStroke(origStroke);
}
-
+
static void enableTextAntialiasing(Graphics2D g) {
-
+
g.setRenderingHint(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
-
+
g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-
- Map<?, ?> desktopHints =
+
+ Map<?, ?> desktopHints =
(Map<?, ?>) Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints");
if (desktopHints != null) {
g.setRenderingHints(desktopHints);
}
}
-
+
@Getter @RequiredArgsConstructor
static class TextBlock {
final String label; // multi-line text
@@ -104,11 +104,11 @@ final class _Graphics {
final int xLeft; // top left anchor (x)
int xRight;
int width;
-
+
final int yTop; // top left anchor (y)
int yBottom;
int height;
-
+
int hPadding;
int vPadding;
int lineGap;
@@ -130,13 +130,13 @@ final class _Graphics {
final int maxAdvance = lines.stream().mapToInt(metrics::stringWidth).max().orElse(0);
width = maxAdvance + 2*hPadding;
height = lines.size()*lineHeight + (lines.size()-1)*lineGap + 2*vPadding;
-
+
xRight = xLeft + width;
yBottom = yTop + height;
-
+
return new Dimension(width, height);
}
-
+
void render(Graphics2D g) {
if(lines==null
|| lines.isEmpty()) {
@@ -149,7 +149,7 @@ final class _Graphics {
baseLine.update(x->x + lineHeight + lineGap);
});
}
-
+
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java b/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
index 5bccf37..12735d6 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
@@ -86,7 +86,7 @@ public final class _Exceptions {
_With.requires(format, "format");
return new IllegalStateException(String.format(format, args));
}
-
+
public static IllegalAccessException illegalAccess(
final String format,
final @Nullable Object ... args) {
@@ -97,7 +97,7 @@ public final class _Exceptions {
public static final NoSuchElementException noSuchElement() {
return new NoSuchElementException();
}
-
+
public static final NoSuchElementException noSuchElement(String msg) {
return new NoSuchElementException(msg);
}
@@ -116,7 +116,7 @@ public final class _Exceptions {
}
// -- UNRECOVERABLE
-
+
public static RuntimeException unrecoverable(Throwable cause) {
return new RuntimeException("unrecoverable error: with cause ...", cause);
}
@@ -128,34 +128,34 @@ public final class _Exceptions {
public static RuntimeException unrecoverable(String msg, Throwable cause) {
return new RuntimeException(String.format("unrecoverable error: '%s' with cause ...", msg), cause);
}
-
+
public static RuntimeException unrecoverableFormatted(String format, Object ...args) {
- return new RuntimeException(String.format("unrecoverable error: '%s'",
+ return new RuntimeException(String.format("unrecoverable error: '%s'",
String.format(format, args)));
}
-
+
// -- UNSUPPORTED
public static UnsupportedOperationException unsupportedOperation() {
return new UnsupportedOperationException("unrecoverable error: method call not allowed/supported");
}
-
+
public static UnsupportedOperationException unsupportedOperation(String msg) {
return new UnsupportedOperationException(msg);
}
-
+
public static UnsupportedOperationException unsupportedOperation(String format, Object ...args) {
return new UnsupportedOperationException(String.format(format, args));
}
-
+
// -- ASSERT
-
+
public static AssertionError assertionError(String msg) {
return new AssertionError(msg);
}
-
+
// -- MESSAGE
-
+
public static String getMessage(Exception ex) {
if(ex==null) {
return "no exception present";
@@ -171,22 +171,22 @@ public final class _Exceptions {
.map(Throwable::getMessage)
.filter(_NullSafe::isPresent)
.findFirst();
-
+
if(nestedMsg.isPresent()) {
sb.append(nestedMsg.get());
} else {
-
+
Can.ofArray(ex.getStackTrace())
.stream()
.limit(20)
.forEach(trace->sb.append("\n").append(trace));
}
-
+
return sb.toString();
}
-
+
// -- THROWING
-
+
/**
* Used to hide from the compiler the fact, that this call always throws.
*
@@ -299,7 +299,7 @@ public final class _Exceptions {
}
public static void dumpStackTrace() {
- dumpStackTrace(System.err, 0, 1000);
+ dumpStackTrace(System.err, 0, 1000);
}
// -- CAUSAL CHAIN
@@ -328,30 +328,30 @@ public final class _Exceptions {
public static Throwable getRootCause(@Nullable Throwable ex) {
return _Lists.lastElementIfAny(getCausalChain(ex));
}
-
+
// -- SWALLOW
-
+
public static void silence(Runnable runnable) {
-
+
val currentThread = Thread.currentThread();
val silencedHandler = currentThread.getUncaughtExceptionHandler();
-
+
currentThread.setUncaughtExceptionHandler((Thread t, Throwable e)->{/*noop*/});
-
+
try {
runnable.run();
} finally {
currentThread.setUncaughtExceptionHandler(silencedHandler);
}
-
+
}
-
+
// -- PREDICATES
-
+
public static boolean containsAnyOfTheseMessages(
- final @Nullable Throwable throwable,
+ final @Nullable Throwable throwable,
final @Nullable String ... messages) {
-
+
if(throwable==null) {
return false;
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/functions/_Functions.java b/commons/src/main/java/org/apache/isis/commons/internal/functions/_Functions.java
index d8f41a6..74220e9 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/functions/_Functions.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/functions/_Functions.java
@@ -37,11 +37,11 @@ import java.util.function.Supplier;
public final class _Functions {
// -- NOOP
-
+
public static <T> Consumer<T> noopConsumer() {
return t->{};
}
-
+
// -- INDEX AWARE
@FunctionalInterface
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/functions/_Predicates.java b/commons/src/main/java/org/apache/isis/commons/internal/functions/_Predicates.java
index a708e02..bf2a148 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/functions/_Predicates.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/functions/_Predicates.java
@@ -54,7 +54,7 @@ public final class _Predicates {
}
/**
- *
+ *
* @return a Predicate that always tests true
*/
public static <T> Predicate<T> alwaysTrue() {
@@ -69,7 +69,7 @@ public final class _Predicates {
}
/**
- * Negates the specified {@code predicate}. (Obsolete with Java-11)
+ * Negates the specified {@code predicate}. (Obsolete with Java-11)
* @param predicate
*/
public static <T> Predicate<T> not(Predicate<T> predicate) {
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/graph/_Graph.java b/commons/src/main/java/org/apache/isis/commons/internal/graph/_Graph.java
index 1c2299d..4d5d5dd 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/graph/_Graph.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/graph/_Graph.java
@@ -42,12 +42,12 @@ public class _Graph<T> {
private final Can<T> nodes;
private final BiPredicate<T, T> relationPredicate;
-
+
public Stream<T> streamNeighbors(T a) {
return nodes.stream()
.filter(b->!a.equals(b))
.filter(b->relationPredicate.test(a, b));
}
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/hash/_Hashes.java b/commons/src/main/java/org/apache/isis/commons/internal/hash/_Hashes.java
index 4693dc1..72d0b22 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/hash/_Hashes.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/hash/_Hashes.java
@@ -55,7 +55,7 @@ public final class _Hashes {
SHA512("SHA-512"),
;
private final String algorithmName;
-
+
public Optional<MessageDigest> getMessageDigest() {
try {
return Optional.ofNullable(MessageDigest.getInstance(algorithmName));
@@ -63,21 +63,21 @@ public final class _Hashes {
return Optional.empty();
}
}
-
+
}
-
+
public static Optional<byte[]> digest(@NonNull Algorithm algorithm, @Nullable byte[] bytes) {
- final int size = _NullSafe.size(bytes);
+ final int size = _NullSafe.size(bytes);
if(size==0) {
return Optional.empty();
}
return algorithm.getMessageDigest()
.map(md->digest(md, new ByteArrayInputStream(bytes), Math.max(size, 4096)));
}
-
-
+
+
// -- HELPER
-
+
@SneakyThrows
private static byte[] digest(@NonNull MessageDigest md, @NonNull InputStream inputStream, int buffersize) {
md.reset();
@@ -87,6 +87,6 @@ public final class _Hashes {
}
return md.digest();
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/image/_Images.java b/commons/src/main/java/org/apache/isis/commons/internal/image/_Images.java
index 7d3c9e3..bbc3f78 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/image/_Images.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/image/_Images.java
@@ -40,83 +40,83 @@ import lombok.SneakyThrows;
import lombok.val;
public class _Images {
-
+
// -- BYTES
-
+
@SneakyThrows
public static byte[] toBytes(final @NonNull BufferedImage image){
try(val bos = new ByteArrayOutputStream(8 * 1024)) {
ImageIO.write(image, "png", bos); // png is lossless
- return bos.toByteArray();
+ return bos.toByteArray();
}
}
-
+
@SneakyThrows
public static BufferedImage fromBytes(final @NonNull byte[] imageData){
try(val bis = new ByteArrayInputStream(imageData)){
- return ImageIO.read(bis);
+ return ImageIO.read(bis);
}
}
-
+
// -- BASE64
-
+
@SneakyThrows
public static String toBase64(final @NonNull BufferedImage image){
return new String(_Bytes.asUrlBase64.apply(toBytes(image)),
StandardCharsets.UTF_8);
}
-
+
@SneakyThrows
public static BufferedImage fromBase64(final @NonNull String base64ImageData){
val imageData = _Bytes.ofUrlBase64.apply(base64ImageData.getBytes(StandardCharsets.UTF_8));
return fromBytes(imageData);
}
-
+
// -- PIXELS
-
+
/**
- * @return 2 dim. array of pixels defining this image,
+ * @return 2 dim. array of pixels defining this image,
* where each pixel is a 32 bit ARGB color value,
* with {@code A} the alpha value as highest significant 8 bits
* followed by {@code R} the red value and so on
*/
@Nullable
public static int[][] toPixels(final @Nullable BufferedImage image){
-
+
if(image==null) {
return null;
}
-
+
final int width = image.getWidth();
final int height = image.getHeight();
val pixels = new int[height][width];
for(int lineIndex=0; lineIndex<height; ++lineIndex) {
image.getRGB(0, lineIndex, width, 1, pixels[lineIndex], 0, width);
- // debug
+ // debug
// System.err.println(
// _Ints.rowForm(pixels[lineIndex],10, Integer::toHexString));
-
+
}
return pixels;
}
-
+
/**
- * @param pixels - 2 dim. array of pixels defining this image,
+ * @param pixels - 2 dim. array of pixels defining this image,
* where each pixel is a 32 bit ARGB color value,
* with {@code A} the alpha value as highest significant 8 bits
* followed by {@code R} the red value and so on
*/
@Nullable
public static BufferedImage fromPixels(final @Nullable int[][] pixels){
-
+
/*sonar-ignore-on*/
final int height = _NullSafe.size(pixels);
final int width = height>0
? _NullSafe.size(pixels[0])
: 0;
/*sonar-ignore-off*/
-
+
final int pixelCount = width * height;
if(pixelCount>0) {
@@ -127,28 +127,28 @@ public class _Images {
return null;
}
}
-
+
// -- RASTER UTILS (LOW LEVEL)
-
+
private static WritableRaster createRasterARGB8888(final int[][] pixels){
final int height = pixels.length;
final int width = pixels[0].length;
return createRasterARGB8888(width, height, _Ints.flatten(pixels));
}
-
+
private static WritableRaster createRasterARGB8888(final int width, final int height, final int[] dataArray){
val dataBuffer = new DataBufferInt(dataArray, width * height);
val sampleModel = new SinglePixelPackedSampleModel(
- dataBuffer.getDataType(), width, height, BitMask8888);
+ dataBuffer.getDataType(), width, height, BitMask8888);
return Raster.createWritableRaster(sampleModel, dataBuffer, null);
}
-
+
private static BufferedImage createImageARGB8888(final WritableRaster raster){
- val directColorModel​ =
+ val directColorModel​ =
new DirectColorModel(32, BitMask8888[0], BitMask8888[1], BitMask8888[2], BitMask8888[3]);
return new BufferedImage(directColorModel​, raster, false, null);
}
-
+
private final static int[] BitMask8888 = {
0xff<<16,
0xff<<8,
@@ -161,6 +161,6 @@ public class _Images {
// g2d.drawImage(image, 0, 0, null);
// g2d.dispose();
// }
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer.java b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer.java
index ed86a5d..f39cef9 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer.java
@@ -58,10 +58,10 @@ public interface _IocContainer {
* (i.e. multiple candidates found with none marked as primary)
* @throws RuntimeException if instance creation failed
*/
- <T> Optional<T> get(Class<T> requiredType);
-
+ <T> Optional<T> get(Class<T> requiredType);
+
<T> Can<T> select(Class<T> requiredType);
-
+
/**
* @param <T>
* @param requiredType
@@ -85,9 +85,9 @@ public interface _IocContainer {
*/
public default <T> T getSingletonElseFail(@Nullable Class<T> type) {
_With.requires(type, "type");
-
+
val candidates = select(type);
-
+
switch (candidates.getCardinality()) {
case ZERO:
throw _Exceptions.noSuchElement("Cannot resolve singleton '%s'", type);
@@ -106,12 +106,12 @@ public interface _IocContainer {
}
// -- FACTORIES
-
+
static _IocContainer spring(ApplicationContext springContext) {
return _IocContainer_Spring.of(springContext);
}
-
+
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer_Spring.java b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer_Spring.java
index 400c08b..7d2864b 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer_Spring.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_IocContainer_Spring.java
@@ -48,7 +48,7 @@ import lombok.val;
*/
@RequiredArgsConstructor(staticName = "of")
final class _IocContainer_Spring implements _IocContainer {
-
+
@NonNull private final ApplicationContext springContext;
@Override
@@ -60,7 +60,7 @@ final class _IocContainer_Spring implements _IocContainer {
throw _Exceptions.unrecoverable("Failed to create an instance of type " + requiredType, cause);
}
}
-
+
@Override
public Stream<_ManagedBeanAdapter> streamAllBeans() {
@@ -100,17 +100,17 @@ final class _IocContainer_Spring implements _IocContainer {
@Override
public <T> Can<T> select(
- final @NonNull Class<T> requiredType,
+ final @NonNull Class<T> requiredType,
final @Nullable Annotation[] qualifiers) {
val qualifiersRequired = filterQualifiers(qualifiers);
-
+
if(_NullSafe.isEmpty(qualifiersRequired)) {
-
+
val allMatchingBeans = springContext.getBeanProvider(requiredType)
.orderedStream()
.collect(Can.toCan());
-
+
return allMatchingBeans;
}
@@ -121,15 +121,15 @@ final class _IocContainer_Spring implements _IocContainer {
return qualifiersPresent.containsAll(qualifiersRequired);
})
.collect(Can.toCan());
-
+
return allMatchingBeans;
-
+
}
-
+
// -- QUALIFIER PROCESSING
/**
- * Filters the input array into a collection, such that only annotations are retained,
+ * Filters the input array into a collection, such that only annotations are retained,
* that are valid qualifiers for CDI.
* @param annotations
* @return non-null
@@ -142,7 +142,7 @@ final class _IocContainer_Spring implements _IocContainer {
.filter(_IocContainer_Spring::isGenericQualifier)
.collect(Collectors.toSet());
}
-
+
/**
* @param annotation
* @return whether or not the annotation is a valid qualifier for Spring
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter.java b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter.java
index c2532fc..efc320f 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter.java
@@ -23,7 +23,7 @@ import org.apache.isis.commons.collections.Can;
/**
* @since 2.0
*/
-public interface _ManagedBeanAdapter {
+public interface _ManagedBeanAdapter {
String getId();
Can<?> getInstance();
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter_Spring.java b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter_Spring.java
index c7be838..b0a72a7 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter_Spring.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/ioc/_ManagedBeanAdapter_Spring.java
@@ -45,5 +45,5 @@ final class _ManagedBeanAdapter_Spring implements _ManagedBeanAdapter {
.map(Object::getClass)
.anyMatch(requiredType::isAssignableFrom);
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Ints.java b/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Ints.java
index 3dcbcf8..1804630 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Ints.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Ints.java
@@ -54,9 +54,9 @@ import lombok.experimental.UtilityClass;
*/
@UtilityClass
public class _Ints {
-
+
// -- RANGE
-
+
@Value(staticConstructor = "of")
public static class Bound {
int value;
@@ -64,33 +64,33 @@ public class _Ints {
public static @NonNull Bound inclusive(int value) { return of(value, true); }
public static @NonNull Bound exclusive(int value) { return of(value, true); }
}
-
+
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public static class Range {
-
+
public static Range empty() {
return new Range(null, null, true);
}
-
+
public static Range of(
@NonNull Bound lowerBound,
@NonNull Bound upperBound) {
return new Range(lowerBound, upperBound, false);
}
-
+
private final Bound lowerBound;
private final Bound upperBound;
private final boolean empty;
public boolean contains(int value) {
if(empty) return false;
- val isBelowLower = lowerBound.isInclusive()
- ? value < lowerBound.getValue()
- : value <= lowerBound.getValue();
+ val isBelowLower = lowerBound.isInclusive()
+ ? value < lowerBound.getValue()
+ : value <= lowerBound.getValue();
if(isBelowLower) {
return false;
}
- val isAboveUpper = upperBound.isInclusive()
- ? value > upperBound.getValue()
+ val isAboveUpper = upperBound.isInclusive()
+ ? value > upperBound.getValue()
: value >= upperBound.getValue();
if(isAboveUpper) {
return false;
@@ -99,7 +99,7 @@ public class _Ints {
}
/**
* @param value
- * @return the value or if not within range, the nearest integer to the value, that is within range
+ * @return the value or if not within range, the nearest integer to the value, that is within range
*/
public int bounded(int value) {
if(empty) return value; // noop
@@ -108,7 +108,7 @@ public class _Ints {
}
final int nearestToLower = nearestToLower();
final int nearestToUpper = nearestToUpper();
- final int distanceToLower = value - nearestToLower;
+ final int distanceToLower = value - nearestToLower;
final int distanceToUpper = value - nearestToUpper;
return (distanceToLower <= distanceToUpper)
? nearestToLower
@@ -116,7 +116,7 @@ public class _Ints {
}
private int nearestToLower() {
if(empty) throw _Exceptions.unsupportedOperation();
- return lowerBound.isInclusive() ? lowerBound.getValue() : lowerBound.getValue()+1;
+ return lowerBound.isInclusive() ? lowerBound.getValue() : lowerBound.getValue()+1;
}
private int nearestToUpper() {
if(empty) throw _Exceptions.unsupportedOperation();
@@ -132,13 +132,13 @@ public class _Ints {
return Optional.empty();
}
return Optional.of(of(
- Bound.inclusive(Math.max(s1, s2)),
+ Bound.inclusive(Math.max(s1, s2)),
Bound.inclusive(Math.min(e1, e2))));
}
@Override
public String toString() {
if(empty) return "[]";
- return String.format("%s%d,%d%S",
+ return String.format("%s%d,%d%S",
lowerBound.isInclusive() ? '[' : '(', lowerBound.getValue(),
upperBound.getValue(), upperBound.isInclusive() ? ']' : ')');
}
@@ -169,9 +169,9 @@ public class _Ints {
};
}
}
-
+
// -- RANGE FACTORIES
-
+
/**
* Range includes a and b.
*/
@@ -181,7 +181,7 @@ public class _Ints {
}
return Range.of(Bound.inclusive(a), Bound.inclusive(b));
}
-
+
/**
* Range includes a but not b.
*/
@@ -194,7 +194,7 @@ public class _Ints {
}
return Range.of(Bound.inclusive(a), Bound.exclusive(b));
}
-
+
// -- PARSING
/**
@@ -227,7 +227,7 @@ public class _Ints {
* @param radix the radix to be used while parsing {@code s}.
* @param onFailure on parsing failure consumes the failure message
* @return optionally the integer represented by the string argument in the specified radix
- *
+ *
*/
public OptionalInt parseInt(final String s, final int radix, final Consumer<String> onFailure) {
final long parseResult = parseIntElseLongMaxValue(s, radix, onFailure);
@@ -236,32 +236,32 @@ public class _Ints {
}
return OptionalInt.empty();
}
-
+
// -- SHORTCUTS
-
+
public OptionalInt parseInt(final String s, final int radix) {
return parseInt(s, radix, IGNORE_ERRORS);
}
-
+
// -- LOW LEVEL HELPER
-
+
private static boolean isParseSuccess(long value) {
return value!=Long.MAX_VALUE;
}
private static final Consumer<String> IGNORE_ERRORS = t->{};
-
+
/**
- * @implNote Copied over from JDK's {@link Integer#parseInt(String)} to provide a variant
+ * @implNote Copied over from JDK's {@link Integer#parseInt(String)} to provide a variant
* with minimum potential heap pollution (does not produce stack-traces on parsing failures)
*/
private static long parseIntElseLongMaxValue(
- @Nullable final String s,
- final int radix,
+ @Nullable final String s,
+ final int radix,
final Consumer<String> onFailure) {
-
+
requires(onFailure, "onFailure");
-
+
if (s == null) {
onFailure.accept("null");
return Long.MAX_VALUE;
@@ -323,9 +323,9 @@ public class _Ints {
return Long.MAX_VALUE;
}
}
-
+
// -- ARRAY FLATTEN
-
+
public static int[] flatten(final @NonNull int[][] nested) {
final int n = nested.length;
final int stride = nested[0].length;
@@ -335,9 +335,9 @@ public class _Ints {
}
return flattened;
}
-
+
// -- ARRAY PARTITION
-
+
public static int[][] partition(final @NonNull int[] flattened, final int stride) {
final int n = flattened.length/stride;
_Assert.assertEquals(flattened.length, n*stride, ()->"flattened.length must be divisible by stride");
@@ -347,50 +347,50 @@ public class _Ints {
}
return nested;
}
-
+
// -- PRINTING
-
+
public static String rowForm(
final @NonNull int[] array) {
return rowForm(array, 8, Integer::toString);
}
-
+
public static String rowForm(
- final @NonNull int[] array,
- final int columnWidth,
+ final @NonNull int[] array,
+ final int columnWidth,
final @NonNull IntFunction<String> cellFormatter) {
-
+
final int m = array.length;
val sb = new StringBuilder();
-
+
for(int j=0; j<m; ++j) {
final int cellValue = array[j];
val cellStringFull = cellFormatter.apply(cellValue);
val cellStringTrimmed = _Strings.ellipsifyAtEnd(cellStringFull, columnWidth, "..");
// right align, at column end marker
- final int spacesCount = columnWidth - cellStringTrimmed.length();
+ final int spacesCount = columnWidth - cellStringTrimmed.length();
for(int k=0; k<spacesCount; ++k) {
sb.append(' ');
}
sb.append(cellStringTrimmed);
- }
+ }
sb.append("\n");
-
+
return sb.toString();
}
-
+
public static String tableForm(
final @NonNull int[][] nested) {
return tableForm(nested, 8, Integer::toString);
}
-
+
public static String tableForm(
- final @NonNull int[][] nested,
- final int columnWidth,
+ final @NonNull int[][] nested,
+ final int columnWidth,
final @NonNull IntFunction<String> cellFormatter) {
-
+
final int n = nested.length;
val sb = new StringBuilder();
for(int i=0; i<n; ++i) {
@@ -398,5 +398,5 @@ public class _Ints {
}
return sb.toString();
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Longs.java b/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Longs.java
index 7d20c3f..1a58238 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Longs.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/primitives/_Longs.java
@@ -46,9 +46,9 @@ import lombok.experimental.UtilityClass;
*/
@UtilityClass
public class _Longs {
-
+
// -- RANGE
-
+
@Value(staticConstructor = "of")
public static class Bound {
long value;
@@ -56,20 +56,20 @@ public class _Longs {
public static @NonNull Bound inclusive(long value) { return of(value, true); }
public static @NonNull Bound exclusive(long value) { return of(value, true); }
}
-
+
@Value(staticConstructor = "of")
public static class Range {
@NonNull Bound lowerBound;
@NonNull Bound upperBound;
public boolean contains(long value) {
- val isBelowLower = lowerBound.isInclusive()
- ? value < lowerBound.getValue()
- : value <= lowerBound.getValue();
+ val isBelowLower = lowerBound.isInclusive()
+ ? value < lowerBound.getValue()
+ : value <= lowerBound.getValue();
if(isBelowLower) {
return false;
}
- val isAboveUpper = upperBound.isInclusive()
- ? value > upperBound.getValue()
+ val isAboveUpper = upperBound.isInclusive()
+ ? value > upperBound.getValue()
: value >= upperBound.getValue();
if(isAboveUpper) {
return false;
@@ -78,7 +78,7 @@ public class _Longs {
}
/**
* @param value
- * @return the value or if not within range, the nearest integer to the value, that is within range
+ * @return the value or if not within range, the nearest integer to the value, that is within range
*/
public long bounded(long value) {
//if(empty) return value; // noop
@@ -87,7 +87,7 @@ public class _Longs {
}
final long nearestToLower = nearestToLower();
final long nearestToUpper = nearestToUpper();
- final long distanceToLower = value - nearestToLower;
+ final long distanceToLower = value - nearestToLower;
final long distanceToUpper = value - nearestToUpper;
return (distanceToLower <= distanceToUpper)
? nearestToLower
@@ -95,7 +95,7 @@ public class _Longs {
}
private long nearestToLower() {
//if(empty) throw _Exceptions.unsupportedOperation();
- return lowerBound.isInclusive() ? lowerBound.getValue() : lowerBound.getValue()+1;
+ return lowerBound.isInclusive() ? lowerBound.getValue() : lowerBound.getValue()+1;
}
private long nearestToUpper() {
//if(empty) throw _Exceptions.unsupportedOperation();
@@ -103,14 +103,14 @@ public class _Longs {
}
@Override
public String toString() {
- return String.format("%s%d,%d%S",
+ return String.format("%s%d,%d%S",
lowerBound.isInclusive() ? '[' : '(', lowerBound.getValue(),
upperBound.getValue(), upperBound.isInclusive() ? ']' : ')');
}
}
-
+
// -- RANGE FACTORIES
-
+
/**
* Range includes a and b.
*/
@@ -120,7 +120,7 @@ public class _Longs {
}
return Range.of(Bound.inclusive(a), Bound.inclusive(b));
}
-
+
/**
* Range includes a but not b.
*/
@@ -134,7 +134,7 @@ public class _Longs {
}
return Range.of(Bound.inclusive(a), Bound.exclusive(b));
}
-
+
// -- PARSING
/**
@@ -168,12 +168,12 @@ public class _Longs {
* @param radix the radix to be used while parsing {@code s}.
* @param onFailure on parsing failure consumes the failure message
* @return optionally the long represented by the string argument in the specified radix
- * @implNote Copied over from JDK's {@link Integer#parseInt(String)} to provide a variant
+ * @implNote Copied over from JDK's {@link Integer#parseInt(String)} to provide a variant
* with minimum potential heap pollution (does not produce stack-traces on parsing failures)
*/
public OptionalLong parseLong(@Nullable final String s, final int radix, final Consumer<String> onFailure) {
requires(onFailure, "onFailure");
-
+
if (s == null) {
onFailure.accept("null");
OptionalLong.empty();
@@ -236,16 +236,16 @@ public class _Longs {
}
return OptionalLong.of(negative ? result : -result);
}
-
+
// -- SHORTCUTS
-
+
public OptionalLong parseLong(final String s, final int radix) {
return parseLong(s, radix, IGNORE_ERRORS);
}
-
+
// -- HELPER
private static final Consumer<String> IGNORE_ERRORS = t->{};
-
-
+
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations.java
index fb46dd7..fa2b834 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations.java
@@ -47,113 +47,113 @@ import lombok.val;
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class _Annotations {
-
+
/**
- * Determine if the specified annotation is either directly present or meta-present.
- *
+ * Determine if the specified annotation is either directly present or meta-present.
+ *
* @param <A>
* @param annotatedElement
* @param annotationType
* @return non-null
*/
public static <A extends Annotation> boolean isPresent(
- AnnotatedElement annotatedElement,
+ AnnotatedElement annotatedElement,
Class<A> annotationType) {
return collect(annotatedElement).isPresent(annotationType);
}
-
+
/**
* Optionally returns the 'nearest' annotation of given type based on presence.
- *
+ *
* @param <A>
* @param annotatedElement
* @param annotationType
* @return non-null
*/
public static <A extends Annotation> Optional<A> findNearestAnnotation(
- AnnotatedElement annotatedElement,
+ AnnotatedElement annotatedElement,
Class<A> annotationType) {
//XXX if synthesize has good runtime performance, then we simply us it here
return synthesize(annotatedElement, annotationType);
}
-
+
private static final _Annotations_SyntCache syntCache = new _Annotations_SyntCache();
public static void clearCache() {
syntCache.clear();
}
-
+
/**
* Optionally creates a type-safe synthesized version of this annotation based on presence.
* <p>
* Does support attribute inheritance.
- *
+ *
* @param <A>
* @param annotatedElement
* @param annotationType
* @return non-null
*/
public static <A extends Annotation> Optional<A> synthesizeInherited(
- AnnotatedElement annotatedElement,
+ AnnotatedElement annotatedElement,
Class<A> annotationType) {
-
+
return calc_synthesizeInherited(annotatedElement, annotationType);
}
-
+
private static <A extends Annotation> Optional<A> calc_synthesizeInherited(
- AnnotatedElement annotatedElement,
+ AnnotatedElement annotatedElement,
Class<A> annotationType) {
-
+
val collected = _Annotations
.collect(annotatedElement);
-
+
if(!collected.isPresent(annotationType)) {
-
+
// also handle fields, getter methods might be associated with
- if(annotatedElement instanceof Method &&
+ if(annotatedElement instanceof Method &&
searchAnnotationOnField(annotationType) ) {
-
+
val fieldForGetter = fieldForGetter((Method) annotatedElement);
if(fieldForGetter!=null) {
return synthesizeInherited(fieldForGetter, annotationType);
}
}
-
+
return Optional.empty();
}
-
+
val proxy = _Annotations_SynthesizedMergedAnnotationInvocationHandler
.createProxy(collected, annotationType);
-
+
return Optional.of(proxy);
}
-
-
+
+
/**
* Optionally create a type-safe synthesized version of this annotation based on presence.
* <p>
* Does NOT support attribute inheritance.
- *
+ *
* @param <A>
* @param annotatedElement
* @param annotationType
* @return non-null
*/
public static <A extends Annotation> Optional<A> synthesize(
- AnnotatedElement annotatedElement,
+ AnnotatedElement annotatedElement,
Class<A> annotationType) {
-
+
val synthesized = _Annotations
.collect(annotatedElement)
.get(annotationType)
.synthesize(MergedAnnotation::isPresent);
-
+
return synthesized;
}
-
+
// -- HELPER
-
+
/**
* @apiNote don't expose Spring's MergedAnnotations
*/
@@ -161,7 +161,7 @@ public final class _Annotations {
val collected = MergedAnnotations.from(annotatedElement, SearchStrategy.INHERITED_ANNOTATIONS);
return collected;
}
-
+
private static Field fieldForGetter(Method getter) {
if(ReflectionUtils.isObjectMethod(getter)) {
return null;
@@ -173,7 +173,7 @@ public final class _Annotations {
val declaringClass = getter.getDeclaringClass();
return ReflectionUtils.findField(declaringClass, fieldNameCandidate);
}
-
+
private static String fieldNameForGetter(Method getter) {
if(getter.getParameterCount()>0) {
return null;
@@ -193,7 +193,7 @@ public final class _Annotations {
return _Strings.decapitalize(fieldName);
}
-
+
private static boolean searchAnnotationOnField(Class<? extends Annotation> annotationType) {
val target = annotationType.getAnnotation(Target.class);
if(target==null) {
@@ -204,8 +204,8 @@ public final class _Annotations {
return true;
}
}
-
+
return false;
}
-
+
}
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_AttributeMethods.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_AttributeMethods.java
index 8536c6c..2fed91c 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_AttributeMethods.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_AttributeMethods.java
@@ -65,9 +65,9 @@ final class _Annotations_AttributeMethods {
private _Annotations_AttributeMethods(
- @Nullable final Class<? extends Annotation> annotationType,
+ @Nullable final Class<? extends Annotation> annotationType,
final Method[] attributeMethods) {
-
+
this.annotationType = annotationType;
this.attributeMethods = attributeMethods;
this.canThrowTypeNotPresentException = new boolean[attributeMethods.length];
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SyntCache.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SyntCache.java
index 5778393..9a11796 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SyntCache.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SyntCache.java
@@ -33,17 +33,17 @@ import lombok.Value;
import lombok.val;
final class _Annotations_SyntCache {
-
+
// -- L2 CACHE
-
+
@Value(staticConstructor = "of")
private static final class Key {
- AnnotatedElement annotatedElement;
+ AnnotatedElement annotatedElement;
Class<? extends Annotation> annotationType;
}
-
+
private Map<Key, Optional<?>> map = _Maps.newConcurrentHashMap();
-
+
@SuppressWarnings("unchecked")
<A extends Annotation> Optional<A> computeIfAbsent(
AnnotatedElement annotatedElement,
@@ -54,11 +54,11 @@ final class _Annotations_SyntCache {
return (Optional<A>) map.computeIfAbsent(key, __->factory.apply(annotatedElement, annotationType));
}
-
+
// -- L1 CACHE
-
+
private Map<AnnotatedElement, MergedAnnotations> mergedByTarget = _Maps.newConcurrentHashMap();
-
+
MergedAnnotations computeIfAbsent(
AnnotatedElement annotatedElement,
Function<AnnotatedElement, MergedAnnotations> factory) {
@@ -68,7 +68,7 @@ final class _Annotations_SyntCache {
}
// -- CLEANUP
-
+
void clear() {
map.clear();
mergedByTarget.clear();
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SynthesizedMergedAnnotationInvocationHandler.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SynthesizedMergedAnnotationInvocationHandler.java
index 9372bf7..66bf8c0 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SynthesizedMergedAnnotationInvocationHandler.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_Annotations_SynthesizedMergedAnnotationInvocationHandler.java
@@ -54,7 +54,7 @@ import lombok.val;
* @see Annotation
* @see AnnotationUtils#synthesizeAnnotation(Annotation, AnnotatedElement)
*/
-final class _Annotations_SynthesizedMergedAnnotationInvocationHandler<A extends Annotation>
+final class _Annotations_SynthesizedMergedAnnotationInvocationHandler<A extends Annotation>
implements InvocationHandler {
private final MergedAnnotations mergedAnnotations;
@@ -66,9 +66,9 @@ implements InvocationHandler {
private _Annotations_SynthesizedMergedAnnotationInvocationHandler(
- MergedAnnotations mergedAnnotations,
+ MergedAnnotations mergedAnnotations,
Class<A> type) {
-
+
Assert.notNull(mergedAnnotations, "MergedAnnotations must not be null");
Assert.notNull(type, "Type must not be null");
Assert.isTrue(type.isAnnotation(), "Type must be an annotation");
@@ -78,7 +78,7 @@ implements InvocationHandler {
for (int i = 0; i < this.attributes.size(); i++) {
getAttributeValue(this.attributes.get(i));
}
-
+
}
@@ -187,9 +187,9 @@ implements InvocationHandler {
private Object getAttributeValue(Method method) {
String name = method.getName();
Class<?> type = ClassUtils.resolvePrimitiveIfNecessary(method.getReturnType());
-
+
val defaultValue = method.getDefaultValue();
-
+
// for all discovered annotations of this.type determine the effective (attribute) value
val attributeValue = this.mergedAnnotations.stream(this.type)
.map(annotation->(Object)annotation.getValue(name, type).orElse(null))
@@ -197,24 +197,24 @@ implements InvocationHandler {
.filter(value->!value.equals(defaultValue))
.findFirst()
.orElse(defaultValue);
-
+
if(attributeValue==null) {
throw new NoSuchElementException("No value found for attribute named '" + name +
"' in merged annotation " + this.type.getName());
}
-
+
return attributeValue;
-
+
}
@SuppressWarnings("unchecked")
static <A extends Annotation> A createProxy(
- MergedAnnotations mergedAnnotations,
+ MergedAnnotations mergedAnnotations,
Class<A> type) {
-
+
ClassLoader classLoader = type.getClassLoader();
- InvocationHandler handler =
+ InvocationHandler handler =
new _Annotations_SynthesizedMergedAnnotationInvocationHandler<>(mergedAnnotations, type);
Class<?>[] interfaces = isVisible(classLoader, SynthesizedAnnotation.class) ?
new Class<?>[] {type, SynthesizedAnnotation.class} : new Class<?>[] {type};
diff --git a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_MethodCache.java b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_MethodCache.java
index 9f72372..2c613f8 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/reflection/_MethodCache.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/reflection/_MethodCache.java
@@ -40,27 +40,27 @@ import lombok.val;
* These may be changed or removed without notice!
* </p>
* <p>
- * Motivation: JDK reflection API has no Class.getMethod(name, ...) variant that does not produce an expensive
- * stack-trace, when no such method exists.
- * </p>
- * @apiNote
- * thread-save, implements AutoCloseable so we can put it on the _Context, which then automatically
+ * Motivation: JDK reflection API has no Class.getMethod(name, ...) variant that does not produce an expensive
+ * stack-trace, when no such method exists.
+ * </p>
+ * @apiNote
+ * thread-save, implements AutoCloseable so we can put it on the _Context, which then automatically
* takes care of the lifecycle
* @since 2.0
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class _MethodCache implements AutoCloseable {
-
+
public static _MethodCache getInstance() {
return _Context.computeIfAbsent(_MethodCache.class, _MethodCache::new);
}
/**
- * A drop-in replacement for {@link Class#getMethod(String, Class...)} that only looks up
- * public methods and does not throw {@link NoSuchMethodException}s.
+ * A drop-in replacement for {@link Class#getMethod(String, Class...)} that only looks up
+ * public methods and does not throw {@link NoSuchMethodException}s.
*/
public Method lookupMethod(Class<?> type, String name, Class<?>[] paramTypes) {
-
+
synchronized(inspectedTypes) {
if(!inspectedTypes.contains(type)) {
for(val method : type.getMethods()) {
@@ -69,7 +69,7 @@ public final class _MethodCache implements AutoCloseable {
inspectedTypes.add(type);
}
}
-
... 51663 lines suppressed ...