Skip to content

Commit

Permalink
[#1975][#1976] javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Mar 24, 2023
1 parent e5a02c4 commit 0a7b9b9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -17805,13 +17805,21 @@ static boolean ansiPossible() {
if (!isTTY() && !isPseudoTTY()) { return false; }
return hintEnabled() || !isWindows() || isXterm() || isCygwin() || hasOsType();
}
/** Caches the result of method isJansiConsoleInstalled so it doesn't repeatedly
/** Caches the result of method {@link #isJansiConsoleInstalled()} so it doesn't repeatedly
* call Class#forName, which can cause performance issues. */
static Boolean jansiInstalled;
/** The first time this method is called, it invokes the
* {@link #calcIsJansiConsoleInstalled()} method, caches its result and returns this result;
* subsequently it returns the cached result. */
static boolean isJansiConsoleInstalled() {
if (jansiInstalled == null) { jansiInstalled = calcIsJansiConsoleInstalled(); }
return jansiInstalled;
}
/** Returns {@code false} if system property {@code org.fusesource.jansi.Ansi.disable} is set to {@code "true"}
* (case-insensitive); otherwise, returns {@code false} if the Jansi library is in the classpath but has been disabled
* (either via system property {@code org.fusesource.jansi.Ansi.disable} or via a Jansi API call);
* otherwise, returns {@code true} if the Jansi library is in the classpath and has been installed.
*/
static boolean calcIsJansiConsoleInstalled() {
try {
// first check if JANSI was explicitly disabled _without loading any JANSI classes_:
Expand Down

0 comments on commit 0a7b9b9

Please sign in to comment.