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

Issue #952 - implementing iterate() and get() methods in MkNotifications #1174

Merged
merged 8 commits into from
Oct 12, 2015

Conversation

prondzyn
Copy link
Contributor

Related to issue #952. iterate() is based on empty list and get() method on simple MkNotification object.

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 1, 2015

@dmarkov please check the Travis build because the error does not look to be connected with my changes

@dmarkov
Copy link

dmarkov commented Oct 1, 2015

@prondzyn Thanks, I will find someone to review this PR soon

@dmarkov
Copy link

dmarkov commented Oct 1, 2015

@dmzaytsev it's yours, please review

@Override
public Iterable<Notification> iterate() {
throw new NotImplementedException("MkNotifications#iterate");
return Collections.emptyList();

Choose a reason for hiding this comment

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

@prondzyn I think you should return a real collection instead empty one.
Let's create the collection inside the constructor, size of the collection can be a parameter.

Choose a reason for hiding this comment

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

@prondzyn you can fill the collection in constructor as well

@dmzaytsev
Copy link

@prondzyn please see 7 comments/questions above

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 2, 2015

@dmzaytsev please check my improvements

this.notifications = Collections
.<Notification>nCopies(
quantity,
new MkNotification(identifier += 1)

Choose a reason for hiding this comment

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

@prondzyn I think you get quantity copies of new MkNotification(1), right?
Let's initialize this one via for loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmzaytsev sorry, my mistake.

But when I use for I need to add @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops"). Is it not a problem?

Choose a reason for hiding this comment

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

@prondzyn sure, you can suppress this warning

@dmzaytsev
Copy link

@prondzyn please see one comment above

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 2, 2015

@dmzaytsev please check my fix now

@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
MkNotifications(final int quantity) {
this.notifications = new ArrayList<Notification>(quantity);
for (int index = 0; index < quantity; index += 1) {

Choose a reason for hiding this comment

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

@prondzyn ++ index

@dmzaytsev
Copy link

@prondzyn looks good just one minor remark

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 2, 2015

@dmzaytsev updated as you requested. Thanks for all your remarks. I still need to get familiar with your coding style.

@dmzaytsev
Copy link

@prondzyn thanks

@dmzaytsev
Copy link

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 2, 2015

@rultor merge

@dmzaytsev Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

yegor256 commented Oct 2, 2015

@rultor try to merge

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 6, 2015

@dmzaytsev I ignored one test from RtIssueITCase and updated description of #1178

@dmzaytsev
Copy link

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 6, 2015

@rultor merge

@dmzaytsev Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

yegor256 commented Oct 6, 2015

@prondzyn if you ignore any test, don't forget to add some description there, explaining why the test is ignored. Everybody should be able to understand why @Ignore is there, in a year, for example.

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 7, 2015

@yegor256 Understood. Comment added.

@yegor256
Copy link
Member

yegor256 commented Oct 7, 2015

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Oct 7, 2015

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Oct 7, 2015

@rultor try to merge

@prondzyn @yegor256 Oops, I failed. You can see the full log here (spent 11min)

INFO: "reading src/main/java/com/jcabi/github/Branches.java..."
INFO: "reading src/main/java/com/jcabi/github/Bulk.java..."
INFO: "reading src/main/java/com/jcabi/github/Collaborators.java..."
INFO: "reading src/main/java/com/jcabi/github/Comment.java..."
INFO: "reading src/main/java/com/jcabi/github/Comments.java..."
INFO: "reading src/main/java/com/jcabi/github/Commit.java..."
INFO: "reading src/main/java/com/jcabi/github/Commits.java..."
INFO: "reading src/main/java/com/jcabi/github/CommitsComparison.java..."
INFO: "reading src/main/java/com/jcabi/github/Content.java..."
INFO: "reading src/main/java/com/jcabi/github/Contents.java..."
INFO: "reading src/main/java/com/jcabi/github/Coordinates.java..."
INFO: "reading src/main/java/com/jcabi/github/DeployKey.java..."
INFO: "reading src/main/java/com/jcabi/github/DeployKeys.java..."
INFO: "reading src/main/java/com/jcabi/github/Event.java..."
INFO: "reading src/main/java/com/jcabi/github/FileChange.java..."
INFO: "reading src/main/java/com/jcabi/github/Fork.java..."
INFO: "reading src/main/java/com/jcabi/github/Forks.java..."
INFO: "reading src/main/java/com/jcabi/github/Gist.java..."
INFO: "reading src/main/java/com/jcabi/github/GistComment.java..."
INFO: "reading src/main/java/com/jcabi/github/GistComments.java..."
INFO: "reading src/main/java/com/jcabi/github/Gists.java..."
INFO: "reading src/main/java/com/jcabi/github/Git.java..."
INFO: "reading src/main/java/com/jcabi/github/GitHubThread.java..."
INFO: "reading src/main/java/com/jcabi/github/Github.java..."
INFO: "reading src/main/java/com/jcabi/github/Gitignores.java..."
INFO: "reading src/main/java/com/jcabi/github/Hook.java..."
INFO: "reading src/main/java/com/jcabi/github/Hooks.java..."
INFO: "puzzle 1106-3aa88d70 30/IMP at src/main/java/com/jcabi/github/Hooks.java"
INFO: "reading src/main/java/com/jcabi/github/Issue.java..."
INFO: "reading src/main/java/com/jcabi/github/IssueEvents.java..."
INFO: "reading src/main/java/com/jcabi/github/IssueLabels.java..."
INFO: "reading src/main/java/com/jcabi/github/Issues.java..."
INFO: "reading src/main/java/com/jcabi/github/JsonPatchable.java..."
INFO: "reading src/main/java/com/jcabi/github/JsonReadable.java..."
INFO: "reading src/main/java/com/jcabi/github/Label.java..."
INFO: "reading src/main/java/com/jcabi/github/Labels.java..."
INFO: "reading src/main/java/com/jcabi/github/Language.java..."
INFO: "reading src/main/java/com/jcabi/github/Limit.java..."
INFO: "reading src/main/java/com/jcabi/github/Limits.java..."
/var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd/source.rb:144:in `rescue in puzzles': ["in /home/r/repo/src/main/java/com/jcabi/github/Notification.java", #<PDD::Error: Suspicious TODO in line #41>] (PDD::Error)
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd/source.rb:142:in `puzzles'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:97:in `block (3 levels) in xml'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:96:in `each'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:96:in `block (2 levels) in xml'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:391:in `call'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:391:in `insert'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:375:in `method_missing'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:95:in `block in xml'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:293:in `initialize'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:93:in `new'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:93:in `xml'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/bin/pdd:90:in `<top (required)>'
    from /usr/local/bin/pdd:23:in `load'
    from /usr/local/bin/pdd:23:in `<main>'
INFO: "reading src/main/java/com/jcabi/github/Markdown.java..."
INFO: "reading src/main/java/com/jcabi/github/MergeState.java..."
INFO: "reading src/main/java/com/jcabi/github/Milestone.java..."
INFO: "reading src/main/java/com/jcabi/github/Milestones.java..."
INFO: "reading src/main/java/com/jcabi/github/Notification.java..."

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 9, 2015

@yegor256 what should I do now? It is not in part which I did not touch.

@yegor256
Copy link
Member

yegor256 commented Oct 9, 2015

@prondzyn just fix it and move on. It should be very easy to fix, see https://github.com/teamed/pdd

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 9, 2015

@yegor256 should work now

@prondzyn
Copy link
Contributor Author

prondzyn commented Oct 9, 2015

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 9, 2015

@rultor merge

@prondzyn Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

yegor256 commented Oct 9, 2015

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Oct 9, 2015

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Oct 9, 2015

@rultor try to merge

@prondzyn @yegor256 Oops, I failed. You can see the full log here (spent 9min)

INFO: "reading src/test/java/com/jcabi/github/RtContentTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtContentsITCase.java..."
INFO: "puzzle 863-4e783bd3 0/IMP at src/test/java/com/jcabi/github/RtContentsITCase.java"
INFO: "reading src/test/java/com/jcabi/github/RtContentsTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtDeployKeyTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtDeployKeysITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtDeployKeysTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtEventTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtForkTest.java..."
INFO: "puzzle 989-33d6f233 0/IMP at src/test/java/com/jcabi/github/RtForkTest.java"
INFO: "reading src/test/java/com/jcabi/github/RtForksITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtForksTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistCommentITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistCommentTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistCommentsITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistCommentsTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistsITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGistsTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGitTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGithubITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGithubTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGitignoresITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtGitignoresTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtHookTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtHooksITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtHooksTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtIssueITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtIssueLabelsITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtIssueTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtIssuesITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtIssuesTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtJsonTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtLabelTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtLabelsITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtLabelsTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtLimitTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtLimitsITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtMarkdownITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtMarkdownTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtMilestonesITCase.java..."
INFO: "reading src/test/java/com/jcabi/github/RtMilestonesTest.java..."
INFO: "reading src/test/java/com/jcabi/github/RtNotificationsITestCase.java..."
/var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd/source.rb:144:in `rescue in puzzles': ["in /home/r/repo/src/test/java/com/jcabi/github/RtNotificationsITestCase.java", #<PDD::Error: Suspicious TODO in line #36>] (PDD::Error)
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd/source.rb:142:in `puzzles'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:97:in `block (3 levels) in xml'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:96:in `each'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:96:in `block (2 levels) in xml'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:391:in `call'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:391:in `insert'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:375:in `method_missing'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:95:in `block in xml'
    from /var/lib/gems/1.9.1/gems/nokogiri-1.6.5/lib/nokogiri/xml/builder.rb:293:in `initialize'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:93:in `new'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/lib/pdd.rb:93:in `xml'
    from /var/lib/gems/1.9.1/gems/pdd-0.15/bin/pdd:90:in `<top (required)>'
    from /usr/local/bin/pdd:23:in `load'
    from /usr/local/bin/pdd:23:in `<main>'

@prondzyn
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 10, 2015

@rultor merge

@prondzyn Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Oct 12, 2015

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit a3d3682 into jcabi:master Oct 12, 2015
@rultor
Copy link
Contributor

rultor commented Oct 12, 2015

@rultor try to merge

@yegor256 Done! FYI, the full log is here (took me 5min)

@dmarkov
Copy link

dmarkov commented Oct 15, 2015

@dmzaytsev Thanks a lot, I just topped your account for 26 mins, transaction ID 67397152, total time was 288 hours and 46 mins. extra minutes for review comments (c=11). +26 to your rating, your total score is +1343

@dmarkov
Copy link

dmarkov commented Oct 15, 2015

@rultor please deploy

@rultor
Copy link
Contributor

rultor commented Oct 15, 2015

@rultor please deploy

@dmarkov OK, I'll try to deploy now. You can check the progress here

@rultor
Copy link
Contributor

rultor commented Oct 15, 2015

@rultor please deploy

@dmarkov Done! FYI, the full log is here (took me 9min)

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.

6 participants