File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
config/ogdl/src/main/java/org/apache/shiro/config/ogdl Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,6 @@ private String parseBeanId(String lhs) {
271271 public Map <String , ?> buildObjects (Map <String , String > kvPairs ) {
272272
273273 if (kvPairs != null && !kvPairs .isEmpty ()) {
274-
275274 BeanConfigurationProcessor processor = new BeanConfigurationProcessor ();
276275
277276 for (Map .Entry <String , String > entry : kvPairs .entrySet ()) {
@@ -287,10 +286,15 @@ private String parseBeanId(String lhs) {
287286 }
288287
289288 processor .execute ();
290- }
291289
292- //SHIRO-413: init method must be called for constructed objects that are Initializable
293- LifecycleUtils .init (objects .values ());
290+ //SHIRO-778: onInit method on AuthenticatingRealm is called twice
291+ objects .keySet ().stream ()
292+ .filter (key -> !kvPairs .keySet ().contains (key ))
293+ .forEach (key -> LifecycleUtils .init (objects .get (key )));
294+ } else {
295+ //SHIRO-413: init method must be called for constructed objects that are Initializable
296+ LifecycleUtils .init (objects .values ());
297+ }
294298
295299 return objects ;
296300 }
You can’t perform that action at this time.
0 commit comments