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 2022/08/04 05:23:57 UTC

[isis] branch master updated (5bac54aac0 -> 590d59d4fb)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


 discard 5bac54aac0 ISIS-3109: prepare InteractionContext to be amended with time-zone info
     new 590d59d4fb ISIS-3109: prepare InteractionContext to be amended with time-zone info

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5bac54aac0)
            \
             N -- N -- N   refs/heads/master (590d59d4fb)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/isis/applib/services/iactnlayer/InteractionContext.java | 3 ---
 1 file changed, 3 deletions(-)


[isis] 01/01: ISIS-3109: prepare InteractionContext to be amended with time-zone info

Posted by ah...@apache.org.
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

commit 590d59d4fb0042c5bb025f9ecdc34280bd850d66
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Aug 4 07:22:09 2022 +0200

    ISIS-3109: prepare InteractionContext to be amended with time-zone info
---
 .../isis/applib/services/iactnlayer/InteractionContext.java      | 9 ++++++++-
 .../core/runtimeservices/user/ImpersonatedUserHolderDefault.java | 2 +-
 .../user/UserCurrentSessionTimeZoneHolderDefault.java            | 5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/iactnlayer/InteractionContext.java b/api/applib/src/main/java/org/apache/isis/applib/services/iactnlayer/InteractionContext.java
index 8674074bd7..11b46d703a 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/iactnlayer/InteractionContext.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/iactnlayer/InteractionContext.java
@@ -102,7 +102,14 @@ public class InteractionContext implements Serializable {
 
     @With @Getter @Builder.Default
     final @NonNull ZoneId timeZone = ZoneId.systemDefault();
-
+    /**
+     * Only override if zoneIdIfAny is present, otherwise acts as identity operation.
+     */
+    public InteractionContext withTimeZoneIfAny(final Optional<ZoneId> zoneIdIfAny) {
+        return zoneIdIfAny
+                .map(this::withTimeZone)
+                .orElse(this);
+    }
 
     /**
      * Convenience method for use with {@link org.apache.isis.applib.services.sudo.SudoService}, returning a
diff --git a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/ImpersonatedUserHolderDefault.java b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/ImpersonatedUserHolderDefault.java
index 1fb34681aa..2e4b64dacf 100644
--- a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/ImpersonatedUserHolderDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/ImpersonatedUserHolderDefault.java
@@ -39,7 +39,7 @@ public class ImpersonatedUserHolderDefault implements ImpersonatedUserHolder {
     private static final String SESSION_KEY_IMPERSONATED_USER =
             ImpersonatedUserHolderDefault.class.getName() + "#userMemento";
 
-    @Inject private Optional<KeyValueSessionStore> keyValueSessionStore;
+    @Inject private Optional<KeyValueSessionStore> keyValueSessionStore = Optional.empty();
 
     @Override
     public boolean supportsImpersonation() {
diff --git a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/UserCurrentSessionTimeZoneHolderDefault.java b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/UserCurrentSessionTimeZoneHolderDefault.java
index 1979cee4a8..cbe3d1c60b 100644
--- a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/UserCurrentSessionTimeZoneHolderDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/user/UserCurrentSessionTimeZoneHolderDefault.java
@@ -36,12 +36,13 @@ import lombok.NonNull;
 @Service
 @Named(IsisModuleCoreRuntimeServices.NAMESPACE + ".UserCurrentSessionTimeZoneHolderDefault")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
-public class UserCurrentSessionTimeZoneHolderDefault implements UserCurrentSessionTimeZoneHolder {
+public class UserCurrentSessionTimeZoneHolderDefault
+implements UserCurrentSessionTimeZoneHolder {
 
     private static final String SESSION_KEY_ZONE_ID =
             UserCurrentSessionTimeZoneHolderDefault.class.getName() + "#zoneId";
 
-    @Inject private Optional<KeyValueSessionStore> keyValueSessionStore;
+    @Inject private Optional<KeyValueSessionStore> keyValueSessionStore = Optional.empty();
 
     @Override
     public void setUserTimeZone(final @NonNull ZoneId zoneId) {