Extract a helper method

PiperOrigin-RevId: 398012472
diff --git a/java/com/google/turbine/binder/CanonicalTypeBinder.java b/java/com/google/turbine/binder/CanonicalTypeBinder.java
index cbc0f47..91fbac7 100644
--- a/java/com/google/turbine/binder/CanonicalTypeBinder.java
+++ b/java/com/google/turbine/binder/CanonicalTypeBinder.java
@@ -119,17 +119,14 @@
       ImmutableMap<TyVarSymbol, TyVarInfo> tps =
           typeParameters(source, pos, env, sym, base.tyParams());
       Type ret = Canonicalize.canonicalize(source, pos, env, sym, base.returnType());
-      ImmutableList.Builder<ParamInfo> parameters = ImmutableList.builder();
-      for (ParamInfo parameter : base.parameters()) {
-        parameters.add(param(source, pos, env, sym, parameter));
-      }
+      ImmutableList<ParamInfo> parameters = parameters(source, env, sym, pos, base.parameters());
       ImmutableList<Type> exceptions = canonicalizeList(source, pos, env, sym, base.exceptions());
       result.add(
           new MethodInfo(
               base.sym(),
               tps,
               ret,
-              parameters.build(),
+              parameters,
               exceptions,
               base.access(),
               base.defaultValue(),
@@ -140,6 +137,19 @@
     return result.build();
   }
 
+  private static ImmutableList<ParamInfo> parameters(
+      SourceFile source,
+      Env<ClassSymbol, TypeBoundClass> env,
+      ClassSymbol sym,
+      int pos,
+      ImmutableList<ParamInfo> parameters) {
+    ImmutableList.Builder<ParamInfo> result = ImmutableList.builder();
+    for (ParamInfo parameter : parameters) {
+      result.add(param(source, pos, env, sym, parameter));
+    }
+    return result.build();
+  }
+
   private static ParamInfo param(
       SourceFile source,
       int position,