You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proguard renaming of TimeUnit classes can lead to MissingResourceException: Can't find resource for bundle org.ocpsoft.prettytime.i18n.Resources, key ePattern
#222
The bundled proguard rules only keep org.ocpsoft.prettytime.i18n but some ResourceBundle classes rely on TimeUnit.getClass().getSimpleName() which are in org.ocpsoft.prettytime.units and thus allowed to be renamed by proguard.
Solutions I can think of are
Refactor code to not use TimeUnit.getClass().getSimpleName(), it looks like ResourcesTimeUnit.getResourceKeyPrefix() is appropriate but it's not on TimeUnit directly
Update proguard rules to keepnames for org.ocpsoft.prettytime.units, this is easiest to do but feels less than idea. It also slightly feels like it's covering up a deeper problem.
The text was updated successfully, but these errors were encountered:
java.util.MissingResourceException: Can't find resource for bundle org.ocpsoft.prettytime.i18n.Resources, key ePattern
at java.util.ResourceBundle.getObject(ResourceBundle.java:445)
at java.util.ResourceBundle.getObject(ResourceBundle.java:439)
at java.util.ResourceBundle.getString(ResourceBundle.java:402)
at org.ocpsoft.prettytime.i18n.Resources_de$DeTimeFormat.<init>(Resources_de:141)
at org.ocpsoft.prettytime.i18n.Resources_de.getFormatFor(Resources_de:133)
at org.ocpsoft.prettytime.impl.ResourcesTimeFormat.setLocale(ResourcesTimeFormat:52)
at org.ocpsoft.prettytime.impl.ResourcesTimeFormat.setLocale(ResourcesTimeFormat:15)
at org.ocpsoft.prettytime.PrettyTime.registerUnit(PrettyTime:1473)
at org.ocpsoft.prettytime.PrettyTime.addUnit(PrettyTime:1613)
at org.ocpsoft.prettytime.PrettyTime.initTimeUnits(PrettyTime:1597)
at org.ocpsoft.prettytime.PrettyTime.<init>(PrettyTime:98)
at org.ocpsoft.prettytime.PrettyTime.<init>(PrettyTime:86)
```
The bundled proguard rules only keep
org.ocpsoft.prettytime.i18n
but some ResourceBundle classes rely onTimeUnit.getClass().getSimpleName()
which are inorg.ocpsoft.prettytime.units
and thus allowed to be renamed by proguard.For example
prettytime/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java
Line 133 in 3c2206d
Solutions I can think of are
Refactor code to not use
TimeUnit.getClass().getSimpleName()
, it looks likeResourcesTimeUnit.getResourceKeyPrefix()
is appropriate but it's not on TimeUnit directlyUpdate proguard rules to keepnames for
org.ocpsoft.prettytime.units
, this is easiest to do but feels less than idea. It also slightly feels like it's covering up a deeper problem.The text was updated successfully, but these errors were encountered: