Get the severity of the test

@param testMethod
@return severity
549322
public static String getSeverity(JUnitTestData testMethod) {
        String severity = "~";
        if (testMethod.getFailException() != null) {
            severity = "High";
        }
        return severity;
    }
35781
public Level getEffectiveLevel() {
        if (slf4jLogger.isTraceEnabled()) {
            return Level.TRACE;
        }
        if (slf4jLogger.isDebugEnabled()) {
            return Level.DEBUG;
        }
        if (slf4jLogger.isInfoEnabled()) {
            return Level.INFO;
        }
        if (slf4jLogger.isWarnEnabled()) {
            return Level.WARN;
        }
        return Level.ERROR;
    }
61927
private NullnessAnnotation getMethodNullnessAnnotation() {

        if (method.getSignature().indexOf(")L") >= 0 || method.getSignature().indexOf(")[") >= 0) {
            if (DEBUG_NULLRETURN) {
                System.out.println("Checking return annotation for "
                        + SignatureConverter.convertMethodSignature(classContext.getJavaClass(), method));
            }

            XMethod m = XFactory.createXMethod(classContext.getJavaClass(), method);
            return AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase().getResolvedAnnotation(m, false);
        }
        return NullnessAnnotation.UNKNOWN_NULLNESS;
    }
933937
def severity(self):
        
        if self._proto.HasField('severity'):
            return yamcs_pb2.Event.EventSeverity.Name(self._proto.severity)
        return None
1287992
@Override
    public String getMethod() {
        String method = this.request.getMethod();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getMethod: " + method);
        }
        return method;
    }
688504
public com.google.javascript.jscomp.Requirement.Severity getSeverity() {
    com.google.javascript.jscomp.Requirement.Severity result = com.google.javascript.jscomp.Requirement.Severity.valueOf(severity_);
    return result == null ? com.google.javascript.jscomp.Requirement.Severity.WARNING : result;
  }
1209653
private static Method findGetMethod(Class<? extends Bean> beanType, String getterName) {
        try {
            return beanType.getDeclaredMethod(getterName);
        } catch (NoSuchMethodException ex) {
            try {
                return beanType.getMethod(getterName);
            } catch (NoSuchMethodException ex2) {
                return null;
            }
        }
    }
141757
private Severity getSeverity(SeverityEnumType severityType, Severity defaultSeverity) throws RuleException {
        return severityType == null ? defaultSeverity : Severity.fromValue(severityType.value());
    }
1252853
@Nullable
  static Long getTimeoutFromMethodConfig(Map<String, ?> methodConfig) {
    if (!methodConfig.containsKey(METHOD_CONFIG_TIMEOUT_KEY)) {
      return null;
    }
    String rawTimeout = getString(methodConfig, METHOD_CONFIG_TIMEOUT_KEY);
    try {
      return parseDuration(rawTimeout);
    } catch (ParseException e) {
      throw new RuntimeException(e);
    }
  }
156628
private String getMethodName(Method method) {
        StatName statNameAnnotation = method.getAnnotation(StatName.class);
        return statNameAnnotation != null ? statNameAnnotation.value() : method.getName();
    }
675195
public static String getCallerMethod()
  {
    StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
    if(stackTrace.length == 0) {
      return "unknown";
    }
    final StackTraceElement e = stackTrace[0];
    return Strings.concat(e.getClassName(), '#', e.getMethodName(), ':', e.getLineNumber());
  }
304396
public static Method findMethod(Collection<Method> methods, Method testMethod)
  {
    for (Method method : methods) {
      if (isMatch(method, testMethod))
        return method;
    }
    
    return null;
  }
1048314
static String getMethodSignature(Method m) {
      StringBuilder result = new StringBuilder();
      result.append('(');
      for (Class<?> parameterType : m.getParameterTypes()) {
        result.append(getSignature(parameterType));
      }
      result.append(")");
      result.append(getSignature(m.getReturnType()));
      return result.toString();
    }
