-
Notifications
You must be signed in to change notification settings - Fork 165
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
(#1560) Delegate TextOf(Iterator)
to TextOf(Iterable)
#1599
Conversation
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.
@DmitryBarskov just a little comment until a REV gets assigned to the PR :)
@@ -124,7 +126,14 @@ public final void clear() { | |||
public final String toString() { | |||
return new StringBuilder() | |||
.append('{') | |||
.append(new TextOf(this.entrySet()).toString()) | |||
.append( |
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.
@DmitryBarskov Why use Concatenated
and StringBuilder
together?
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.
Do I do it right now?
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.
@DmitryBarskov yes you should fix the issue the reviewer found, I think here he is hinting at the fact there is useless extra code and that it could be simplified… not 100% sure :)
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.
@victornoel Yes, I got it, thank you. Just wanted to draw attention to the changes.
Co-authored-by: Victor Noël <[email protected]>
Co-authored-by: andreoss <[email protected]>
Co-authored-by: andreoss <[email protected]>
Co-authored-by: andreoss <[email protected]>
TextOf(Iterable)
to TextOf(Iterator)
TextOf(Iterator)
to TextOf(IteratorIterable)
TextOf(Iterator)
to TextOf(IteratorIterable)
TextOf(Iterator)
to TextOf(Iterable)
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.
@DmitryBarskov a few more comments
@@ -301,6 +301,18 @@ public void removeIsDelegated() { | |||
).affirm(); | |||
} | |||
|
|||
@Test | |||
public void testToString() { |
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.
@DmitryBarskov let's move this test in MapOfTest
: even though it's implemented in MapEnvelope
(which is a mistake I think, see #1606), this test is ultimately testing MapOf
from a user point of view.
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.
I see there are tests for this method already, I'll just remove it.
public TextOf(final Iterable<?> iterable) { | ||
* @todo #1560:30min/DEV We want {@link Concatenated} to have | ||
* an extra constructor that accepts {@code Iterable<CharSequence>} | ||
* to avoid creating of {@link Joined} with empty delimiter. |
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.
@DmitryBarskov actually it won't be possible to introduce such constructor because of type erasure, so I propose to simply write the following in the constructor below instead: new Concatenated(new Mapped(TextOf::new, iterable))
} | ||
) | ||
); | ||
this(new IterableOf<>(iterator)); |
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.
@DmitryBarskov please move this constructor above (good practice is to always have the called constructor/methods below the calling ones)
@rultor merge |
@victornoel OK, I'll try to merge now. You can check the progress of the merge here |
@victornoel Done! FYI, the full log is here (took me 13min) |
@sereshqua/z please review this job completed by @andreoss/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed |
@DmitryBarskov please make sure you start all of the comments with the name of the user they are referred to, see |
@0crat quality acceptable |
For #1560:
TextOf(Iterator)
now delegates toTextOf(Iterable)
TextOf
parameter is typed asIterable<Character>
instead ofIterable<?>
TextOf(Iterable)
TextOf(Iterable<?>)
withJoined
andConcatenated