-
Notifications
You must be signed in to change notification settings - Fork 142
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
Conversation
@dmarkov please check the Travis build because the error does not look to be connected with my changes |
@prondzyn Thanks, I will find someone to review this PR soon |
@dmzaytsev it's yours, please review |
@Override | ||
public Iterable<Notification> iterate() { | ||
throw new NotImplementedException("MkNotifications#iterate"); | ||
return Collections.emptyList(); |
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.
@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.
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.
@prondzyn you can fill the collection in constructor as well
@prondzyn please see 7 comments/questions above |
…tion in MkNotifications
@dmzaytsev please check my improvements |
this.notifications = Collections | ||
.<Notification>nCopies( | ||
quantity, | ||
new MkNotification(identifier += 1) |
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.
@prondzyn I think you get quantity
copies of new MkNotification(1)
, right?
Let's initialize this one via for
loop.
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.
@dmzaytsev sorry, my mistake.
But when I use for
I need to add @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
. Is it not a problem?
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.
@prondzyn sure, you can suppress this warning
@prondzyn please see one comment above |
@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) { |
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.
@prondzyn ++ index
@prondzyn looks good just one minor remark |
@dmzaytsev updated as you requested. Thanks for all your remarks. I still need to get familiar with your coding style. |
@prondzyn thanks |
@rultor merge |
@dmzaytsev Thanks for your request. @yegor256 Please confirm this. |
@rultor try to merge |
@dmzaytsev I ignored one test from RtIssueITCase and updated description of #1178 |
@rultor merge |
@dmzaytsev Thanks for your request. @yegor256 Please confirm this. |
@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 |
@yegor256 Understood. Comment added. |
@rultor try to merge |
@prondzyn @yegor256 Oops, I failed. You can see the full log here (spent 11min)
|
@yegor256 what should I do now? It is not in part which I did not touch. |
@prondzyn just fix it and move on. It should be very easy to fix, see https://github.com/teamed/pdd |
@yegor256 should work now |
@rultor merge |
@rultor try to merge |
@prondzyn @yegor256 Oops, I failed. You can see the full log here (spent 9min)
|
@rultor merge |
@rultor try to merge |
@dmzaytsev Thanks a lot, I just topped your account for 26 mins, transaction ID |
@rultor please deploy |
Related to issue #952. iterate() is based on empty list and get() method on simple MkNotification object.