code: private void changeReferenceDataValuesInComponents(final ReferenceData oldReferenceData,
              final ReferenceData newReferenceData, final Class<?> referenceDataClass) {
          final Collection<ComponentBuilder> componentBuilders = _analysisJobBuilder.getComponentBuilders();
          for (final ComponentBuilder componentBuilder : componentBuilders) {
              final Map<ConfiguredPropertyDescriptor, Object> configuredProperties =
                      componentBuilder.getConfiguredProperties();
              for (final Map.Entry<ConfiguredPropertyDescriptor, Object> entry : configuredProperties.entrySet()) {
                  final ConfiguredPropertyDescriptor propertyDescriptor = entry.getKey();
                  if (referenceDataClass.isAssignableFrom(propertyDescriptor.getBaseType())) {
                      final Object valueObject = entry.getValue();
                      // In some cases the configured property is an array
                      if (valueObject.getClass().isArray()) {
                          final Object[] values = (Object[]) valueObject;
                          for (int i = 0; i < values.length; i++) {
                              if (oldReferenceData.equals(values[i])) {
                                  // change the old value of the pattern in the
                                  // array with the new value
                                  values[i] = newReferenceData;
                              }
                          }
                      } else {
                          if (oldReferenceData.equals(valueObject)) {
                              componentBuilder.setConfiguredProperty(propertyDescriptor, newReferenceData);
                          }
                      }
                  }
              }
          }
      }
docs: Method used to change the reference data(String Patterns, Dictionaries,
  Synonyms) components' values in components
  
  @param oldReferenceData
  @param newReferenceData
  @param referenceDataClass