private static String rightTrim0(final String string, String defaultString) {
        if (string == null) {
            return defaultString;
        }
        if (string.isEmpty()) {
            return "";
        }
        final int length = string.length();
        int index = length - 1;
        while (index >= 0 && string.charAt(index) <= ' ') {
            index--;
        }
        index++;

        if (index == length) {
            return string;
        } else {
            return string.substring(0, index);
        }
    }
@deprecated Since 3.1.0. Use {@link Objects#toString(Object, String)}
commons/src/main/java/com/navercorp/pinpoint/common/util/StringUtils.java