Last active
January 3, 2019 15:15
-
-
Save martinsson/786068e4ca243ffdc48be2a2a47eb99b to your computer and use it in GitHub Desktop.
Using a instance method as a proxy to the real method we can fake it to avoid calling the real method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this method is fakable | |
public String getTranslation(String key, Locale locale) { | |
return getTranslationOld(key, locale); | |
} | |
/** | |
* @deprecated use instance method instead | |
*/ | |
public static String getTranslationOld(String key, Locale locale) { | |
Object keys = getTranslationMap().get(locale.toString()); | |
// logic ... | |
// etc ... | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment