Thu, 12 Jan 2012 15:28:34 +0000
7123100: javac fails with java.lang.StackOverflowError
Summary: Inference of under-constrained type-variables creates erroneous recursive wildcard types
Reviewed-by: jjg
1 /*
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.tools.classfile;
29 /**
30 * A directed relationship between two {@link Dependency.Location Location}s.
31 * Subtypes of {@code Dependency} may provide additional detail about the dependency.
32 *
33 * @see Dependency.Finder
34 * @see Dependency.Filter
35 * @see Dependencies
36 */
37 public interface Dependency {
38 /**
39 * A filter used to select dependencies of interest, and to discard others.
40 */
41 public interface Filter {
42 /**
43 * Return true if the dependency is of interest.
44 * @param dependency the dependency to be considered
45 * @return true if and only if the dependency is of interest.
46 */
47 boolean accepts(Dependency dependency);
48 }
50 /**
51 * An interface for finding the immediate dependencies of a given class file.
52 */
53 public interface Finder {
54 /**
55 * Find the immediate dependencies of a given class file.
56 * @param classfile the class file to be examined
57 * @return the dependencies located in the given class file.
58 */
59 public Iterable<? extends Dependency> findDependencies(ClassFile classfile);
60 }
63 /**
64 * A location somewhere within a class. Subtypes of {@code Location}
65 * may be used to provide additional detail about the location.
66 */
67 public interface Location {
68 /**
69 * Get the name of the class containing the location.
70 * This name will be used to locate the class file for transitive
71 * dependency analysis.
72 * @return the name of the class containing the location.
73 */
74 String getClassName();
75 }
78 /**
79 * Get the location that has the dependency.
80 * @return the location that has the dependency.
81 */
82 Location getOrigin();
84 /**
85 * Get the location that is being depended upon.
86 * @return the location that is being depended upon.
87 */
88 Location getTarget();
89 }