GrParameterInfo[] (GrMethod method) { GrParameter[] params = method.getParameterList().getParameters(); int size = myInfos.size(); GrParameterInfo[] result = new GrParameterInfo[size]; for (int i = 0; i < size; i++) { final SimpleInfo sim = myInfos.get(i); int oldIndex = sim.myOldIndex; GrParameterInfo info; String name = null; String defInitializer = null; PsiType type = null; String defValue = null; if (oldIndex > -1) { final GrParameter p = params[oldIndex]; name = p.getName(); final GrExpression initializer = p.getInitializerGroovy(); defInitializer = initializer != null ? initializer.getText() : null; type = p.getDeclaredType(); } if (sim.myNewName != null) { name = sim.myNewName; } if (sim.myType != null && !sim.myType.isEmpty()) { type = JavaPsiFacade.getElementFactory(myProject).createTypeFromText(sim.myType, method); } if (sim.myDefaultInitializer != null) { defInitializer = sim.myDefaultInitializer; } if (sim.myDefaultValue != null) { defValue = sim.myDefaultValue; } assert oldIndex >= 0 || defValue != null || defInitializer != null; assert name != null; info = new GrParameterInfo(name, defValue, defInitializer, type, oldIndex, sim.myFeelLucky); result[i] = info; } return result; }