UserService.saveUser Change in Platform 2.x

I am doing some work to update the OpenHMIS modules to platform 2.0 and am running into an issue with a change to the UserService class. The saveUser method signature has been changed from saveUser(User user, String password) to saveUser(User user). While this seems like a good change, it is not backwards compatible and makes our code difficult to manage given that we want to continue support for pre-2.x versions of omrs.

Is there any advice on how to support pre-2.x as well as 2.x versions of the platform? Also, why was this change made without some period of time where the old method was deprecated?

About supporting multiple platform versions, you could look at this: https://wiki.openmrs.org/display/docs/Supporting+different+OpenMRS+versions https://wiki.openmrs.org/display/docs/Supporting+Platform+2.0+and+below

In regards to the saveUser change, this ticket will give you details: https://issues.openmrs.org/browse/TRUNK-3871

Just incase you find this example useful: https://github.com/openmrs/openmrs-module-adminui/commit/108195bdb0345ac06ffa48ea867547de6a4d2b02

Thanks for the quick reply and for the workaround example. However, I think the fact that you have to use reflection to make it work shows that this simple change was not done in the correct way!

@ibewes reflection is just a hack for the lazy. The recommended way is as per the wiki links i gave above. Here is an example of the non hacky way: https://issues.openmrs.org/browse/RESTWS-585 In summary, your module ends up with a 1.x and 2.x sub modules.