FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: update GoogleUtils#getVersion() to use stable logic by chingor13 · Pull Request #1452 · googleapis/google-api-java-client · GitHub

fix: update GoogleUtils#getVersion() to use stable logic - #1452

Merged
chingor13 merged 3 commits into
googleapis:masterfrom
chingor13:version-constant
Dec 17, 2019
Merged

fix: update GoogleUtils#getVersion() to use stable logic#1452
chingor13 merged 3 commits into
googleapis:masterfrom
chingor13:version-constant

Conversation

Copy link
Copy Markdown
Collaborator

Fixes #1451

chingor13 requested a review from a team December 17, 2019 19:11
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 17, 2019

elharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

[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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this could be null. You should supply a default here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done. Moved the default to the return statement while checking for null.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Or you could write

version = properties.getProperty("google-api-client.version". "unknown-version");

up to you.

chingor13 merged commit 744839f into googleapis:master Dec 17, 2019
chingor13 deleted the version-constant branch December 17, 2019 23:28

Samikay commented Jan 11, 2020
edited
Loading

Copy link
Copy Markdown

Did this make it into 1.30.7? Cause it's still broken. Or is it because it's minified? I should test that...

 Caused by: java.lang.IllegalStateException: No successful match so far
    at java.util.regex.Matcher.ensureMatch(Matcher.java:1116)
    at java.util.regex.Matcher.group(Matcher.java:382)
    at c.c.b.a.c.a.<clinit>(:66)
    at com.google.api.services.drive.Drive.<clinit>(:44) 
    at com.google.api.services.drive.Drive$Builder.build(:9813) 

Post-edit: Nevermind, proguard issue. Needed this to stop the crash:
-keep class com.google.api.client.googleapis.** { *; }

Sorry about that.

elharo commented Jan 11, 2020

Copy link
Copy Markdown
Contributor

related #1467

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android/Java 1.30.6 causing crash due to PR #1419

5 participants


Back | FazBrowse Home | New Git URL