package Ġcom . github . ker ub istan . ker ub . utils . spring Ċ Ċ import Ġcom . github . ker ub istan . ker ub . utils . filter By Keys Ċ import Ġcom . github . ker ub istan . ker ub . utils . getLogger Ċ import Ġorg . springframework . beans . factory . config . Configurable List able BeanFactory Ċ import Ġorg . springframework . beans . factory . config . Property Override Configurer Ċ import Ġjava . util . Properties Ċ Ċ class ĠBean Override Configurer Ġ: ĠProperty Override Configurer () Ġ{ ĊĊ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ private Ġval Ġlog Ġ= Ġget Logger ( Bean Override Configurer :: class ) Ċĉ ĉ private Ġconst Ġval Ġclass Over ide Suffix Ġ= Ġ". class " Ċĉ ĉ private Ġval Ġclass Override Filter : Ġ( String ) Ġ-> ĠBoolean Ġ= Ġ{ Ġit . endsWith ( class Over ide Suffix ) Ġ} Ċĉ ĉ private Ġval Ġproperty Override Filter : Ġ( String ) Ġ-> ĠBoolean Ġ= Ġ{ Ġ! class Override Filter ( it ) Ġ} Ċ ĉ } ĊĊ ĉ override Ġfun Ġprocess Properties ( bean Factory : ĠConfigur able List able BeanFactory , Ġprops : ĠProperties ) Ġ{ Ċĉ ĉ val Ġprop Overrides Ġ= Ġprops . filter By Keys ( property Override Filter ) Ċĉ ĉ props . filter By Keys ( class Override Filter ). forEach Ġ{ Ġkey , Ġvalue Ġ-> Ċĉĉ ĉ val Ġbean Name Ġ= Ġkey . toString (). substring Before ( class Over ide Suffix ) Ċĉĉ ĉ bean Factory . getBean Definition ( bean Name ). let Ġ{ Ġdef Ġ-> Ċĉĉĉ ĉ log . info (" override Ġ{} Ġclass Ġfrom Ġ{} Ġto Ġ{}", Ġbean Name , Ġdef . bean ClassName , Ġvalue ) Ċĉĉĉ ĉ def . bean ClassName Ġ= Ġvalue . toString () Ċĉĉĉ ĉ // the Ġold Ġvalues Ġno Ġlonger Ġapply Ċĉĉĉ ĉ log . info ("{} : Ġdefault Ġproperties Ġcleared ", Ġbean Name ) Ċĉĉĉ ĉ def . property Values . property Value List . clear () Ċĉĉ ĉ } ĊĊĉ ĉ } Ċĉ ĉ super . process Properties ( bean Factory , Ġprop Overrides ) Ċ ĉ } Ċ Ċ }