Пример #1
0
        private static string InternalDesc(MethodDeclaration declaration, bool showErasure)
        {
            StringBuilder builder = new StringBuilder();
            IList <MethodDeclaration.TypeParameter> typeParameters = declaration.TypeParameters();

            if (showErasure && typeParameters.Count > 0)
            {
                builder.Append("<");
                foreach (MethodDeclaration.TypeParameter typeParameter in typeParameters)
                {
                    builder.Append(typeParameter.Name()).Append(":");
                    InternalType(builder, typeParameter.ExtendsBound(), true);
                }
                builder.Append(">");
            }
            builder.Append("(");
            foreach (Parameter parameter in declaration.Parameters())
            {
                InternalType(builder, parameter.Type(), showErasure);
            }
            builder.Append(")");
            InternalType(builder, declaration.ReturnType(), showErasure);
            IList <TypeReference> throwsList = declaration.ThrowsList();

//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            if (showErasure && throwsList.Any(TypeReference::isTypeParameter))
            {
                builder.Append("^");
                throwsList.ForEach(t => InternalType(builder, t, false));
            }
            return(builder.ToString());
        }