private String getUniqueName(Parameter[] params, ConstructorNode node) { String namePrefix = "$p"; outer: for (int i = 0; i < 100; i++) { namePrefix = namePrefix + "$"; for (Parameter p : params) { if (p.getName().equals(namePrefix)) continue outer; } return namePrefix; } addError("unable to find a unique prefix name for synthetic this reference in inner class constructor", node); return namePrefix; }
/** * Adds a compilation error if a {@link MethodNode} with the given <tt>methodName</tt> and * <tt>parameters</tt> exists in the {@link InnerClassNode}. */ private void addCompilationErrorOnCustomMethodNode(InnerClassNode node, String methodName, Parameter[] parameters) { MethodNode existingMethodNode = node.getMethod(methodName, parameters); // if there is a user-defined methodNode, add compiler error msg and continue if (existingMethodNode != null && !isSynthetic(existingMethodNode)) { addError("\"" +methodName + "\" implementations are not supported on static inner classes as " + "a synthetic version of \"" + methodName + "\" is added during compilation for the purpose " + "of outer class delegation.", existingMethodNode); } }