1121356
@SuppressWarnings("null")
    public static Method getMethod(EvaluationContext ctx, Object base, Object property,
            Class<?>[] paramTypes, Object[] paramValues)
            throws MethodNotFoundException {
        if (base == null || property == null) {
            throw new MethodNotFoundException(MessageFactory.get(
                    "error.method.notfound", base, property,
                    paramString(paramTypes)));
        }

        String methodName = (property instanceof String) ? (String) property
                : property.toString();

        int paramCount;
        if (paramTypes == null) {
            paramCount = 0;
        } else {
            paramCount = paramTypes.length;
        }

        Method[] methods = base.getClass().getMethods();
        Map<Method,MatchResult> candidates = new HashMap<>();

        for (Method m : methods) {
            if (!m.getName().equals(methodName)) {
                // Method name doesn't match
                continue;
            }

            Class<?>[] mParamTypes = m.getParameterTypes();
            //149852 - This was removed due to a findBugs error we felt was worthy of a change.
            //m.getParameterTypes will ALWAYS return an array, it may be of length 0 though
            int mParamCount = mParamTypes.length;

            // Check the number of parameters
            if (!(paramCount == mParamCount ||
                    (m.isVarArgs() && paramCount >= mParamCount))) {
                // Method has wrong number of parameters
                continue;
            }

            // Check the parameters match
            int exactMatch = 0;
            int assignableMatch = 0;
            int coercibleMatch = 0;
            boolean noMatch = false;
            for (int i = 0; i < mParamCount; i++) {
                // Can't be null
                if (mParamTypes[i].equals(paramTypes[i])) {
                    exactMatch++;
                } else if (i == (mParamCount - 1) && m.isVarArgs()) {
                    Class<?> varType = mParamTypes[i].getComponentType();
                    for (int j = i; j < paramCount; j++) {
                        if (isAssignableFrom(paramTypes[j], varType)) {
                            assignableMatch++;
                        } else {
                            if (paramValues == null) {
                                noMatch = true;
                                break;
                            } else {
                                if (isCoercibleFrom(ctx, paramValues[j], varType)) {
                                    coercibleMatch++;
                                } else {
                                    noMatch = true;
                                    break;
                                }
                            }
                        }
                        // Don't treat a varArgs match as an exact match, it can
                        // lead to a varArgs method matching when the result
                        // should be ambiguous
                    }
                } else if (isAssignableFrom(paramTypes[i], mParamTypes[i])) {
                    assignableMatch++;
                } else {
                    if (paramValues == null) {
                        noMatch = true;
                        break;
                    } else {
                        if (isCoercibleFrom(ctx, paramValues[i], mParamTypes[i])) {
                            coercibleMatch++;
                        } else {
                            noMatch = true;
                            break;
                        }
                    }
                }
            }
            if (noMatch) {
                continue;
            }

            // If a method is found where every parameter matches exactly,
            // return it
            if (exactMatch == paramCount) {
                return getMethod(base.getClass(), m);
            }

            candidates.put(m, new MatchResult(
                    exactMatch, assignableMatch, coercibleMatch, m.isBridge()));
        }

        // Look for the method that has the highest number of parameters where
        // the type matches exactly
        MatchResult bestMatch = new MatchResult(0, 0, 0, false);
        Method match = null;
        boolean multiple = false;
        for (Map.Entry<Method, MatchResult> entry : candidates.entrySet()) {
            int cmp = entry.getValue().compareTo(bestMatch);
            if (cmp > 0 || match == null) {
                bestMatch = entry.getValue();
                match = entry.getKey();
                multiple = false;
            } else if (cmp == 0) {
                multiple = true;
            }
        }
        if (multiple) {
            if (bestMatch.getExact() == paramCount - 1) {
                // Only one parameter is not an exact match - try using the
                // super class
                match = resolveAmbiguousMethod(candidates.keySet(), paramTypes);
            } else {
                match = null;
            }

            if (match == null) {
                // If multiple methods have the same matching number of parameters
                // the match is ambiguous so throw an exception
                throw new MethodNotFoundException(MessageFactory.get(
                        "error.method.ambiguous", base, property,
                        paramString(paramTypes)));
                }
        }

        // Handle case where no match at all was found
        if (match == null) {
            throw new MethodNotFoundException(MessageFactory.get(
                        "error.method.notfound", base, property,
                        paramString(paramTypes)));
        }

        return getMethod(base.getClass(), match);
    }
