< prev index next >

test/jdk/valhalla/valuetypes/SubstitutabilityTest.java

Print this page
rev 55117 : 8223350: [lworld] Use inline classes instead of value classes


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary test MethodHandle/VarHandle on value types
  27  * @compile -XDallowWithFieldOperator Point.java Line.java Value.java MutablePath.java MixedValues.java
  28  * @run testng/othervm -XX:+EnableValhalla SubstitutabilityTest
  29  */
  30 
  31 import java.lang.invoke.ValueBootstrapMethods;
  32 import java.util.List;
  33 
  34 import org.testng.annotations.DataProvider;
  35 import org.testng.annotations.Test;
  36 import static org.testng.Assert.*;
  37 
  38 public class SubstitutabilityTest {
  39     @DataProvider(name="substitutable")
  40     Object[][] substitutableCases() {
  41         Point p1 = Point.makePoint(10, 10);
  42         Point p2 = Point.makePoint(20, 20);
  43         Point? box1 = p1;
  44         Point? box2 = p2;
  45         Line l1 = Line.makeLine(p1, p2);
  46         var mpath = MutablePath.makePath(10, 20, 30, 40);




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary test MethodHandle/VarHandle on inline types
  27  * @compile -XDallowWithFieldOperator Point.java Line.java Value.java MutablePath.java MixedValues.java
  28  * @run testng/othervm -XX:+EnableValhalla SubstitutabilityTest
  29  */
  30 
  31 import java.lang.invoke.ValueBootstrapMethods;
  32 import java.util.List;
  33 
  34 import org.testng.annotations.DataProvider;
  35 import org.testng.annotations.Test;
  36 import static org.testng.Assert.*;
  37 
  38 public class SubstitutabilityTest {
  39     @DataProvider(name="substitutable")
  40     Object[][] substitutableCases() {
  41         Point p1 = Point.makePoint(10, 10);
  42         Point p2 = Point.makePoint(20, 20);
  43         Point? box1 = p1;
  44         Point? box2 = p2;
  45         Line l1 = Line.makeLine(p1, p2);
  46         var mpath = MutablePath.makePath(10, 20, 30, 40);


< prev index next >