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

Inconsistent 'toString' overriding in 'Text' implementations #1121

Closed
vzurauskas opened this issue Apr 28, 2019 · 4 comments
Closed

Inconsistent 'toString' overriding in 'Text' implementations #1121

vzurauskas opened this issue Apr 28, 2019 · 4 comments

Comments

@vzurauskas
Copy link
Contributor

Some Text implementations like TextOf override toString(), while others, like JoinedText, don't. This behaviour is confusing, as sometimes invoking toString on a Text instance gives you a nice text representation, and sometimes you get the default one from Object. We should make it consistent.

I would prefer it if all of them overrode toString, because getting an actual text representation is what I would expect from a toString invoked on a Text instance. Also, it would be more convenient than asString because I wouldn't need to wrap it in UncheckedText. However, keep in mind that debugging becomes more difficult in case there are bugs in the Text implementations themselves, because the debuggers will usually invoke toString on watched objects to display their value on breakpoints. So I guess this is for ARC to decide, @llorllale

@0crat
Copy link
Collaborator

0crat commented Apr 28, 2019

@llorllale/z please, pay attention to this issue

@llorllale
Copy link
Contributor

@vzurauskas we have an open puzzle for this - see #1116

@0crat
Copy link
Collaborator

0crat commented Apr 30, 2019

Job gh:yegor256/cactoos#1121 is not assigned, can't get performer

@0crat
Copy link
Collaborator

0crat commented Apr 30, 2019

This job is not in scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants