@@ -64,16 +64,30 @@ public boolean equals(Object other) {
6464 Map <String , Object > thisParameters = this .getParameters ();
6565 otherParameters .remove ("_id_" );
6666 thisParameters .remove ("_id_" );
67+ // Passwords are no longer exposed by API-Manager REST-API - Can't use it anymore to compare the state
68+ Object otherPassword = null ;
69+ Object thisPassword = null ;
6770 if (APIManagerAdapter .hasAPIManagerVersion ("7.7 SP1" ) || APIManagerAdapter .hasAPIManagerVersion ("7.6.2 SP5" )) {
68- // Password no longer exposed by API-Manager REST-API - Can't use it anymore to compare the state
69- otherParameters .remove ("password" );
70- thisParameters .remove ("password" );
71+ // Empty password handling - Make sure, there is a password set
72+ if (!thisParameters .containsKey ("password" ) || thisParameters .get ("password" )==null ) thisParameters .put ("password" , "" );
73+ if (!otherParameters .containsKey ("password" ) || otherParameters .get ("password" )==null ) otherParameters .put ("password" , "" );
74+ if (otherParameters .containsKey ("password" )) {
75+ otherPassword = otherParameters .get ("password" );
76+ otherParameters .remove ("password" );
77+ }
78+ if (thisParameters .containsKey ("password" )) {
79+ thisPassword = thisParameters .get ("password" );
80+ thisParameters .remove ("password" );
81+ }
7182 }
7283
7384 boolean rc = StringUtils .equals (authenticationProfile .getName (), this .getName ())
7485 && authenticationProfile .getIsDefault () == this .getIsDefault ()
7586 && StringUtils .equals (authenticationProfile .getType ().name (),this .getType ().name ())
7687 && otherParameters .equals (thisParameters );
88+ // Restore that password, that have been removed
89+ if (otherPassword !=null ) otherParameters .put ("password" , otherPassword );
90+ if (thisPassword !=null ) thisParameters .put ("password" , thisPassword );
7791 return rc ;
7892 } else {
7993 return false ;
0 commit comments