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

For #1462: Introduce text.Mapped #1485

Merged
merged 16 commits into from
Nov 14, 2020
Merged

For #1462: Introduce text.Mapped #1485

merged 16 commits into from
Nov 14, 2020

Conversation

andreoss
Copy link
Contributor

Per #1462

  • Add text.Mapped
  • Use it where applicable

@victornoel
Copy link
Collaborator

@0crat status

@0crat
Copy link
Collaborator

0crat commented Oct 17, 2020

@0crat status (here)

@victornoel This is what I know about this job in C63314D6Z, as in §32:

@andreoss
Copy link
Contributor Author

@fabriciofx Please take a look

Copy link
Contributor

@fabriciofx fabriciofx left a comment

Choose a reason for hiding this comment

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

@andreoss Please, take a look in my comments.

src/test/java/org/cactoos/text/MappedTest.java Outdated Show resolved Hide resolved
*
* @since 0.47
*/
final class MappedTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

@andreoss please, add a #equals() test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabriciofx Why do you think Mapped should preserve equality?

Copy link
Contributor

@fabriciofx fabriciofx Oct 31, 2020

Choose a reason for hiding this comment

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

@andreoss Some code like it new Mapped(String::toLowercase, new TextOf("ABC").equals("abc") is valid? If yes, then Mapped should preserve equality, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabriciofx In order to do that, it has to extend TextEnvelope and use TextOf. Both seem to be unnecessary for this task.

Copy link
Contributor

Choose a reason for hiding this comment

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

@andreoss Ok, thanks for this information!

Copy link
Collaborator

@victornoel victornoel Nov 7, 2020

Choose a reason for hiding this comment

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

@andreoss @fabriciofx actually all texts implementation should either implement equals themselves or indeed delegate to an implementation of text that does. So I think we need to do it either way here yes. Same with tostring and hashcode. You can add a todo if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Done. It uses TextOf now.

src/test/java/org/cactoos/text/MappedTest.java Outdated Show resolved Hide resolved
src/test/java/org/cactoos/text/MappedTest.java Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Oct 30, 2020

Codecov Report

Merging #1485 (92ce712) into master (deec154) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1485      +/-   ##
============================================
+ Coverage     89.40%   89.44%   +0.04%     
- Complexity     1632     1639       +7     
============================================
  Files           278      281       +3     
  Lines          3906     3914       +8     
  Branches        210      208       -2     
============================================
+ Hits           3492     3501       +9     
+ Misses          382      381       -1     
  Partials         32       32              
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/text/Strict.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
src/main/java/org/cactoos/text/Sub.java 89.47% <ø> (-0.53%) 8.00 <0.00> (ø)
src/main/java/org/cactoos/text/SwappedCase.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
src/main/java/org/cactoos/text/TrimmedRight.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
src/main/java/org/cactoos/text/Lowered.java 100.00% <100.00%> (ø) 3.00 <1.00> (ø)
src/main/java/org/cactoos/text/Mapped.java 100.00% <100.00%> (ø) 1.00 <1.00> (?)
src/main/java/org/cactoos/text/Replaced.java 100.00% <100.00%> (ø) 4.00 <0.00> (ø)
src/main/java/org/cactoos/text/Reversed.java 100.00% <100.00%> (ø) 2.00 <1.00> (ø)
src/main/java/org/cactoos/text/Trimmed.java 100.00% <100.00%> (ø) 1.00 <1.00> (ø)
src/main/java/org/cactoos/text/TrimmedLeft.java 100.00% <100.00%> (ø) 4.00 <0.00> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deec154...92ce712. Read the comment docs.

@victornoel
Copy link
Collaborator

@0crat status

@0crat
Copy link
Collaborator

0crat commented Nov 3, 2020

@0crat status (here)

@victornoel This is what I know about this job in C63314D6Z, as in §32:

Copy link
Contributor

@fabriciofx fabriciofx left a comment

Choose a reason for hiding this comment

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

@andreoss It seems fine to me. @victornoel WDYT? Can you merge it?

*
* @since 0.47
*/
final class MappedTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

@andreoss Ok, thanks for this information!

Copy link
Collaborator

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@andreoss see the one comment

@andreoss andreoss requested a review from victornoel November 8, 2020 22:35
@andreoss
Copy link
Contributor Author

@victornoel equals/hashCode are provided by TextOf now. Please, take a look

@victornoel
Copy link
Collaborator

@andreoss great!

@victornoel
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Nov 14, 2020

@rultor merge

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

@rultor rultor merged commit b838438 into yegor256:master Nov 14, 2020
@rultor
Copy link
Collaborator

rultor commented Nov 14, 2020

@rultor merge

@victornoel Done! FYI, the full log is here (took me 12min)

@0crat 0crat removed the 0crat/scope label Dec 24, 2020
@0crat
Copy link
Collaborator

0crat commented Dec 24, 2020

@fabriciofx/z resigned from #1485, since the job is not in scope anymore

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