GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: update GoogleUtils#getVersion() to use stable logic by chingor13 · Pull Request #1452 · googleapis/google-api-java-client

Conversation

@chingor13

@chingor13 chingor13 commented Dec 17, 2019

Copy link
Copy Markdown
Collaborator

Fixes #1451

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chingor13
fix: update GoogleUtils#getVersion() to use stable logic
7d00032
@chingor13
chingor13 requested a review from a team December 17, 2019 19:11
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 17, 2019
elharo
elharo reviewed Dec 17, 2019
View reviewed changes

@elharo elharo left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chingor13
fix: fix property name
0d3dfd9
elharo
elharo reviewed Dec 17, 2019
View reviewed changes
Comment thread google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

elharo
elharo reviewed Dec 17, 2019
View reviewed changes
Comment thread google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java
if (inputStream != null) {
final Properties properties = new Properties();
properties.load(inputStream);
version = properties.getProperty("google-api-client.version");

@elharo elharo Dec 17, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chingor13 chingor13 Dec 17, 2019

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@elharo elharo Dec 17, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Or you could write

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

up to you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
BenWhitehead
BenWhitehead approved these changes Dec 17, 2019
View reviewed changes
@chingor13
fix: handle case where property is not found
1cc4b3d
elharo
elharo approved these changes Dec 17, 2019
View reviewed changes
Comment thread google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java
if (inputStream != null) {
final Properties properties = new Properties();
properties.load(inputStream);
version = properties.getProperty("google-api-client.version");

@elharo elharo Dec 17, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Or you could write

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

up to you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Samikay commented Jan 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@elharo

elharo commented Jan 11, 2020

Copy link
Copy Markdown
Contributor

related #1467

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@elharo elharo elharo approved these changes
@BenWhitehead BenWhitehead BenWhitehead approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Android/Java 1.30.6 causing crash due to PR #1419

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@chingor13 @Samikay @elharo @BenWhitehead @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.