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:

In regards to the saveUser change, this ticket will give you details:

Just incase you find this example useful:

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: In summary, your module ends up with a 1.x and 2.x sub modules.