-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NumberFormatException for ValueResolver.getDefaultResolvers on Android #1026
Comments
This has become a larger problem with older versions of Wiremock using dependencies with CVEs open against them, nessicating an upgrade which would entail the use of this version of Handlebars - which then fails due to this issue. |
@jknack do you have any plan to fix this issue? It's not possible to use newer versions of this library on Android where the older versions are facing open CVEs. |
The previous implementation used a property that was probably always 0. Now it uses a property that is always 0.9 if I am not mistaken. https://developer.android.com/reference/java/lang/System#getProperties() |
I have made an attempt to work around this issue. Please review this PR #1074. |
it seems to be the same problem as #937. I'm also struggling with this problem, and I hope it gets resolved quickly. |
When running handlebars on Android as part of WireMock. Getting a NumberFormatException when Handlebars.Util tries to get the javaVersion(). The value is returned as a string "0.9" in Android.
static int javaVersion() {
String version = System.getProperty("java.specification.version").trim();
return Integer.parseInt(version.replace(VERSION_PREFIX, ""));
}
If for some reason that the Integer can't be parsed, we get a NumberFormat exception. If this is the case can a default version be provided/. Or have Value Resolver catch the exception and return the default list of MapValueResolver, JavaBeanValueResolver instead of crashing.
The text was updated successfully, but these errors were encountered: