Java Doc Bugs

Howard Lovatt howard.lovatt at gmail.com
Fri Aug 13 23:11:20 PDT 2010


There are some minor Java Doc Bugs in:

     http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm/

In particular the Java Doc for:

     MethodHandles.dropArguments

The example given is incorrect and should be something like:

      final MethodType types = MethodType.methodType( String.class,
String.class );
      final MethodHandle cat = lookup().findVirtual( String.class,
"concat", types );
      System.out.println( cat.<String>invokeExact( "x", "y" ) ); // xy
      final MethodHandle d0 = dropArguments( cat, 0, String.class );
      System.out.println( d0.<String>invokeExact( "x", "y", "z" ) ); // yz
      final MethodHandle d1 = dropArguments( cat, 1, String.class );
      System.out.println( d1.<String>invokeExact( "x", "y", "z" ) ); // xz
      final MethodHandle d2 = dropArguments( cat, 2, String.class );
      System.out.println( d2.<String>invokeExact( "x", "y", "z" ) ); // xy
      final MethodHandle d12 = dropArguments( cat, 1, String.class,
String.class );
      System.out.println( d12.<String>invokeExact( "w", "x", "y", "z" ) ); // wz

There are some detail changes in the above but the most important
thing is that the comments given as the output are corrected (the
original comments implied numbering of arguments in reverse order).

  -- Howard.


More information about the mlvm-dev mailing list