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/10/20 07:48:26 UTC

[wicket] branch wicket-9.x updated: WICKET-6927 Get rid of java.security.AccessController

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

mgrigorov pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-9.x by this push:
     new c4a7c87  WICKET-6927 Get rid of java.security.AccessController
c4a7c87 is described below

commit c4a7c8794c2317d621a1ac6c8cdf611023631c45
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Wed Oct 20 10:47:31 2021 +0300

    WICKET-6927 Get rid of java.security.AccessController
---
 .../java/org/apache/wicket/util/string/Strings.java   | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

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 d0cda0f..2b7095a 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
@@ -18,8 +18,6 @@ package org.apache.wicket.util.string;
 
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -53,8 +51,11 @@ public final class Strings
 {
 	/**
 	 * The line separator for the current platform.
+	 *
+	 * @deprecated Use {@link System#lineSeparator()}
 	 */
-	public static final String LINE_SEPARATOR;
+	@Deprecated
+	public static final String LINE_SEPARATOR = System.lineSeparator();
 
 	/** A table of hex digits */
 	private static final char[] HEX_DIGIT = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@@ -78,18 +79,6 @@ public final class Strings
 	 */
 	private static final String SESSION_ID_PARAM = ';' + SESSION_ID_PARAM_NAME + '=';
 
-	static
-	{
-		LINE_SEPARATOR = AccessController.doPrivileged(new PrivilegedAction<String>()
-		{
-			@Override
-			public String run()
-			{
-				return System.getProperty("line.separator");
-			}
-		});
-	}
-
 	/**
 	 * Private constructor prevents construction.
 	 */