dnrajugade / guava-libraries

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

Improve JavaDoc for ThreadFactoryBuilder#setNameFormat(String) #1216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current JavaDoc for Paramter nameFormat goes:
 "a String.format(String, Object)-compatible format String, to which a unique integer (0, 1, etc.) will be supplied as the single parameter[..]"

This is correct, but one have to spend time in checking the String.format(..) 
JavaDoc to recognize that the answer is hidden in the Formatter JavaDoc to get 
the placeholder '%d' for int-Parameter. This is very the consuming if one is 
not familar with Formatter arguments. It would be nice to provide a sample or 
something else that avoids looking deep into the JavaDoc's.

E.g: "a String containing '%d' as parameter for a unique integer..."

Original issue reported on code.google.com by chriss....@gmail.com on 29 Nov 2012 at 10:11

GoogleCodeExporter commented 9 years ago
Maybe just add a little bit to the JavaDoc that says something along the lines 
of: 'For reference, the placeholder for formatting the value as a decimal 
integer is '%d%'.

Don't forget that the number can also be formatted as hexadecimal or octal, 
which might be desired by some people (although I don't personally see why they 
would want to in this case).

Original comment by graft...@hotmail.co.uk on 29 Nov 2012 at 1:26

GoogleCodeExporter commented 9 years ago
Indeed an example usage would be really appropriate here.  It would probably 
just use %s though.  I always tend to use %s except in the rare cases I need 
some specialized formatting.

Original comment by kevinb@google.com on 29 Nov 2012 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by kak@google.com on 29 Nov 2012 at 4:06

GoogleCodeExporter commented 9 years ago

Original comment by kak@google.com on 29 Nov 2012 at 5:13

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08