You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2022/08/10 07:12:56 UTC
[wicket] branch master updated: WICKET-6996: NotSerializableException near KeyInSessionSunJceCryptFactory
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new c0623d5a2f WICKET-6996: NotSerializableException near KeyInSessionSunJceCryptFactory
c0623d5a2f is described below
commit c0623d5a2fecd6b836d98dd9def5dbce4a75f82b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Wed Aug 10 10:12:21 2022 +0300
WICKET-6996: NotSerializableException near KeyInSessionSunJceCryptFactory
Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
.../wicket/core/util/crypt/AbstractKeyInSessionCryptFactory.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractKeyInSessionCryptFactory.java b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractKeyInSessionCryptFactory.java
index b4065824d9..f1cc2b2ae0 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractKeyInSessionCryptFactory.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractKeyInSessionCryptFactory.java
@@ -16,6 +16,8 @@
*/
package org.apache.wicket.core.util.crypt;
+import java.io.Serializable;
+
import org.apache.wicket.MetaDataKey;
import org.apache.wicket.Session;
import org.apache.wicket.util.crypt.ICrypt;
@@ -37,7 +39,7 @@ public abstract class AbstractKeyInSessionCryptFactory<T extends IClusterable>
ICryptFactory
{
/** metadata-key used to store crypto-key in session metadata */
- private final MetaDataKey<T> KEY = new MetaDataKey<T>()
+ private static final MetaDataKey<Serializable> KEY = new MetaDataKey<>()
{
private static final long serialVersionUID = 1L;
};
@@ -55,7 +57,7 @@ public abstract class AbstractKeyInSessionCryptFactory<T extends IClusterable>
session.bind();
// retrieve or generate encryption key from session
- T key = session.getMetaData(KEY);
+ T key = (T) session.getMetaData(KEY);
if (key == null)
{
// generate new key
@@ -81,4 +83,4 @@ public abstract class AbstractKeyInSessionCryptFactory<T extends IClusterable>
* @return the {@link org.apache.wicket.util.crypt.ICrypt} to use
*/
protected abstract ICrypt createCrypt(T key);
-}
\ No newline at end of file
+}