/*
(non-Javadoc)

@see
javax.persistence.metamodel.ManagedType#getDeclaredList(java.lang.String,
java.lang.Class)
489275
@Override
    public <E> ListAttribute<X, E> getDeclaredList(String paramName, Class<E> paramClass)
    {
        PluralAttribute<X, ?, ?> declaredAttrib = getDeclaredPluralAttribute(paramName);

        if (onCheckListAttribute(declaredAttrib, paramClass))
        {
            return (ListAttribute<X, E>) declaredAttrib;
        }
        throw new IllegalArgumentException(
                "attribute of the given name and type is not present in the managed type, for name:" + paramName
                        + " , type:" + paramClass);
    }
148841
protected <Type extends JvmType> Type findDeclaredType(String clazzName, ITypeReferenceOwner owner) {
		@SuppressWarnings("unchecked")
		Type result = (Type) services.getTypeReferences().findDeclaredType(clazzName, owner.getContextResourceSet());
		return result;
	}
1087358
public ConsumerDispatcher getConsumerDispatcher() 
  {
    if (tc.isEntryEnabled()) 
    {
      SibTr.entry(tc, "getConsumerDispatcher");
      SibTr.exit(tc, "getConsumerDispatcher", consumerDispatcher);	
    }
    return consumerDispatcher;
  }
306087
static Class<?>[] getClassContext(final LogNode log) {
        // For JRE 9+, use StackWalker to get call stack.
        // N.B. need to work around StackWalker bug fixed in JDK 13, and backported to 12.0.2 and 11.0.4
        // (probably introduced in JDK 9, when StackWalker was introduced):
        // https://github.com/classgraph/classgraph/issues/341
        // https://bugs.openjdk.java.net/browse/JDK-8210457
        Class<?>[] stackClasses = null;
        if ((VersionFinder.JAVA_MAJOR_VERSION == 11
                && (VersionFinder.JAVA_MINOR_VERSION >= 1 || VersionFinder.JAVA_SUB_VERSION >= 4)
                && !VersionFinder.JAVA_IS_EA_VERSION)
                || (VersionFinder.JAVA_MAJOR_VERSION == 12
                        && (VersionFinder.JAVA_MINOR_VERSION >= 1 || VersionFinder.JAVA_SUB_VERSION >= 2)
                        && !VersionFinder.JAVA_IS_EA_VERSION)
                || (VersionFinder.JAVA_MAJOR_VERSION == 13 && !VersionFinder.JAVA_IS_EA_VERSION)
                || VersionFinder.JAVA_MAJOR_VERSION > 13) {
            // Invoke with doPrivileged -- see:
            // http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-October/013974.html
            stackClasses = AccessController.doPrivileged(new PrivilegedAction<Class<?>[]>() {
                @Override
                public Class<?>[] run() {
                    return getCallStackViaStackWalker();
                }
            });
        }

        // For JRE 7 and 8, use SecurityManager to get call stack
        if (stackClasses == null || stackClasses.length == 0) {
            stackClasses = AccessController.doPrivileged(new PrivilegedAction<Class<?>[]>() {
                @Override
                public Class<?>[] run() {
                    return getCallStackViaSecurityManager(log);
                }
            });
        }

        // As a fallback, use getStackTrace() to try to get the call stack
        if (stackClasses == null || stackClasses.length == 0) {
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            if (stackTrace == null || stackTrace.length == 0) {
                try {
                    throw new Exception();
                } catch (final Exception e) {
                    stackTrace = e.getStackTrace();
                }
            }
            final List<Class<?>> stackClassesList = new ArrayList<>();
            for (final StackTraceElement elt : stackTrace) {
                try {
                    stackClassesList.add(Class.forName(elt.getClassName()));
                } catch (final ClassNotFoundException | LinkageError ignored) {
                    // Ignored
                }
            }
            if (!stackClassesList.isEmpty()) {
                stackClasses = stackClassesList.toArray(new Class<?>[0]);
            } else {
                // Last-ditch effort -- include just this class in the call stack
                stackClasses = new Class<?>[] { CallStackReader.class };
            }
        }
        return stackClasses;
    }
500434
public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
		List<Method> result = new ArrayList<>();
		while (clazz != null) {
			Method[] methods = clazz.getDeclaredMethods();
			Collections.addAll(result, methods);
			clazz = clazz.getSuperclass();
		}
		return result;
	}
675553
public static final DeclarationTransformer getDeclarationTransformer() {
        if (dt == null) {
            try {
                @SuppressWarnings("unchecked")
                Class<? extends DeclarationTransformerImpl> clazz = (Class<? extends DeclarationTransformerImpl>) Class
                        .forName(DEFAULT_DECLARATION_TRANSFORMER);
                Method m = clazz.getMethod("getInstance");
                registerDeclarationTransformer((DeclarationTransformerImpl) m.invoke(null));
                log.debug("Retrived {} as default DeclarationTransformer implementation.",
                        DEFAULT_DECLARATION_TRANSFORMER);
            } catch (Exception e) {
                log.error("Unable to get DeclarationTransformer from default", e);
                throw new RuntimeException(
                        "No DeclarationTransformer implementation registered!");
            }
        }

        return dt;
    }
1262953
static ProviderIdent getProviderDeclaration(final Class<?> cls) throws PluginException {
        final Plugin annotation = getPluginMetadata(cls);
        return new ProviderIdent(annotation.service(), annotation.name());
    }
717013
@Override
    public String _getIDClass() {
        IdClass idCls = this.getIdClass();
        if (idCls == null) {
            return null;
        }

        return idCls.getClazz();
    }
1187816
@Override
    public Reference getReference() {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
            SibTr.entry(this, TRACE, "getReference");

        final Reference reference = _managedConnectionFactory.getReference();

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
            SibTr.exit(this, TRACE, "getReference", reference);

        return reference;
    }
322782
@javax.jdo.annotations.NotPersistent
    @MemberOrder(sequence="2")
    public String getSector() {
        final Tag existingTag = getSectorTag();
        return existingTag != null ? existingTag.getValue() : null;
    }
578376
@Override
    public JSConsumerManager getLocalPtoPConsumerManager()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getLocalPtoPConsumerManager", this);

        JSConsumerManager consumerManager = null;

        if (_pToPLocalMsgsItemStream != null)
        {
            consumerManager =
                            (JSConsumerManager) _pToPLocalMsgsItemStream.getOutputHandler();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getLocalPtoPConsumerManager", consumerManager);

        return consumerManager;
    }
37231
public java.lang.String getRel() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.rel);

    }
1187991
private int getDeltaInsertionIndex(
      MethodInvocationTree methodInvocationTree, VisitorState state) {
    JCTree lastArgument = (JCTree) Iterables.getLast(methodInvocationTree.getArguments());
    return state.getEndPosition(lastArgument);
  }
1372304
public static Field[] getDeclaredFields(Class<?> clazz) throws SecurityException {
		if (null == clazz) {
			return null;
		}
		return clazz.getDeclaredFields();
	}
426955
public static Element getDeclaredElement(TreeNode node) {
    if (node instanceof AbstractTypeDeclaration) {
      return ((AbstractTypeDeclaration) node).getTypeElement();
    } else if (node instanceof MethodDeclaration) {
      return ((MethodDeclaration) node).getExecutableElement();
    } else if (node instanceof VariableDeclaration) {
      return ((VariableDeclaration) node).getVariableElement();
    }
    return null;
  }
81369
public static Type getDeclaredBeanType(Class<?> clazz) {
        Type[] actualTypeArguments = Reflections.getActualTypeArguments(clazz);
        if (actualTypeArguments.length == 1) {
            return actualTypeArguments[0];
        } else {
            return null;
        }
    }
37980
public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
		if (cl == null) {
			throw new NullPointerException("The classloader must not be null.");
		}
		if (invokableClassName == null) {
			return null;
		}

		try {
			return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokable.class);
		}
		catch (ClassNotFoundException e) {
			throw new RuntimeException("The user-code class could not be resolved.", e);
		}
		catch (ClassCastException e) {
			throw new RuntimeException("The user-code class is no subclass of " + AbstractInvokable.class.getName(), e);
		}
	}