/** * Throw a ClassNotFoundException to indicate that class named by given * ClassDescriptor cannot be found. The exception message is formatted in a * way that can be decoded by ClassNotFoundExceptionParser. * * @param classDescriptor * ClassDescriptor naming a class that cannot be found * @throws ClassNotFoundException * @see edu.umd.cs.findbugs.ba.ClassNotFoundExceptionParser * @deprecated Use * {@link ClassDescriptor#throwClassNotFoundException(ClassDescriptor)} * instead */ @Deprecated public static void throwClassNotFoundException(ClassDescriptor classDescriptor) throws ClassNotFoundException { ClassDescriptor.throwClassNotFoundException(classDescriptor); }
/** * Get list of all superclasses of class represented by given class vertex, * in order, including the class itself (which is trivially its own * superclass as far as "first common superclass" queries are concerned.) * * @param vertex * a ClassVertex * @return list of all superclass vertices in order */ private ArrayList<ClassVertex> getAllSuperclassVertices(ClassVertex vertex) throws ClassNotFoundException { ArrayList<ClassVertex> result = new ArrayList<>(); ClassVertex cur = vertex; while (cur != null) { if (!cur.isResolved()) { ClassDescriptor.throwClassNotFoundException(cur.getClassDescriptor()); } result.add(cur); cur = cur.getDirectSuperclass(); } return result; }
/** * Resolve a class named by given ClassDescriptor and return its resolved * ClassVertex. * * @param classDescriptor * a ClassDescriptor * @return resolved ClassVertex representing the class in the * InheritanceGraph * @throws ClassNotFoundException * if the class named by the ClassDescriptor does not exist */ private ClassVertex resolveClassVertex(ClassDescriptor classDescriptor) throws ClassNotFoundException { ClassVertex typeVertex = optionallyResolveClassVertex(classDescriptor); if (!typeVertex.isResolved()) { ClassDescriptor.throwClassNotFoundException(classDescriptor); } assert typeVertex.isResolved(); return typeVertex; }
/** * Throw a ClassNotFoundException to indicate that class named by given * ClassDescriptor cannot be found. The exception message is formatted in a * way that can be decoded by ClassNotFoundExceptionParser. * * @param classDescriptor * ClassDescriptor naming a class that cannot be found * @throws ClassNotFoundException * @see edu.umd.cs.findbugs.ba.ClassNotFoundExceptionParser * @deprecated Use * {@link ClassDescriptor#throwClassNotFoundException(ClassDescriptor)} * instead */ @Deprecated public static void throwClassNotFoundException(ClassDescriptor classDescriptor) throws ClassNotFoundException { ClassDescriptor.throwClassNotFoundException(classDescriptor); }
/** * Get list of all superclasses of class represented by given class vertex, * in order, including the class itself (which is trivially its own * superclass as far as "first common superclass" queries are concerned.) * * @param vertex * a ClassVertex * @return list of all superclass vertices in order */ private ArrayList<ClassVertex> getAllSuperclassVertices(ClassVertex vertex) throws ClassNotFoundException { ArrayList<ClassVertex> result = new ArrayList<ClassVertex>(); ClassVertex cur = vertex; while (cur != null) { if (!cur.isResolved()) { ClassDescriptor.throwClassNotFoundException(cur.getClassDescriptor()); } result.add(cur); cur = cur.getDirectSuperclass(); } return result; }
/** * Resolve a class named by given ClassDescriptor and return its resolved * ClassVertex. * * @param classDescriptor * a ClassDescriptor * @return resolved ClassVertex representing the class in the * InheritanceGraph * @throws ClassNotFoundException * if the class named by the ClassDescriptor does not exist */ private ClassVertex resolveClassVertex(ClassDescriptor classDescriptor) throws ClassNotFoundException { ClassVertex typeVertex = optionallyResolveClassVertex(classDescriptor); if (!typeVertex.isResolved()) { ClassDescriptor.throwClassNotFoundException(classDescriptor); } assert typeVertex.isResolved(); return typeVertex; }