public static String get(final String key, String def) {
        if (key == null) {
            throw new NullPointerException("key");
        }
        if (key.isEmpty()) {
            throw new IllegalArgumentException("key must not be empty.");
        }

        String value = null;
        try {
            if (System.getSecurityManager() == null) {
                value = System.getProperty(key);
            } else {
                value = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(key));
            }
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) {
                LOG.warn("Unable to retrieve a system property '{}'; default values will be used, {}.", key, e);
            }
        }

        if (value == null) {
            return def;
        }

        return value;
    }
Returns the value of the Java system property with the
specified {@code key}, while falling back to the specified
default value if the property access fails.

@return the property value.
{@code def} if there's no such property or if an access to
the specified property is not allowed.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/SystemPropertyUtil.java