Source:
public void updateForLocation( final String pid, String location, Map<String, Object> configurationTable) throws IOException { if (pid == null || pid.length() < 1) throw loggedException(ILLEGAL_PID_MESSAGE); if (configurationTable == null) throw loggedException(ILLEGAL_TABLE_MESSAGE); final Configuration config = configurationAdmin.getConfiguration(pid, location); if (isPermittedToViewService(config.getPid())) { final Metatype metatype = configurationAdminImpl.findMetatypeForConfig(config); if (metatype == null) throw loggedException("Could not find metatype for " + pid); final List<Map.Entry<String, Object>> configEntries = new ArrayList<>(); CollectionUtils.addAll(configEntries, configurationTable.entrySet().iterator()); CollectionUtils.transform( configEntries, new CardinalityTransformer(metatype.getAttributeDefinitions(), pid)); final Dictionary<String, Object> configProperties = config.getProperties(); final Dictionary<String, Object> newConfigProperties = (configProperties != null) ? configProperties : new Hashtable<>(); for (Map.Entry<String, Object> configEntry : configEntries) { final String configEntryKey = configEntry.getKey(); Object configEntryValue = sanitizeUIConfiguration(pid, configEntryKey, configEntry.getValue()); if (configEntryValue.equals("password")) { for (Map<String, Object> metatypeProperties : metatype.getAttributeDefinitions()) { if (metatypeProperties.get("id").equals(configEntry.getKey()) && AttributeDefinition.PASSWORD == (Integer) metatypeProperties.get("type") && configProperties != null) { configEntryValue = configProperties.get(configEntryKey); break; } } } newConfigProperties.put(configEntryKey, configEntryValue); } config.update(newConfigProperties); } }

Target:
public void updateForLocation( final String pid, String location, Map<String, Object> configurationTable) throws IOException { if (pid == null || pid.length() < 1) { throw loggedException(ILLEGAL_PID_MESSAGE); } if (configurationTable == null) { throw loggedException(ILLEGAL_TABLE_MESSAGE); } final Configuration config = configurationAdmin.getConfiguration(pid, location); if (isPermittedToViewService(config.getPid())) { final Metatype metatype = configurationAdminImpl.findMetatypeForConfig(config); if (metatype == null) { throw loggedException("Could not find metatype for " + pid); } final List<Map.Entry<String, Object>> configEntries = new ArrayList<>(); CollectionUtils.addAll(configEntries, configurationTable.entrySet().iterator()); CollectionUtils.transform( configEntries, new CardinalityTransformer(metatype.getAttributeDefinitions(), pid)); final Dictionary<String, Object> configProperties = config.getProperties(); final Dictionary<String, Object> newConfigProperties = (configProperties != null) ? configProperties : new Hashtable<>(); for (Map.Entry<String, Object> configEntry : configEntries) { final String configEntryKey = configEntry.getKey(); Object configEntryValue = sanitizeUIConfiguration(pid, configEntryKey, configEntry.getValue()); if (configEntryValue.equals("password")) { for (Map<String, Object> metatypeProperties : metatype.getAttributeDefinitions()) { if (metatypeProperties.get("id").equals(configEntry.getKey()) && AttributeDefinition.PASSWORD == (Integer) metatypeProperties.get("type") && configProperties != null) { configEntryValue = configProperties.get(configEntryKey); break; } } } newConfigProperties.put(configEntryKey, configEntryValue); } config.update(newConfigProperties); } }