docs: @Override
      public Set<String> getSwappableAttributes(ExternalContext externalContext) {
          final PortletRequest portletRequest = (PortletRequest) externalContext.getNativeRequest();
          final PortletPreferences preferences = portletRequest.getPreferences();
  
          final Set<String> swappableAttributes;
  
          // Use prefs configured list if available
          final String[] configuredAttributes =
                  preferences.getValues(ATTRIBUTE_SWAPPER_ATTRIBUTES_FORM_SWAPPABLE_ATTRIBUTES, null);
          final String[] excludedAttributes =
                  preferences.getValues(
                          ATTRIBUTE_SWAPPER_ATTRIBUTES_FORM_SWAPPABLE_ATTRIBUTES_EXCLUDES, null);
  
          if (configuredAttributes != null) {
              swappableAttributes = new LinkedHashSet<String>(Arrays.asList(configuredAttributes));
          } else {
              // If no prefs try the 'possibleUserAttributeNames' from the IPersonAttributeDao
              final Set<String> possibleAttributes =
                      this.portalRootPersonAttributeDao.getPossibleUserAttributeNames();
              if (possibleAttributes != null) {
                  swappableAttributes = new TreeSet<String>(possibleAttributes);
              }
              // If no possible names try getting the current user's attributes and use the key set
              else {
                  final Principal currentUser = externalContext.getCurrentUser();
                  final IPersonAttributes baseUserAttributes =
                          this.getOriginalUserAttributes(currentUser.getName());
  
                  if (baseUserAttributes != null) {
                      final Map<String, List<Object>> attributes = baseUserAttributes.getAttributes();
                      swappableAttributes = new LinkedHashSet<String>(attributes.keySet());
                  } else {
                      swappableAttributes = Collections.emptySet();
                  }
              }
          }
  
          if (excludedAttributes != null) {
              for (final String excludedAttribute : excludedAttributes) {
                  swappableAttributes.remove(excludedAttribute);
              }
          }
  
          return swappableAttributes;
      }