Skip to content
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

PlaceRequest.Builder(PlaceRequest request) makes a "shared copy" instead of a "isolated copy" #492

Closed
thomasreisenbichler opened this issue May 20, 2014 · 1 comment

Comments

@thomasreisenbichler
Copy link

When instantiating a new PlaceRequest with "new PlaceRequest.Builder(request)" the parameter map of the base request is directly assigned to the new PlaceRequest which results in a strange situation. If you add a parameter to the second request, then the parameter change is reflected on the first request too.

So the following statements result in a green test, which cannot be correct.

    PlaceRequest request = new PlaceRequest.Builder().nameToken("nameToken").with("paramkey", "paramvalue").build();
    PlaceRequest copy = new PlaceRequest.Builder(request).with("copyparamkey", "copyparamvalue").build();

    assertEquals(request, copy);
    assertEquals(request.getParameter("copyparamkey", null), "copyparamvalue");
meriouma added a commit that referenced this issue Jun 3, 2014
meriouma added a commit that referenced this issue Jun 4, 2014
#489 and #492 : Adding .without() to PlaceRequest.Builder and fixed shared parameters map
@christiangoudreau
Copy link
Member

Closing, this has been fixed. Reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants