@Override
    @Deprecated
    public String toString() {
        final String from = new Throwable().getStackTrace()[1].toString();
        LOGGER.warning("Use of toString() on hudson.util.Secret from " + from + ". Prefer getPlainText() or getEncryptedValue() depending your needs. see https://www.jenkins.io/redirect/hudson.util.Secret/");
        return value;
    }
@Test
    public void testCompatibilityFromString() {
        String tagName = Foo.class.getName().replace("$", "_-");
        String xml = "<" + tagName + "><password>secret</password></" + tagName + ">";
        Foo foo = new Foo();
        Jenkins.XSTREAM.fromXML(xml, foo);
        assertEquals("secret", Secret.toString(foo.password));
    }