示例#1
0
        public override Stream <CompilationMessage> VisitVariable(VariableElement parameter, Void ignored)
        {
            Name annotation = parameter.getAnnotation(typeof(Name));

            if (annotation == null)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                return(Stream.of(new ParameterMissingAnnotationError(parameter, AnnotationMirror(parameter.AnnotationMirrors), "@%s usage error: missing on parameter <%s>", typeof(Name).FullName, NameOf(parameter))));
            }

            if (!_parameterTypeVisitor.visit(parameter.asType()))
            {
                Element method = parameter.EnclosingElement;
                return(Stream.of(new ParameterTypeError(parameter, "Unsupported parameter type <%s> of " + "procedure|function" + " %s#%s", parameter.asType().ToString(), method.EnclosingElement.SimpleName, method.SimpleName)));
            }
            return(Stream.empty());
        }
示例#2
0
        private Stream <CompilationMessage> ValidateInjectedTypes(VariableElement field)
        {
            TypeMirror fieldType = field.asType();

            if (InjectsAllowedType(fieldType))
            {
                return(Stream.empty());
            }

            if (InjectsRestrictedType(fieldType))
            {
                if (_ignoresWarnings)
                {
                    return(Stream.empty());
                }

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                return(Stream.of(new ContextFieldWarning(field, "@%s usage warning: found unsupported restricted type <%s> on %s.\n" + "The procedure will not load unless declared via the configuration option 'dbms.security.procedures.unrestricted'.\n" + "You can ignore this warning by passing the option -A%s to the Java compiler", typeof(Context).FullName, fieldType.ToString(), FieldFullName(field), IGNORE_CONTEXT_WARNINGS_OPTION)));
            }

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            return(Stream.of(new ContextFieldError(field, "@%s usage error: found unknown type <%s> on field %s, expected one of: %s", typeof(Context).FullName, fieldType.ToString(), FieldFullName(field), JoinTypes(_supportedTypes))));
        }