Sponsor for 6666666: A better implementation of Character.isSupplementaryCodePoint

Ulf Zibis Ulf.Zibis at gmx.de
Wed Mar 24 17:20:17 UTC 2010


Am 23.03.2010 23:59, schrieb Martin Buchholz:
> On Tue, Mar 23, 2010 at 05:22, Ulf Zibis<Ulf.Zibis at gmx.de>  wrote:
>    
>> Am 13.03.2010 00:04, schrieb Martin Buchholz:
>>      
>>>        
>>>> Remembers me that some months ago I prepared a beautified version of
>>>> Character's source (things like above, replacing<code>    against {@code},
>>>> indentation inconsistencies etc.) Would there be interest to provide such
>>>> a
>>>> patch ?
>>>>          
> I support the plan of fixing coding style in core libraries when there is
> consensus amongst developers, as there is with
> <code>  =>  @code
> and
> @exception =>  @throws
>    

I too would like to see 8 spaces indentation on line breaks like:
     if (aaaaaaaaaaaaaaa > bbbbbbbbbbbbb &&
             ccccccccccccccc > ddddddddddddddddd)
         doSomething();

+ opening braces at line end instead beginning a new line

+ blank line between package ... and import ...

+ no blank line between javadoc and class/method declaration

+ 2 spaces after period

+ proper indentation in @param @return @throws blocks

+ not too much use of braces e.g. for 1-line blocks (one can see more 
code lines on same screen space)

+
      * @see    #forDigit(int, int)
      * @see    Integer#toString(int, int)
instead:
      * @see     java.lang.Character#forDigit(int, int)
      * @see     java.lang.Integer#toString(int, int)

+
          * range: U+DC00 through U+DFFF
instead
          * range: 0xDC00 through 0xDFFF

+
     {@link #isLowSurrogate(char)}
     {@link Character.UnicodeBlock}
instead
     {@linkplain #isLowSurrogate(char) isLowSurrogate}
<code>{@link Character.UnicodeBlock UnicodeBlock}</code>


> I think the right way to do this is to modify large portions of the
> java libraries using a script.  The script should be checked into
> the jdk repo as part of the fix.  There should be automated verification
> that the generated javadoc is left unchanged.
>
> There is precedent, for example the recent whitespace changes by Kelly,
> and my own fixes to @since in jdk6.
>
> To get you started, here is some elisp code that I have used when
> making such changes on a file-level:
>
> (defun tt-code ()
>    (interactive)
>    (query-replace-regexp "<\\(tt\\|code\\)>\\([^&<>\\\\]+\\)</\\1>"
> "{@code \\2}"))
>
> I suggest as a goal, modifying java.{lang,util,io,nio}
>    

That all sounds very good, so I should hold back my hand work.

-Ulf





More information about the core-libs-dev mailing list