Migrates to Apache Commons Configuration 2.x

MSAL

Migrate applications from Apache Commons Configuration 1.x to the latest 2.x release. This recipe changes the dependency, moves the org.apache.commons.configuration package to org.apache.commons.configuration2 and the exceptions to its ex package, replaces the constructors that loaded a file with a FileBasedConfigurationBuilder, moves loading, saving and the file location to a FileHandler, replaces the list delimiter methods with a ListDelimiterHandler, has subclasses of AbstractConfiguration override the Internal methods 2.x calls from the methods it made final, and creates and extends BaseHierarchicalConfiguration where 1.x code used the HierarchicalConfiguration class, which is an interface in 2.x. Configuration 2 no longer splits values at commas by default, so the configurations it creates from a file are given a DefaultListDelimiterHandler(',') to keep reading lists as they did. Modules that exchange Configuration 1 types with a library that is still on 1.x, such as TinkerPop 3.4, Archaius 1 or Hadoop's metrics2, are left alone, as their code has to keep using the types that library declares. Reloading strategies, event listeners and hierarchical configuration nodes have no direct replacement, and are left to be migrated by hand.

org.openrewrite.apache.commons.configuration.UpgradeApacheCommonsConfiguration_1_2
mod run . --recipe=org.openrewrite.apache.commons.configuration.UpgradeApacheCommonsConfiguration_1_2

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.