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

Variant toString represesentations cause problems in client code #19

Open
GoogleCodeExporter opened this issue Apr 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The API documentation for toString is rather weak.  Although toString is 
part of the public API for every object, not every object implements 
toString for public consumption.

We need an annotation that will denote when toString returns values are 
subject to change without warning.  This allows developers to be confident 
that API users are not parsing output of toString for values, when the 
toString implementation was designed for debugging purposes.  For 
instance, Component subclasses produce a list of parameters and values are 
part of their toString.  There is no specification on the order or content 
of these values.  They can change from revision to revision.  Any client 
code relying on such a toString implementation should be considered 
fragile (at best).

I recommend that a @Volatile annotation for such a case.  Though @Volatile 
might be confused with the keyword and/or connote some expectation of 
concurrecy, so another annotation name is probably better (but it's a 
place to start).

Original issue reported on code.google.com by [email protected] on 14 Aug 2009 at 7:35

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

No branches or pull requests

1 participant