@@ -312,7 +312,7 @@ public void testReplaceChildren() throws Exception {
312312 * {@code ctor} that make sense when {@code ctor}
313313 * builds subclasses of {@link Node}.
314314 */
315- private Object [] ctorArgs (Constructor <? extends Node <?>> ctor ) throws Exception {
315+ public static Object [] ctorArgs (Constructor <? extends Node <?>> ctor ) {
316316 Type [] argTypes = ctor .getGenericParameterTypes ();
317317 Object [] args = new Object [argTypes .length ];
318318 for (int i = 0 ; i < argTypes .length ; i ++) {
@@ -351,7 +351,7 @@ protected Object makeArg(Type argType) {
351351 * Make an argument to feed to the constructor for {@code toBuildClass}.
352352 */
353353 @ SuppressWarnings ("unchecked" )
354- private Object makeArg (Class <? extends Node <?>> toBuildClass , Type argType ) throws Exception {
354+ private static Object makeArg (Class <? extends Node <?>> toBuildClass , Type argType ) throws Exception {
355355
356356 if (argType instanceof ParameterizedType pt ) {
357357 if (pt .getRawType () == Map .class ) {
@@ -525,31 +525,31 @@ public void accept(Page page) {
525525 }
526526 }
527527
528- private List <?> makeList (Class <? extends Node <?>> toBuildClass , ParameterizedType listType ) throws Exception {
528+ private static List <?> makeList (Class <? extends Node <?>> toBuildClass , ParameterizedType listType ) throws Exception {
529529 return makeList (toBuildClass , listType , randomSizeForCollection (toBuildClass ));
530530 }
531531
532- private List <?> makeList (Class <? extends Node <?>> toBuildClass , ParameterizedType listType , int size ) throws Exception {
532+ private static List <?> makeList (Class <? extends Node <?>> toBuildClass , ParameterizedType listType , int size ) throws Exception {
533533 List <Object > list = new ArrayList <>();
534534 for (int i = 0 ; i < size ; i ++) {
535535 list .add (makeArg (toBuildClass , listType .getActualTypeArguments ()[0 ]));
536536 }
537537 return list ;
538538 }
539539
540- private Set <?> makeSet (Class <? extends Node <?>> toBuildClass , ParameterizedType listType ) throws Exception {
540+ private static Set <?> makeSet (Class <? extends Node <?>> toBuildClass , ParameterizedType listType ) throws Exception {
541541 return makeSet (toBuildClass , listType , randomSizeForCollection (toBuildClass ));
542542 }
543543
544- private Set <?> makeSet (Class <? extends Node <?>> toBuildClass , ParameterizedType listType , int size ) throws Exception {
544+ private static Set <?> makeSet (Class <? extends Node <?>> toBuildClass , ParameterizedType listType , int size ) throws Exception {
545545 Set <Object > list = new HashSet <>();
546546 for (int i = 0 ; i < size ; i ++) {
547547 list .add (makeArg (toBuildClass , listType .getActualTypeArguments ()[0 ]));
548548 }
549549 return list ;
550550 }
551551
552- private Object makeMap (Class <? extends Node <?>> toBuildClass , ParameterizedType pt ) throws Exception {
552+ private static Object makeMap (Class <? extends Node <?>> toBuildClass , ParameterizedType pt ) throws Exception {
553553 Map <Object , Object > map = new HashMap <>();
554554 int size = randomSizeForCollection (toBuildClass );
555555 while (map .size () < size ) {
@@ -560,7 +560,7 @@ private Object makeMap(Class<? extends Node<?>> toBuildClass, ParameterizedType
560560 return map ;
561561 }
562562
563- private int randomSizeForCollection (Class <? extends Node <?>> toBuildClass ) {
563+ private static int randomSizeForCollection (Class <? extends Node <?>> toBuildClass ) {
564564 int minCollectionLength = 0 ;
565565 int maxCollectionLength = 10 ;
566566
@@ -584,7 +584,7 @@ private List<?> makeListOfSameSizeOtherThan(Type listType, List<?> original) thr
584584
585585 }
586586
587- public <T extends Node <?>> T makeNode (Class <? extends T > nodeClass ) throws Exception {
587+ public static <T extends Node <?>> T makeNode (Class <? extends T > nodeClass ) throws Exception {
588588 if (Modifier .isAbstract (nodeClass .getModifiers ())) {
589589 nodeClass = randomFrom (innerSubclassesOf (nodeClass ));
590590 }
@@ -666,15 +666,15 @@ static <T> Constructor<T> longestCtor(Class<T> clazz) {
666666 return longest ;
667667 }
668668
669- private boolean hasAtLeastTwoChildren (Class <? extends Node <?>> toBuildClass ) {
669+ private static boolean hasAtLeastTwoChildren (Class <? extends Node <?>> toBuildClass ) {
670670 return CLASSES_WITH_MIN_TWO_CHILDREN .stream ().anyMatch (toBuildClass ::equals );
671671 }
672672
673673 static boolean isPlanNodeClass (Class <? extends Node <?>> toBuildClass ) {
674674 return PhysicalPlan .class .isAssignableFrom (toBuildClass ) || LogicalPlan .class .isAssignableFrom (toBuildClass );
675675 }
676676
677- Expression randomResolvedExpression (Class <?> argClass ) throws Exception {
677+ static Expression randomResolvedExpression (Class <?> argClass ) throws Exception {
678678 assert Expression .class .isAssignableFrom (argClass );
679679 @ SuppressWarnings ("unchecked" )
680680 Class <? extends Expression > asNodeSubclass = (Class <? extends Expression >) argClass ;
@@ -740,7 +740,7 @@ public static <T> Set<Class<? extends T>> subclassesOf(Class<T> clazz) throws IO
740740 return subclassesOf (clazz , CLASSNAME_FILTER );
741741 }
742742
743- private <T > Set <Class <? extends T >> innerSubclassesOf (Class <T > clazz ) throws IOException {
743+ private static <T > Set <Class <? extends T >> innerSubclassesOf (Class <T > clazz ) throws IOException {
744744 return subclassesOf (clazz , CLASSNAME_FILTER );
745745 }
746746
0 commit comments