test/java/lang/invoke/LFCaching/TestMethods.java

Print this page

        

@@ -362,10 +362,11 @@
     INVOKER("invoker") {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
                     int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    desiredArity = desiredArity <= 252 ? desiredArity : 252;
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
                 }
 

@@ -378,10 +379,11 @@
     EXACT_INVOKER("exactInvoker") {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
                     int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    desiredArity = desiredArity <= 252 ? desiredArity : 252;
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     return data;
                 }
 

@@ -394,10 +396,11 @@
     SPREAD_INVOKER("spreadInvoker") {
                 @Override
                 public Map<String, Object> getTestCaseData() {
                     Map<String, Object> data = new HashMap<>();
                     int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+                    desiredArity = desiredArity <= 252 ? desiredArity : 252;
                     MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
                     data.put("mtTarget", mtTarget);
                     // Arity after reducing because of long and double take 2 slots.
                     int realArity = mtTarget.parameterCount();
                     int modifierMHArgNum = Helper.RNG.nextInt(realArity + 1);