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 2021/11/14 19:59:06 UTC

[wicket] branch master updated: Remove 'final' modifier from a static field

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 191de98  Remove 'final' modifier from a static field
191de98 is described below

commit 191de985e22b9e0801d5783fbcfa151a25d29ec8
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Sun Nov 14 21:56:30 2021 +0200

    Remove 'final' modifier from a static field
    
    Because it is not possible to modify it in JDK 18 b23.
    The OpenJDK team is informed.
    They will probably fix the regression. Or document it that it is not possible anymore to do such hacks.
    
    https://github.com/openjdk/jdk/pull/5027#issuecomment-968177213
---
 wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java b/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java
index 254e554..19c3037 100755
--- a/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java
+++ b/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java
@@ -69,7 +69,9 @@ public final class Strings
 	 * Constructs something like <em>;jsessionid=</em>. This is what {@linkplain Strings#stripJSessionId(String)}
 	 * actually uses.
 	 */
-	private static final String SESSION_ID_PARAM = ';' + SESSION_ID_PARAM_NAME + '=';
+	// the field is not 'final' because we need to modify it in a unit test
+	// see https://github.com/openjdk/jdk/pull/5027#issuecomment-968177213
+	private static String SESSION_ID_PARAM = ';' + SESSION_ID_PARAM_NAME + '=';
 
 	/**
 	 * Private constructor prevents construction.