Allow secret to convert to itself
Reduces warning logs when exporting config via JCasC
@@ -303,6 +303,10 @@ public final class Secret implements Serializable {
static {
Stapler.CONVERT_UTILS.register(new org.apache.commons.beanutils.Converter() {
public Secret convert(Class type, Object value) {
+ if (value instanceof Secret) {
+ return (Secret) value;
+ }
+
return Secret.fromString(value.toString());
}
}, Secret.class);
