Home / Function/ tryUpdate() — spring-boot Function Reference

tryUpdate() — spring-boot Function Reference

Architecture documentation for the tryUpdate() function in SpringIterableConfigurationPropertySource.java from the spring-boot codebase.

Function java GradlePlugin AotProcessing calls 5 called by 1

Entity Profile

Dependency Diagram

graph TD
  b78eeddd_2e0e_efb7_0738_fc074f96550d["tryUpdate()"]
  5c7a3f81_490e_ee66_15d5_59ae6b4004fb["update()"]
  5c7a3f81_490e_ee66_15d5_59ae6b4004fb -->|calls| b78eeddd_2e0e_efb7_0738_fc074f96550d
  fa5c1149_2d3e_3b9e_ea6d_17d60915c544["cloneOrCreate()"]
  b78eeddd_2e0e_efb7_0738_fc074f96550d -->|calls| fa5c1149_2d3e_3b9e_ea6d_17d60915c544
  a83f377e_de0a_1ccb_7113_f60c7e4da351["copySource()"]
  b78eeddd_2e0e_efb7_0738_fc074f96550d -->|calls| a83f377e_de0a_1ccb_7113_f60c7e4da351
  1ff371a1_2d4b_7887_987e_74cd223d208b["add()"]
  b78eeddd_2e0e_efb7_0738_fc074f96550d -->|calls| 1ff371a1_2d4b_7887_987e_74cd223d208b
  8530bbd0_1062_fdb6_5a1d_de0c0c1b1e12["addParents()"]
  b78eeddd_2e0e_efb7_0738_fc074f96550d -->|calls| 8530bbd0_1062_fdb6_5a1d_de0c0c1b1e12
  c08472d1_0523_dcc9_5df2_017ca9268c5a["get()"]
  b78eeddd_2e0e_efb7_0738_fc074f96550d -->|calls| c08472d1_0523_dcc9_5df2_017ca9268c5a
  style b78eeddd_2e0e_efb7_0738_fc074f96550d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java lines 258–292

		private void tryUpdate(EnumerablePropertySource<?> propertySource) {
			Data data = this.data;
			String[] lastUpdated = (data != null) ? data.lastUpdated() : null;
			String[] propertyNames = propertySource.getPropertyNames();
			if (lastUpdated != null && Arrays.equals(lastUpdated, propertyNames)) {
				return;
			}
			int size = propertyNames.length;
			Map<ConfigurationPropertyName, Set<String>> mappings = cloneOrCreate(
					(data != null) ? data.mappings() : null, size);
			Map<String, ConfigurationPropertyName> reverseMappings = cloneOrCreate(
					(data != null) ? data.reverseMappings() : null, size);
			Set<ConfigurationPropertyName> descendants = (!this.captureDescendants) ? null : new HashSet<>();
			Map<String, Object> systemEnvironmentCopy = (!this.systemEnvironmentSource) ? null
					: copySource(propertySource);
			for (PropertyMapper propertyMapper : this.mappers) {
				for (String propertyName : propertyNames) {
					if (!reverseMappings.containsKey(propertyName)) {
						ConfigurationPropertyName configurationPropertyName = propertyMapper.map(propertyName);
						if (configurationPropertyName != null && !configurationPropertyName.isEmpty()) {
							add(mappings, configurationPropertyName, propertyName);
							reverseMappings.put(propertyName, configurationPropertyName);
						}
					}
				}
			}
			for (String propertyName : propertyNames) {
				addParents(descendants, reverseMappings.get(propertyName));
			}
			ConfigurationPropertyName[] configurationPropertyNames = this.immutable
					? reverseMappings.values().toArray(new ConfigurationPropertyName[0]) : null;
			lastUpdated = this.immutable ? null : propertyNames;
			this.data = new Data(mappings, reverseMappings, descendants, configurationPropertyNames,
					systemEnvironmentCopy, lastUpdated);
		}

Domain

Subdomains

Calls

Called By

  • update()

Frequently Asked Questions

What does tryUpdate() do?
tryUpdate() is a function in the spring-boot codebase.
What does tryUpdate() call?
tryUpdate() calls 5 function(s): add, addParents, cloneOrCreate, copySource, get.
What calls tryUpdate()?
tryUpdate() is called by 1 function(s): update.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free