Hi Roger, Julia,

> On Nov 18, 2019, at 10:10 AM, Roger Riggs <roger.ri...@oracle.com> wrote:
> 
> If we're putting "public" on the same line as the method then
> it seems useful to put the /* non-public */ on the same line too.
> Though I don't know we have style guidance for that.
> (And elsewhere too).
> 

————————
-    /*non-public*/ static
     @DontInline
-    void maybeCustomize(MethodHandle mh) {
+    /*non-public*/ static void maybeCustomize(MethodHandle mh) {
         byte count = mh.customizationCount;
         if (count >= CUSTOMIZE_THRESHOLD) {
             mh.customize();

———————————

Is the above common coding in the JDK?  To me it seems to be more readable to 
have the comment above the method?    

If I run reformat in Intellij for example with code similar to the above, it 
will put /*non-public*/ on its own line.

Before reformat:

——————
/*non-public*/ static void foo(String f1) {
    System.out.printf("hello %s%n", f1);
}
—————————
After reformat:
—————
/*non-public*/
static void foo(String f1) {
    System.out.printf("hello %s%n", f1);
}
——————

HTH

Best
Lance

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> 
<http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| 
Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com <mailto:lance.ander...@oracle.com>



Reply via email to