private Object[] getFields(ClientDetails clientDetails) {
   Object[] fieldsForUpdate = getFieldsForUpdate(clientDetails);
   Object[] fields = new Object[fieldsForUpdate.length + 1];
   System.arraycopy(fieldsForUpdate, 0, fields, 1, fieldsForUpdate.length);
   fields[0] =
       clientDetails.getClientSecret() != null
           ? passwordEncoder.encode(clientDetails.getClientSecret())
           : null;
   return fields;
 }
 public BaseClientDetails(ClientDetails prototype) {
   this();
   setAccessTokenValiditySeconds(prototype.getAccessTokenValiditySeconds());
   setRefreshTokenValiditySeconds(prototype.getRefreshTokenValiditySeconds());
   setAuthorities(prototype.getAuthorities());
   setAuthorizedGrantTypes(prototype.getAuthorizedGrantTypes());
   setClientId(prototype.getClientId());
   setClientSecret(prototype.getClientSecret());
   setRegisteredRedirectUri(prototype.getRegisteredRedirectUri());
   setScope(prototype.getScope());
   setResourceIds(prototype.getResourceIds());
 }