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

compare() — spring-boot Function Reference

Architecture documentation for the compare() function in ConfigurationPropertyName.java from the spring-boot codebase.

Function java GradlePlugin AotProcessing calls 5 called by 1

Entity Profile

Dependency Diagram

graph TD
  2c78d023_61db_8b75_0bb3_5482fd3d06a7["compare()"]
  28ea3a21_2e68_722d_2cd7_9880103d0770["compareTo()"]
  28ea3a21_2e68_722d_2cd7_9880103d0770 -->|calls| 2c78d023_61db_8b75_0bb3_5482fd3d06a7
  5acc70e6_66e3_8996_e541_fcd335154b61["getNumberOfElements()"]
  2c78d023_61db_8b75_0bb3_5482fd3d06a7 -->|calls| 5acc70e6_66e3_8996_e541_fcd335154b61
  8d8ef66e_fc29_736c_c815_846df9fa8305["getType()"]
  2c78d023_61db_8b75_0bb3_5482fd3d06a7 -->|calls| 8d8ef66e_fc29_736c_c815_846df9fa8305
  bc164715_9139_37ca_1cb7_07a5191210d7["getElement()"]
  2c78d023_61db_8b75_0bb3_5482fd3d06a7 -->|calls| bc164715_9139_37ca_1cb7_07a5191210d7
  50ab77a1_5a37_b789_ed17_ece7194cd0be["isIndexed()"]
  2c78d023_61db_8b75_0bb3_5482fd3d06a7 -->|calls| 50ab77a1_5a37_b789_ed17_ece7194cd0be
  28ea3a21_2e68_722d_2cd7_9880103d0770["compareTo()"]
  2c78d023_61db_8b75_0bb3_5482fd3d06a7 -->|calls| 28ea3a21_2e68_722d_2cd7_9880103d0770
  style 2c78d023_61db_8b75_0bb3_5482fd3d06a7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java lines 311–332

	private int compare(ConfigurationPropertyName n1, ConfigurationPropertyName n2) {
		int l1 = n1.getNumberOfElements();
		int l2 = n2.getNumberOfElements();
		int i1 = 0;
		int i2 = 0;
		while (i1 < l1 || i2 < l2) {
			try {
				ElementType type1 = (i1 < l1) ? n1.elements.getType(i1) : null;
				ElementType type2 = (i2 < l2) ? n2.elements.getType(i2) : null;
				String e1 = (i1 < l1) ? n1.getElement(i1++, Form.UNIFORM) : null;
				String e2 = (i2 < l2) ? n2.getElement(i2++, Form.UNIFORM) : null;
				int result = compare(e1, type1, e2, type2);
				if (result != 0) {
					return result;
				}
			}
			catch (ArrayIndexOutOfBoundsException ex) {
				throw new RuntimeException(ex);
			}
		}
		return 0;
	}

Domain

Subdomains

Called By

  • compareTo()

Frequently Asked Questions

What does compare() do?
compare() is a function in the spring-boot codebase.
What does compare() call?
compare() calls 5 function(s): compareTo, getElement, getNumberOfElements, getType, isIndexed.
What calls compare()?
compare() is called by 1 function(s): compareTo.

Analyze Your Own Codebase

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

Try Supermodel Free