TimurMahammadov / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

All returned classes should override toString (consistently) #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Every object that the library can return to the caller should have a
toString() method that returns something meaningful.

Original issue reported on code.google.com by jared.l....@gmail.com on 13 Jun 2008 at 5:41

GoogleCodeExporter commented 9 years ago

Original comment by kevin...@gmail.com on 18 Mar 2009 at 2:20

GoogleCodeExporter commented 9 years ago
Ideally, we'd have toString() unit tests for each returned class.

Original comment by jared.l....@gmail.com on 8 Apr 2009 at 4:16

GoogleCodeExporter commented 9 years ago
I've just painstakingly reviewed everything and have confirmed that everything 
has a 
working toString() implementation except:

* iterators
* builders (for immutable collections)
* Joiner
* MapMaker
* weak reference-type stuff 

I believe implementing toString() for any of these is unimportant until 
specifically 
requested by a user.

I did find that we are using an inconsistent approach for toString()s of 
"function 
objects".  The approach I like best, I think, is Ordering's:

  Ordering.natural().nullsFirst().toString()

gives you 

  "Ordering.natural().nullsFirst()"

I think that's nice and I'll leave this bug open for me to make functions and 
predicates behave similarly.

Original comment by kevin...@gmail.com on 17 Aug 2009 at 5:10

GoogleCodeExporter commented 9 years ago

Original comment by kevin...@gmail.com on 17 Sep 2009 at 6:03

GoogleCodeExporter commented 9 years ago
I think this can be fixed post-1.0. We don't specify toString format and no one 
should 
be programmatically depending on it.

Original comment by kevin...@gmail.com on 18 Sep 2009 at 5:16

GoogleCodeExporter commented 9 years ago
This issue has been moved to the Guava project (keeping the same id number). 
Simply replace 'google-collections' with 'guava-libraries' in your address 
bar and it should take you there.

Original comment by kevinb@google.com on 5 Jan 2010 at 11:09