1282901
private static List<MethodParameterDto> _getMethodParams(Method method) {
        List<MethodParameterDto> result = new ArrayList<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        Class<?>[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; i++) {
            Class<?> parameterType = parameterTypes[i];
            Annotation[] annotations = parameterAnnotations[i];

            if (annotations.length > 0) {
            	
            	if (Context.class.isAssignableFrom(annotations[0].getClass())) {
                	continue;
                }
            	
            	MethodParameterDto param = new MethodParameterDto();
                for (int j = 0; j < annotations.length; j++) {
                    Annotation annotation = annotations[j];
                        
                    if (QueryParam.class.isAssignableFrom(annotation.getClass())) {
                        QueryParam queryParam = QueryParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("query");
                    } else if (FormParam.class.isAssignableFrom(annotation.getClass())) {
                        FormParam queryParam = FormParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("form");
                    } else if (PathParam.class.isAssignableFrom(annotation.getClass())) {
                        PathParam queryParam = PathParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("path");
                    } else if (DefaultValue.class.isAssignableFrom(annotation.getClass())) {
                    	DefaultValue defaultValue = DefaultValue.class.cast(annotation);
                    	
                    	param.setDefaultValue(defaultValue.value());
                    }
                    
                    try {
                        if (BaseDto.class.isAssignableFrom(parameterType)) {
                            param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                        }
                    } catch (Exception ex) {
                        param.setSchema(parameterType);
                    }

                    String paramName = parameterType.getSimpleName().toLowerCase();
                    param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                }
                
                result.add(param);
            } else {
            	MethodParameterDto param = new MethodParameterDto();
                String paramName = parameterType.getSimpleName().toLowerCase();

                param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                param.setName("body");
                param.setParamType("body");
                try {
                    if (BaseDto.class.isAssignableFrom(parameterType)) {
                        param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                    }
                } catch (Exception ex) {
                    param.setSchema(parameterType);
                }
                result.add(param);
            } // end if-else
        } // end for
        return result;
    }
989572
public JMethod []getDeclaredMethods()
  {
    SoftReference<JMethod[]> jMethodsRef = _declaredMethodsRef;
    JMethod []jMethods = null;

    if (jMethodsRef != null) {
      jMethods = jMethodsRef.get();
      if (jMethods != null)
        return jMethods;
    }

    Method []methods = _class.getDeclaredMethods();
    
    jMethods = new JMethod[methods.length];

    for (int i = 0; i < methods.length; i++) {
      jMethods[i] = new JMethodWrapper(methods[i], getClassLoader());
    }

    _declaredMethodsRef = new SoftReference<JMethod[]>(jMethods);

    return jMethods;
  }
193492
protected String getMethodSignature(MethodDeclaration m) {
    StringBuilder sb = new StringBuilder();
    ExecutableElement element = m.getExecutableElement();
    char prefix = Modifier.isStatic(m.getModifiers()) ? '+' : '-';
    String returnType = nameTable.getObjCType(element.getReturnType());
    String selector = nameTable.getMethodSelector(element);
    if (m.isConstructor()) {
      returnType = "instancetype";
    } else if (selector.equals("hash")) {
      // Explicitly test hashCode() because of NSObject's hash return value.
      returnType = "NSUInteger";
    }
    sb.append(UnicodeUtils.format("%c (%s%s)", prefix, returnType, nullability(element)));

    List<SingleVariableDeclaration> params = m.getParameters();
    String[] selParts = selector.split(":");

    if (params.isEmpty()) {
      assert selParts.length == 1 && !selector.endsWith(":");
      sb.append(selParts[0]);
    } else {
      assert params.size() == selParts.length;
      int baseLength = sb.length() + selParts[0].length();
      for (int i = 0; i < params.size(); i++) {
        if (i != 0) {
          sb.append('\n');
          sb.append(pad(baseLength - selParts[i].length()));
        }
        VariableElement var = params.get(i).getVariableElement();
        String typeName = nameTable.getObjCType(var.asType());
        sb.append(
            UnicodeUtils.format(
                "%s:(%s%s)%s",
                selParts[i], typeName, nullability(var), nameTable.getVariableShortName(var)));
      }
    }

    return sb.toString();
  }