450N/A/*
1011N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
450N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
450N/A *
450N/A * This code is free software; you can redistribute it and/or modify it
450N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
450N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
450N/A *
450N/A * This code is distributed in the hope that it will be useful, but WITHOUT
450N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
450N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
450N/A * version 2 for more details (a copy is included in the LICENSE file that
450N/A * accompanied this code).
450N/A *
450N/A * You should have received a copy of the GNU General Public License version
450N/A * 2 along with this work; if not, write to the Free Software Foundation,
450N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
450N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
450N/A */
450N/Apackage com.sun.tools.classfile;
450N/A
450N/Aimport java.util.Deque;
450N/Aimport java.util.HashMap;
450N/Aimport java.util.HashSet;
450N/Aimport java.util.LinkedList;
450N/Aimport java.util.List;
450N/Aimport java.util.Map;
450N/Aimport java.util.Set;
450N/Aimport java.util.regex.Pattern;
450N/A
450N/Aimport com.sun.tools.classfile.Dependency.Finder;
450N/Aimport com.sun.tools.classfile.Dependency.Filter;
450N/Aimport com.sun.tools.classfile.Dependency.Location;
450N/Aimport com.sun.tools.classfile.Type.ArrayType;
450N/Aimport com.sun.tools.classfile.Type.ClassSigType;
450N/Aimport com.sun.tools.classfile.Type.ClassType;
450N/Aimport com.sun.tools.classfile.Type.MethodType;
450N/Aimport com.sun.tools.classfile.Type.SimpleType;
450N/Aimport com.sun.tools.classfile.Type.TypeParamType;
450N/Aimport com.sun.tools.classfile.Type.WildcardType;
450N/A
450N/Aimport static com.sun.tools.classfile.ConstantPool.*;
450N/A
450N/A/**
450N/A * A framework for determining {@link Dependency dependencies} between class files.
450N/A *
450N/A * A {@link Dependency.Finder finder} is used to identify the dependencies of
450N/A * individual classes. Some finders may return subtypes of {@code Dependency} to
450N/A * further characterize the type of dependency, such as a dependency on a
450N/A * method within a class.
450N/A *
450N/A * A {@link Dependency.Filter filter} may be used to restrict the set of
450N/A * dependencies found by a finder.
450N/A *
450N/A * Dependencies that are found may be passed to a {@link Dependencies.Recorder
450N/A * recorder} so that the dependencies can be stored in a custom data structure.
450N/A */
450N/Apublic class Dependencies {
450N/A /**
450N/A * Thrown when a class file cannot be found.
450N/A */
450N/A public static class ClassFileNotFoundException extends Exception {
450N/A private static final long serialVersionUID = 3632265927794475048L;
450N/A
450N/A public ClassFileNotFoundException(String className) {
450N/A super(className);
450N/A this.className = className;
450N/A }
450N/A
450N/A public ClassFileNotFoundException(String className, Throwable cause) {
450N/A this(className);
450N/A initCause(cause);
450N/A }
450N/A
450N/A public final String className;
450N/A }
450N/A
450N/A /**
450N/A * Thrown when an exception is found processing a class file.
450N/A */
450N/A public static class ClassFileError extends Error {
450N/A private static final long serialVersionUID = 4111110813961313203L;
450N/A
450N/A public ClassFileError(Throwable cause) {
450N/A initCause(cause);
450N/A }
450N/A }
450N/A
450N/A /**
450N/A * Service provider interface to locate and read class files.
450N/A */
450N/A public interface ClassFileReader {
450N/A /**
450N/A * Get the ClassFile object for a specified class.
450N/A * @param className the name of the class to be returned.
450N/A * @return the ClassFile for the given class
450N/A * @throws Dependencies#ClassFileNotFoundException if the classfile cannot be
450N/A * found
450N/A */
450N/A public ClassFile getClassFile(String className)
450N/A throws ClassFileNotFoundException;
450N/A }
450N/A
450N/A /**
450N/A * Service provide interface to handle results.
450N/A */
450N/A public interface Recorder {
450N/A /**
450N/A * Record a dependency that has been found.
450N/A * @param d
450N/A */
450N/A public void addDependency(Dependency d);
450N/A }
450N/A
450N/A /**
450N/A * Get the default finder used to locate the dependencies for a class.
450N/A * @return the default finder
450N/A */
450N/A public static Finder getDefaultFinder() {
450N/A return new APIDependencyFinder(AccessFlags.ACC_PRIVATE);
450N/A }
450N/A
450N/A /**
450N/A * Get a finder used to locate the API dependencies for a class.
450N/A * These include the superclass, superinterfaces, and classes referenced in
450N/A * the declarations of fields and methods. The fields and methods that
450N/A * are checked can be limited according to a specified access.
450N/A * The access parameter must be one of {@link AccessFlags#ACC_PUBLIC ACC_PUBLIC},
450N/A * {@link AccessFlags#ACC_PRIVATE ACC_PRIVATE},
450N/A * {@link AccessFlags#ACC_PROTECTED ACC_PROTECTED}, or 0 for
450N/A * package private access. Members with greater than or equal accessibility
450N/A * to that specified will be searched for dependencies.
450N/A * @param access the access of members to be checked
450N/A * @return an API finder
450N/A */
450N/A public static Finder getAPIFinder(int access) {
450N/A return new APIDependencyFinder(access);
450N/A }
450N/A
450N/A /**
450N/A * Get the finder used to locate the dependencies for a class.
450N/A * @return the finder
450N/A */
450N/A public Finder getFinder() {
450N/A if (finder == null)
450N/A finder = getDefaultFinder();
450N/A return finder;
450N/A }
450N/A
450N/A /**
450N/A * Set the finder used to locate the dependencies for a class.
450N/A * @param f the finder
450N/A */
450N/A public void setFinder(Finder f) {
450N/A f.getClass(); // null check
450N/A finder = f;
450N/A }
450N/A
450N/A /**
450N/A * Get the default filter used to determine included when searching
450N/A * the transitive closure of all the dependencies.
450N/A * Unless overridden, the default filter accepts all dependencies.
450N/A * @return the default filter.
450N/A */
450N/A public static Filter getDefaultFilter() {
450N/A return DefaultFilter.instance();
450N/A }
450N/A
450N/A /**
450N/A * Get a filter which uses a regular expression on the target's class name
450N/A * to determine if a dependency is of interest.
450N/A * @param pattern the pattern used to match the target's class name
450N/A * @return a filter for matching the target class name with a regular expression
450N/A */
450N/A public static Filter getRegexFilter(Pattern pattern) {
450N/A return new TargetRegexFilter(pattern);
450N/A }
450N/A
450N/A /**
450N/A * Get a filter which checks the package of a target's class name
450N/A * to determine if a dependency is of interest. The filter checks if the
450N/A * package of the target's class matches any of a set of given package
450N/A * names. The match may optionally match subpackages of the given names as well.
450N/A * @param packageNames the package names used to match the target's class name
450N/A * @param matchSubpackages whether or not to match subpackages as well
450N/A * @return a filter for checking the target package name against a list of package names
450N/A */
450N/A public static Filter getPackageFilter(Set<String> packageNames, boolean matchSubpackages) {
450N/A return new TargetPackageFilter(packageNames, matchSubpackages);
450N/A }
450N/A
450N/A /**
450N/A * Get the filter used to determine the dependencies included when searching
450N/A * the transitive closure of all the dependencies.
450N/A * Unless overridden, the default filter accepts all dependencies.
450N/A * @return the filter
450N/A */
450N/A public Filter getFilter() {
450N/A if (filter == null)
450N/A filter = getDefaultFilter();
450N/A return filter;
450N/A }
450N/A
450N/A /**
450N/A * Set the filter used to determine the dependencies included when searching
450N/A * the transitive closure of all the dependencies.
450N/A * @param f the filter
450N/A */
450N/A public void setFilter(Filter f) {
450N/A f.getClass(); // null check
450N/A filter = f;
450N/A }
450N/A
450N/A /**
450N/A * Find the dependencies of a class, using the current
450N/A * {@link Dependencies#getFinder finder} and
450N/A * {@link Dependencies#getFilter filter}.
450N/A * The search may optionally include the transitive closure of all the
450N/A * filtered dependencies, by also searching in the classes named in those
450N/A * dependencies.
450N/A * @param classFinder a finder to locate class files
450N/A * @param rootClassNames the names of the root classes from which to begin
450N/A * searching
450N/A * @param transitiveClosure whether or not to also search those classes
450N/A * named in any filtered dependencies that are found.
450N/A * @return the set of dependencies that were found
450N/A * @throws ClassFileNotFoundException if a required class file cannot be found
450N/A * @throws ClassFileError if an error occurs while processing a class file,
450N/A * such as an error in the internal class file structure.
450N/A */
450N/A public Set<Dependency> findAllDependencies(
450N/A ClassFileReader classFinder, Set<String> rootClassNames,
450N/A boolean transitiveClosure)
450N/A throws ClassFileNotFoundException {
450N/A final Set<Dependency> results = new HashSet<Dependency>();
450N/A Recorder r = new Recorder() {
450N/A public void addDependency(Dependency d) {
450N/A results.add(d);
450N/A }
450N/A };
450N/A findAllDependencies(classFinder, rootClassNames, transitiveClosure, r);
450N/A return results;
450N/A }
450N/A
450N/A
450N/A
450N/A /**
450N/A * Find the dependencies of a class, using the current
450N/A * {@link Dependencies#getFinder finder} and
450N/A * {@link Dependencies#getFilter filter}.
450N/A * The search may optionally include the transitive closure of all the
450N/A * filtered dependencies, by also searching in the classes named in those
450N/A * dependencies.
450N/A * @param classFinder a finder to locate class files
450N/A * @param rootClassNames the names of the root classes from which to begin
450N/A * searching
450N/A * @param transitiveClosure whether or not to also search those classes
450N/A * named in any filtered dependencies that are found.
450N/A * @param recorder a recorder for handling the results
450N/A * @throws ClassFileNotFoundException if a required class file cannot be found
450N/A * @throws ClassFileError if an error occurs while processing a class file,
450N/A * such as an error in the internal class file structure.
450N/A */
450N/A public void findAllDependencies(
450N/A ClassFileReader classFinder, Set<String> rootClassNames,
450N/A boolean transitiveClosure, Recorder recorder)
450N/A throws ClassFileNotFoundException {
450N/A Set<String> doneClasses = new HashSet<String>();
450N/A
450N/A getFinder(); // ensure initialized
450N/A getFilter(); // ensure initialized
450N/A
450N/A // Work queue of names of classfiles to be searched.
450N/A // Entries will be unique, and for classes that do not yet have
450N/A // dependencies in the results map.
450N/A Deque<String> deque = new LinkedList<String>(rootClassNames);
450N/A
450N/A String className;
450N/A while ((className = deque.poll()) != null) {
450N/A assert (!doneClasses.contains(className));
450N/A doneClasses.add(className);
450N/A
450N/A ClassFile cf = classFinder.getClassFile(className);
450N/A
450N/A // The following code just applies the filter to the dependencies
450N/A // followed for the transitive closure.
450N/A for (Dependency d: finder.findDependencies(cf)) {
450N/A recorder.addDependency(d);
450N/A if (transitiveClosure && filter.accepts(d)) {
450N/A String cn = d.getTarget().getClassName();
450N/A if (!doneClasses.contains(cn))
450N/A deque.add(cn);
450N/A }
450N/A }
450N/A }
450N/A }
450N/A
450N/A private Filter filter;
450N/A private Finder finder;
450N/A
450N/A /**
450N/A * A location identifying a class.
450N/A */
450N/A static class SimpleLocation implements Location {
450N/A public SimpleLocation(String className) {
450N/A this.className = className;
450N/A }
450N/A
450N/A /**
450N/A * Get the name of the class being depended on. This name will be used to
450N/A * locate the class file for transitive dependency analysis.
450N/A * @return the name of the class being depended on
450N/A */
450N/A public String getClassName() {
450N/A return className;
450N/A }
450N/A
450N/A @Override
450N/A public boolean equals(Object other) {
450N/A if (this == other)
450N/A return true;
450N/A if (!(other instanceof SimpleLocation))
450N/A return false;
450N/A return (className.equals(((SimpleLocation) other).className));
450N/A }
450N/A
450N/A @Override
450N/A public int hashCode() {
450N/A return className.hashCode();
450N/A }
450N/A
450N/A @Override
450N/A public String toString() {
450N/A return className;
450N/A }
450N/A
450N/A private String className;
450N/A }
450N/A
450N/A /**
450N/A * A dependency of one class on another.
450N/A */
450N/A static class SimpleDependency implements Dependency {
450N/A public SimpleDependency(Location origin, Location target) {
450N/A this.origin = origin;
450N/A this.target = target;
450N/A }
450N/A
450N/A public Location getOrigin() {
450N/A return origin;
450N/A }
450N/A
450N/A public Location getTarget() {
450N/A return target;
450N/A }
450N/A
450N/A @Override
450N/A public boolean equals(Object other) {
450N/A if (this == other)
450N/A return true;
450N/A if (!(other instanceof SimpleDependency))
450N/A return false;
450N/A SimpleDependency o = (SimpleDependency) other;
450N/A return (origin.equals(o.origin) && target.equals(o.target));
450N/A }
450N/A
450N/A @Override
450N/A public int hashCode() {
450N/A return origin.hashCode() * 31 + target.hashCode();
450N/A }
450N/A
450N/A @Override
450N/A public String toString() {
450N/A return origin + ":" + target;
450N/A }
450N/A
450N/A private Location origin;
450N/A private Location target;
450N/A }
450N/A
450N/A
450N/A /**
450N/A * This class accepts all dependencies.
450N/A */
450N/A static class DefaultFilter implements Filter {
450N/A private static DefaultFilter instance;
450N/A
450N/A static DefaultFilter instance() {
450N/A if (instance == null)
450N/A instance = new DefaultFilter();
450N/A return instance;
450N/A }
450N/A
450N/A public boolean accepts(Dependency dependency) {
450N/A return true;
450N/A }
450N/A }
450N/A
450N/A /**
450N/A * This class accepts those dependencies whose target's class name matches a
450N/A * regular expression.
450N/A */
450N/A static class TargetRegexFilter implements Filter {
450N/A TargetRegexFilter(Pattern pattern) {
450N/A this.pattern = pattern;
450N/A }
450N/A
450N/A public boolean accepts(Dependency dependency) {
450N/A return pattern.matcher(dependency.getTarget().getClassName()).matches();
450N/A }
450N/A
451N/A private final Pattern pattern;
450N/A }
450N/A
450N/A /**
450N/A * This class accepts those dependencies whose class name is in a given
450N/A * package.
450N/A */
450N/A static class TargetPackageFilter implements Filter {
450N/A TargetPackageFilter(Set<String> packageNames, boolean matchSubpackages) {
450N/A for (String pn: packageNames) {
450N/A if (pn.length() == 0) // implies null check as well
450N/A throw new IllegalArgumentException();
450N/A }
450N/A this.packageNames = packageNames;
450N/A this.matchSubpackages = matchSubpackages;
450N/A }
450N/A
450N/A public boolean accepts(Dependency dependency) {
450N/A String cn = dependency.getTarget().getClassName();
450N/A int lastSep = cn.lastIndexOf("/");
450N/A String pn = (lastSep == -1 ? "" : cn.substring(0, lastSep));
450N/A if (packageNames.contains(pn))
450N/A return true;
450N/A
450N/A if (matchSubpackages) {
450N/A for (String n: packageNames) {
450N/A if (pn.startsWith(n + "."))
450N/A return true;
450N/A }
450N/A }
450N/A
450N/A return false;
450N/A }
450N/A
451N/A private final Set<String> packageNames;
451N/A private final boolean matchSubpackages;
450N/A }
450N/A
450N/A
450N/A
450N/A /**
450N/A * This class identifies class names directly or indirectly in the constant pool.
450N/A */
450N/A static class ClassDependencyFinder extends BasicDependencyFinder {
450N/A public Iterable<? extends Dependency> findDependencies(ClassFile classfile) {
450N/A Visitor v = new Visitor(classfile);
450N/A for (CPInfo cpInfo: classfile.constant_pool.entries()) {
450N/A v.scan(cpInfo);
450N/A }
450N/A return v.deps;
450N/A }
450N/A }
450N/A
450N/A /**
450N/A * This class identifies class names in the signatures of classes, fields,
450N/A * and methods in a class.
450N/A */
450N/A static class APIDependencyFinder extends BasicDependencyFinder {
450N/A APIDependencyFinder(int access) {
450N/A switch (access) {
450N/A case AccessFlags.ACC_PUBLIC:
450N/A case AccessFlags.ACC_PROTECTED:
450N/A case AccessFlags.ACC_PRIVATE:
450N/A case 0:
450N/A showAccess = access;
450N/A break;
450N/A default:
450N/A throw new IllegalArgumentException("invalid access 0x"
450N/A + Integer.toHexString(access));
450N/A }
450N/A }
450N/A
450N/A public Iterable<? extends Dependency> findDependencies(ClassFile classfile) {
450N/A try {
450N/A Visitor v = new Visitor(classfile);
450N/A v.addClass(classfile.super_class);
450N/A v.addClasses(classfile.interfaces);
450N/A // inner classes?
450N/A for (Field f : classfile.fields) {
450N/A if (checkAccess(f.access_flags))
450N/A v.scan(f.descriptor, f.attributes);
450N/A }
450N/A for (Method m : classfile.methods) {
450N/A if (checkAccess(m.access_flags)) {
450N/A v.scan(m.descriptor, m.attributes);
450N/A Exceptions_attribute e =
450N/A (Exceptions_attribute) m.attributes.get(Attribute.Exceptions);
450N/A if (e != null)
450N/A v.addClasses(e.exception_index_table);
450N/A }
450N/A }
450N/A return v.deps;
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A boolean checkAccess(AccessFlags flags) {
450N/A // code copied from javap.Options.checkAccess
450N/A boolean isPublic = flags.is(AccessFlags.ACC_PUBLIC);
450N/A boolean isProtected = flags.is(AccessFlags.ACC_PROTECTED);
450N/A boolean isPrivate = flags.is(AccessFlags.ACC_PRIVATE);
450N/A boolean isPackage = !(isPublic || isProtected || isPrivate);
450N/A
450N/A if ((showAccess == AccessFlags.ACC_PUBLIC) && (isProtected || isPrivate || isPackage))
450N/A return false;
450N/A else if ((showAccess == AccessFlags.ACC_PROTECTED) && (isPrivate || isPackage))
450N/A return false;
450N/A else if ((showAccess == 0) && (isPrivate))
450N/A return false;
450N/A else
450N/A return true;
450N/A }
450N/A
450N/A private int showAccess;
450N/A }
450N/A
450N/A static abstract class BasicDependencyFinder implements Finder {
450N/A private Map<String,Location> locations = new HashMap<String,Location>();
450N/A
450N/A Location getLocation(String className) {
450N/A Location l = locations.get(className);
450N/A if (l == null)
450N/A locations.put(className, l = new SimpleLocation(className));
450N/A return l;
450N/A }
450N/A
450N/A class Visitor implements ConstantPool.Visitor<Void,Void>, Type.Visitor<Void, Void> {
450N/A private ConstantPool constant_pool;
450N/A private Location origin;
451N/A Set<Dependency> deps;
450N/A
450N/A Visitor(ClassFile classFile) {
450N/A try {
450N/A constant_pool = classFile.constant_pool;
450N/A origin = getLocation(classFile.getName());
450N/A deps = new HashSet<Dependency>();
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A void scan(Descriptor d, Attributes attrs) {
450N/A try {
450N/A scan(new Signature(d.index).getType(constant_pool));
450N/A Signature_attribute sa = (Signature_attribute) attrs.get(Attribute.Signature);
450N/A if (sa != null)
450N/A scan(new Signature(sa.signature_index).getType(constant_pool));
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A void scan(CPInfo cpInfo) {
450N/A cpInfo.accept(this, null);
450N/A }
450N/A
450N/A void scan(Type t) {
450N/A t.accept(this, null);
450N/A }
450N/A
450N/A void addClass(int index) throws ConstantPoolException {
450N/A if (index != 0) {
450N/A String name = constant_pool.getClassInfo(index).getBaseName();
450N/A if (name != null)
450N/A addDependency(name);
450N/A }
450N/A }
450N/A
450N/A void addClasses(int[] indices) throws ConstantPoolException {
450N/A for (int i: indices)
450N/A addClass(i);
450N/A }
450N/A
450N/A private void addDependency(String name) {
450N/A deps.add(new SimpleDependency(origin, getLocation(name)));
450N/A }
450N/A
450N/A // ConstantPool.Visitor methods
450N/A
450N/A public Void visitClass(CONSTANT_Class_info info, Void p) {
450N/A try {
450N/A if (info.getName().startsWith("["))
450N/A new Signature(info.name_index).getType(constant_pool).accept(this, null);
450N/A else
450N/A addDependency(info.getBaseName());
450N/A return null;
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A public Void visitDouble(CONSTANT_Double_info info, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A public Void visitFieldref(CONSTANT_Fieldref_info info, Void p) {
450N/A return visitRef(info, p);
450N/A }
450N/A
450N/A public Void visitFloat(CONSTANT_Float_info info, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A public Void visitInteger(CONSTANT_Integer_info info, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A public Void visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
450N/A return visitRef(info, p);
450N/A }
450N/A
825N/A public Void visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, Void p) {
825N/A return null;
825N/A }
825N/A
450N/A public Void visitLong(CONSTANT_Long_info info, Void p) {
450N/A return null;
450N/A }
450N/A
825N/A public Void visitMethodHandle(CONSTANT_MethodHandle_info info, Void p) {
825N/A return null;
825N/A }
825N/A
825N/A public Void visitMethodType(CONSTANT_MethodType_info info, Void p) {
825N/A return null;
825N/A }
825N/A
825N/A public Void visitMethodref(CONSTANT_Methodref_info info, Void p) {
825N/A return visitRef(info, p);
825N/A }
825N/A
450N/A public Void visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
450N/A try {
450N/A new Signature(info.type_index).getType(constant_pool).accept(this, null);
450N/A return null;
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A public Void visitString(CONSTANT_String_info info, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A public Void visitUtf8(CONSTANT_Utf8_info info, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A private Void visitRef(CPRefInfo info, Void p) {
450N/A try {
450N/A visitClass(info.getClassInfo(), p);
450N/A return null;
450N/A } catch (ConstantPoolException e) {
450N/A throw new ClassFileError(e);
450N/A }
450N/A }
450N/A
450N/A // Type.Visitor methods
450N/A
450N/A private void findDependencies(Type t) {
450N/A if (t != null)
450N/A t.accept(this, null);
450N/A }
450N/A
450N/A private void findDependencies(List<? extends Type> ts) {
450N/A if (ts != null) {
450N/A for (Type t: ts)
450N/A t.accept(this, null);
450N/A }
450N/A }
450N/A
450N/A public Void visitSimpleType(SimpleType type, Void p) {
450N/A return null;
450N/A }
450N/A
450N/A public Void visitArrayType(ArrayType type, Void p) {
450N/A findDependencies(type.elemType);
450N/A return null;
450N/A }
450N/A
450N/A public Void visitMethodType(MethodType type, Void p) {
450N/A findDependencies(type.paramTypes);
450N/A findDependencies(type.returnType);
450N/A findDependencies(type.throwsTypes);
450N/A return null;
450N/A }
450N/A
450N/A public Void visitClassSigType(ClassSigType type, Void p) {
450N/A findDependencies(type.superclassType);
450N/A findDependencies(type.superinterfaceTypes);
450N/A return null;
450N/A }
450N/A
450N/A public Void visitClassType(ClassType type, Void p) {
450N/A findDependencies(type.outerType);
450N/A addDependency(type.name);
450N/A findDependencies(type.typeArgs);
450N/A return null;
450N/A }
450N/A
450N/A public Void visitTypeParamType(TypeParamType type, Void p) {
450N/A findDependencies(type.classBound);
450N/A findDependencies(type.interfaceBounds);
450N/A return null;
450N/A }
450N/A
450N/A public Void visitWildcardType(WildcardType type, Void p) {
450N/A findDependencies(type.boundType);
450N/A return null;
450N/A }
450N/A }
450N/A }
450N/A}