fix: update GoogleUtils#getVersion() to use stable logic#1452
Conversation
elharo
left a comment
There was a problem hiding this comment.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.google.api.client.googleapis.services.json.CommonGoogleJsonClientRequestInitializerTest
[ERROR] testInitialize(com.google.api.client.googleapis.services.json.CommonGoogleJsonClientRequestInitializerTest) Time elapsed: 0 s <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.google.api.client.googleapis.GoogleUtils
at com.google.api.client.googleapis.services.json.CommonGoogleJsonClientRequestInitializerTest.testInitialize(CommonGoogleJsonClientRequestInitializerTest.java:47)
| if (inputStream != null) { | ||
| final Properties properties = new Properties(); | ||
| properties.load(inputStream); | ||
| version = properties.getProperty("google-api-client.version"); |
There was a problem hiding this comment.
this could be null. You should supply a default here.
There was a problem hiding this comment.
Done. Moved the default to the return statement while checking for null.
There was a problem hiding this comment.
Or you could write
version = properties.getProperty("google-api-client.version". "unknown-version");
up to you.
| if (inputStream != null) { | ||
| final Properties properties = new Properties(); | ||
| properties.load(inputStream); | ||
| version = properties.getProperty("google-api-client.version"); |
There was a problem hiding this comment.
Or you could write
version = properties.getProperty("google-api-client.version". "unknown-version");
up to you.
|
Did this make it into 1.30.7? Cause it's still broken. Or is it because it's minified? I should test that... Post-edit: Nevermind, proguard issue. Needed this to stop the crash: Sorry about that. |
|
related #1467 |
Fixes #1451