Skip to content

Conversation

@zzt93
Copy link
Contributor

@zzt93 zzt93 commented Dec 27, 2017

add toString simple implementation and test to resolve issue 27986

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • If submitting code, have you built your formula locally prior to submission with gradle check?
  • If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
  • If submitting code, have you checked that your submission is for an OS that we support?
  • If you are submitting this code for a class then read our policy for that.

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@zzt93
Copy link
Contributor Author

zzt93 commented Dec 27, 2017

Gradle check complains about the use of java.lang.System#out for test toString, so any suggestions?

@tvernum
Copy link
Contributor

tvernum commented Dec 27, 2017

Gradle check complains about the use of java.lang.System#out

I don't follow why you're trying to use System.out in that test.
If you want to test toString you should just call that method, there's no reason to print it to standard output.
Instead, you should call toString() and check that the resulting String contains the text that you expect to see.

@zzt93 zzt93 force-pushed the updateRequestToString branch from bc2a1e3 to e00e478 Compare December 28, 2017 02:21
@zzt93
Copy link
Contributor Author

zzt93 commented Dec 28, 2017

Thanks, I see. Updated now.

@tvernum
Copy link
Contributor

tvernum commented Dec 28, 2017

@elasticmachine ok to test

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

It looks like you rewrote history to remove the commit that Tim looked at earlier so any comments he made are now lost. It makes it easier on reviewers if you just add commits to your branch. We squash the whole branch when it's merged so don't worry about making a noisy log at this stage. Please could you avoid rewriting history in future?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's lots of appending going on - could you use a StringBuilder here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. As far as I see, the readability is affected, and as far as I know, java compiler will replace it with StringBuilder automatically now.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is boolean - I think it'd be better to include it in the output whether it's true or false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

This is boolean - I think it'd be better to include it in the output whether it's true or false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. One more field which is a boolean and not listed here is also updated.

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

@cbuescher
Copy link
Member

@DaveCTurner looks like this is ready to pull in
@zzt93 would you rebase this PR to master, the "core" subproject was recently renamed to "server", this is the cause for the conflicts I think

@cbuescher
Copy link
Member

@zzt93 something looks wrong with this branch after the last rebase, it looks like you merged in another branch? Please clean up the branch PR before we can merge this. Let me know if you need help.

@zzt93
Copy link
Contributor Author

zzt93 commented Jan 16, 2018

@cbuescher I just rebase my branch and push, but remote refused. So I pull and merge. What do you mean 'clean up'? Maybe to push force?

@cbuescher
Copy link
Member

cbuescher commented Jan 16, 2018

@zzt93 by "clean up" I mean that your branch should only contain the two commits that were actually reviewed (I think that would be e00e478 and 5e3ba8a). Whatever git workflow suits you is fine for that, for example you could just check out the current tip of master, cherry-pick those commits and then push that to your pr branch. Whatever works. I think the "merge" you mentioned might have messed things up.

@cbuescher
Copy link
Member

Sorry, I mean 783a0e5 instead of 5e3ba8a.

@zzt93 zzt93 force-pushed the updateRequestToString branch 2 times, most recently from 783a0e5 to b93c47f Compare January 17, 2018 01:22
@zzt93
Copy link
Contributor Author

zzt93 commented Jan 17, 2018

Do as you suggested now.

@DaveCTurner
Copy link
Contributor

Sorry @zzt93, it looks like this has failed because #28071 (and the associated changes to CI) landed in the meantime. Could you merge master in again?

@zzt93
Copy link
Contributor Author

zzt93 commented Jan 17, 2018

The jenkins log says:

01:42:25 * What went wrong:
01:42:25 Execution failed for task ':plugins:discovery-ec2:thirdPartyAudit'.
01:42:25 > CLASSES ARE MISSING! [javax/xml/bind/JAXBContext.class]

@DaveCTurner So what should I do?

@DaveCTurner
Copy link
Contributor

I think this was fixed in aded32f which was pushed after this PR, so something like git pull upstream master && git push should suffice.

@cbuescher
Copy link
Member

@elasticmachine test this please

@DaveCTurner DaveCTurner merged commit 1335232 into elastic:master Jan 17, 2018
@DaveCTurner
Copy link
Contributor

Thanks for your contribution @zzt93, it's much appreciated. Merged to master as 1335232 and backported to 6.x as 5a82c93.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UpdateRequest need toString()

6 participants