Sitelet https://github.com/googleapis/google-cloud-java/issues/342
Skip to content

in the README the datastore sample does not compile. #342

Description

@ludoch

For example, Datastore datastore = DatastoreOptions.getDefaultInstance().service();
does not seem to work with 0.0.10

Activity

  1. ajkannan commented on Nov 10, 2015

    @ajkannan

    Yes, the README examples got updated too soon. This example will work once we release version 0.0.11, which should be coming very soon (pending some testing in core). The old way should still work, for example:
    Datastore datastore = DatastoreFactory.instance().get(DatastoreOptions.defaultInstance());

  2. ajkannan commented on Nov 10, 2015

    @ajkannan

    Also the javadoc (available on the website and also packaged with version 0.0.10) should have examples that are in sync with the release version.

  3. ludoch commented on Nov 10, 2015

    @ludoch
    ContributorAuthor

    Got it, thanks!

  4. aozarov commented on Nov 10, 2015

    @aozarov
    Contributor

    @ajkannan just released 0.0.11 so maven should be consistent with site again.

  5. reopened this on Nov 11, 2015
  6. ludoch commented on Nov 11, 2015

    @ludoch
    ContributorAuthor

    0.0.11 does not work with:
    Datastore datastore = DatastoreOptions.getDefaultInstance().service();

  7. mziccard commented on Nov 11, 2015

    @mziccard
    Contributor

    @ludoch Sorry for this, the method getDefaultInstance is not part of the DatastoreOptions interface, I don't know how it happened to be in the README. To get a Datastore service instance with default options try:

    Datastore datastore = DatastoreOptions.builder().build().service();

    I'll take care of fixing this, either by adding the getDefaultInstance method or by updating the READMEs

  8. mziccard commented on Nov 12, 2015

    @mziccard
    Contributor

    @ludoch In #357 we add back a defaultInstance method to StorageOptions and DatastoreOptions and update both READMEs and website's landing page (will be available on the next release).
    Do you think we can close this?

  9. aozarov commented on Nov 18, 2015

    @aozarov
    Contributor

    0.0.12 which includes adding back the defaultInstance methods is out but I think we need to merge #389 before closing this issue.

  10. mziccard commented on Nov 18, 2015

    @mziccard
    Contributor

    #357 and #389 are merged so I am closing this. Feel free to reopen it if need be.

  11. added a commit that references this issue on Oct 5, 2022
  12. added a commit that references this issue on Mar 23, 2026
    4140e5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨 criticalP0 critical issue. Requires immediate fixtriage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions