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

bdemers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shiro.git


The following commit(s) were added to refs/heads/master by this push:
     new 0cd06f1  SHIRO-711 - Deprecate JavaEnvironment
     new eb17dec  Merge pull request #156 from coheigea/SHIRO-711
0cd06f1 is described below

commit 0cd06f188190ccb4c8f1556d9582d08cbf542400
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Thu Jun 27 14:15:14 2019 +0100

    SHIRO-711 - Deprecate JavaEnvironment
---
 core/src/main/java/org/apache/shiro/util/JavaEnvironment.java       | 2 ++
 .../hasher/src/main/java/org/apache/shiro/tools/hasher/Hasher.java  | 6 ------
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java 
b/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
index 1dcb79b..3a9e1bb 100644
--- a/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
+++ b/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
@@ -31,7 +31,9 @@ package org.apache.shiro.util;
  * thanks to Rod Johnson, Juergen Hoeller, and Rick Evans for making this 
available.</em>
  *
  * @since 0.2
+ * @deprecated This class is no longer used in Shiro and will be removed in 
the next major version.
  */
+@Deprecated
 public abstract class JavaEnvironment {
 
     /**
diff --git 
a/tools/hasher/src/main/java/org/apache/shiro/tools/hasher/Hasher.java 
b/tools/hasher/src/main/java/org/apache/shiro/tools/hasher/Hasher.java
index 435e2f9..954ef8b 100644
--- a/tools/hasher/src/main/java/org/apache/shiro/tools/hasher/Hasher.java
+++ b/tools/hasher/src/main/java/org/apache/shiro/tools/hasher/Hasher.java
@@ -40,7 +40,6 @@ import org.apache.shiro.crypto.hash.format.HexFormat;
 import org.apache.shiro.crypto.hash.format.Shiro1CryptFormat;
 import org.apache.shiro.io.ResourceUtils;
 import org.apache.shiro.util.ByteSource;
-import org.apache.shiro.util.JavaEnvironment;
 import org.apache.shiro.util.StringUtils;
 
 import java.io.File;
@@ -443,11 +442,6 @@ public final class Hasher {
     }
 
     private static char[] readPassword(boolean confirm) {
-        if (!JavaEnvironment.isAtLeastVersion16()) {
-            String msg = "Password hashing (prompt without echo) uses the 
java.io.Console to read passwords " +
-                    "safely.  This is only available on Java 1.6 platforms and 
later.";
-            throw new IllegalArgumentException(msg);
-        }
         java.io.Console console = System.console();
         if (console == null) {
             throw new IllegalStateException("java.io.Console is not available 
on the current JVM.  Cannot read passwords.");

Reply via email to