@@ -66,25 +66,25 @@ private void updateConfig(Properties props) {
6666 for (Map .Entry <Object , Object > en : props .entrySet ()) {
6767 String key = en .getKey ().toString ();
6868 String value = en .getValue ().toString ();
69+ Integer existingPrio = priorities .get (key );
6970 int prio = 0 ;
70- if (value .contains ("{prio=" )) {
71+ if (value .startsWith ("{prio=" )) {
7172 int index = value .indexOf ('}' );
7273 if (index > 0 ) {
7374 String prioString = value .substring ("{prio=" .length (),
74- index - 1 );
75+ index );
7576 value = value .substring (index + 1 );
7677 prio = Integer .parseInt (prioString );
77- this . priorities .put (key , prio );
78+ priorities .put (key , prio );
7879 }
7980 }
80- Integer existingPrio = priorities .get (key );
8181 if (Objects .isNull (existingPrio )) {
82- this . config .put (key , value );
82+ config .put (key , value );
8383 } else if (existingPrio < prio ) {
84- this . config .put (key , value );
84+ config .put (key , value );
8585 } else if (existingPrio == prio ) {
8686 throw new IllegalStateException (
87- "AmbigousConfiguration detected for '" + key + "'." );
87+ "AmbiguousConfiguration detected for '" + key + "'." );
8888 }
8989 // else ignore entry with lower prio!
9090 }
0 commit comments