Use the Commons Configuration 2.x hierarchical configuration types
MSALConfiguration 2 made HierarchicalConfiguration a generic interface, which BaseHierarchicalConfiguration implements, and returns the sub configurations of configurationsAt as HierarchicalConfiguration<ImmutableNode>. This creates and extends BaseHierarchicalConfiguration where 1.x code created or extended HierarchicalConfiguration, and gives HierarchicalConfiguration the ImmutableNode type argument, which every hierarchical configuration of 2.x has, where variables, methods, casts and type arguments refer to it, as the raw type has none of the generic types of its methods, such as the List that configurationsAt returns. This recipe matches the 1.x API by the names the move to the org.apache.commons.configuration2 package gives it, and is meant to run as part of UpgradeApacheCommonsConfiguration_1_2.
org. openrewrite. apache. commons. configuration. MigrateHierarchicalConfigurationsmod run . --recipe= org. openrewrite. apache. commons. configuration. MigrateHierarchicalConfigurationsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.