RFR(S): JDK-8189690 Static fields support for Value Types is broken

David Simms david.simms at oracle.com
Fri Oct 20 08:14:08 UTC 2017


The fix looks fine, could we maybe something like this to 
"ValueTypeCreation.java" (inner class should be fine)...

final __ByValue class StaticSelf {

     static final StaticSelf DEFAULT = create(0,0);

     final int f1;

     private StaticSelf() { f1 = 0; }

     public String toString() { return "StaticSelf f1=" + f1; }

     __ValueFactory static StaticSelf create(int f1) {

         StaticSelf s = __MakeDefault StaticSelf();

         s.f1 = f1;

         return s;

     }

     public static void test() { /*** run me ***/

         String s = DEFAULT.toString();

     }

}



Cheers
/David Simms


On 19/10/17 22:29, Frederic Parain wrote:
> Please review this small fix on static fields handling:
>
> CR: https://bugs.openjdk.java.net/browse/JDK-8189690
>
> Webrev: http://cr.openjdk.java.net/~fparain/8189690/webrev.00/index.html
>
> Thank you,
>
> Fred
>




More information about the valhalla-dev mailing list