author | ascarpino |
Fri, 12 May 2017 08:20:11 -0700 | |
changeset 45992 | 38bdf44057b9 |
parent 36778 | e04318f39f92 |
child 44806 | d6bdff2ad6f2 |
permissions | -rw-r--r-- |
32800
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
1 |
/* |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
32800
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
4 |
* |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
8 |
* |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
13 |
* accompanied this code). |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
14 |
* |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
18 |
* |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
21 |
* questions. |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
22 |
*/ |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
23 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
24 |
/* |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
25 |
* @test |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
26 |
* @bug 8135307 |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
27 |
* @summary Check that CompletionFailures for missing classes are not incorrectly passed to |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
28 |
* the javadoc API clients. |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
29 |
* @library /tools/lib |
35359 | 30 |
* @modules jdk.javadoc com.sun.tools.javac.api |
36526 | 31 |
* jdk.jdeps/com.sun.tools.javap |
32800
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
32 |
* @run main CompletionError |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
33 |
*/ |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
34 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
35 |
import java.io.File; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
36 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
37 |
import com.sun.javadoc.*; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
38 |
import com.sun.tools.javadoc.Main; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
39 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
40 |
public class CompletionError extends Doclet |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
41 |
{ |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
42 |
private static final String template = |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
43 |
"public class CompletionErrorAuxiliary #extends CompletionErrorMissing# #implements CompletionErrorIntfMissing# {" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
44 |
" #public CompletionErrorMissing tf;#" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
45 |
" #public CompletionErrorMissing tm() { return null; }#" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
46 |
" #public void tm(CompletionErrorMissing m) {}#" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
47 |
" #public void tm() throws CompletionErrorExcMissing {}#" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
48 |
" #public <T extends CompletionErrorMissing> void tm() {}#" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
49 |
" public String toString() { return null; }" + |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
50 |
"}"; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
51 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
52 |
public static void main(String[] args) throws Exception { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
53 |
String[] templateParts = template.split("#"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
54 |
int sources = templateParts.length / 2; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
55 |
for (int source = 0; source < sources; source++) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
56 |
StringBuilder testSource = new StringBuilder(); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
57 |
for (int i = 0; i < templateParts.length; i += 2) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
58 |
testSource.append(templateParts[i]); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
59 |
if (i == 2 * source) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
60 |
testSource.append(templateParts[i + 1]); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
61 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
62 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
63 |
test = 0; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
64 |
testsDone = false; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
65 |
while (!testsDone) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
66 |
ToolBox tb = new ToolBox(); |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
67 |
new JavacTask(tb) |
32800
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
68 |
.sources(testSource.toString(), |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
69 |
"public class CompletionErrorMissing {}", |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
70 |
"public interface CompletionErrorIntfMissing {}", |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
71 |
"public class CompletionErrorExcMissing extends Exception {}") |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
72 |
.outdir(".") |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
73 |
.run() |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
74 |
.writeAll(); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
75 |
tb.deleteFiles("CompletionErrorMissing.class", "CompletionErrorIntfMissing.class", "CompletionErrorExcMissing.class"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
76 |
// run javadoc: |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
77 |
if (Main.execute("javadoc", "CompletionError", CompletionError.class.getClassLoader(), |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
78 |
"-classpath", ".", |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
79 |
System.getProperty("test.src", ".") + File.separatorChar + "CompletionError.java") != 0) |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
80 |
throw new Error(); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
81 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
82 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
83 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
84 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
85 |
private static int test; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
86 |
private static boolean testsDone; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
87 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
88 |
public static boolean start(com.sun.javadoc.RootDoc root) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
89 |
ClassDoc aux = root.classNamed("CompletionErrorAuxiliary"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
90 |
if (aux == null) |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
91 |
throw new AssertionError("Cannot find CompletionErrorAuxiliary"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
92 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
93 |
FieldDoc tf = findField(aux, "tf"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
94 |
MethodDoc tm = findMethod(aux, "tm"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
95 |
MethodDoc cm = findMethod(aux, "toString"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
96 |
switch (test) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
97 |
case 0: aux.superclass(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
98 |
case 1: aux.superclassType(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
99 |
case 2: aux.interfaces(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
100 |
case 3: aux.interfaceTypes(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
101 |
case 4: if (tf != null) tf.type(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
102 |
case 5: if (tm != null) tm.overriddenClass(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
103 |
case 6: if (tm != null) tm.overriddenMethod(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
104 |
case 7: if (tm != null) tm.overriddenType(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
105 |
case 8: |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
106 |
if (tm != null) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
107 |
for (Parameter p : tm.parameters()) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
108 |
p.type(); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
109 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
110 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
111 |
break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
112 |
case 9: if (tm != null) tm.receiverType(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
113 |
case 10: if (tm != null) tm.returnType(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
114 |
case 11: if (tm != null) tm.thrownExceptionTypes(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
115 |
case 12: if (tm != null) tm.thrownExceptions(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
116 |
case 13: |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
117 |
if (tm != null) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
118 |
for (TypeVariable tv : tm.typeParameters()) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
119 |
tv.bounds(); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
120 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
121 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
122 |
break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
123 |
case 14: if (cm != null) cm.overriddenClass(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
124 |
case 15: if (cm != null) cm.overriddenMethod(); break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
125 |
case 16: if (cm != null) cm.overriddenType(); testsDone = true; break; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
126 |
default: |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
127 |
throw new IllegalStateException("Unrecognized test!"); |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
128 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
129 |
test++; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
130 |
return true; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
131 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
132 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
133 |
private static MethodDoc findMethod(ClassDoc cd, String name) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
134 |
for (MethodDoc m : cd.methods()) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
135 |
if (name.equals(m.name())) |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
136 |
return m; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
137 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
138 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
139 |
return null; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
140 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
141 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
142 |
private static FieldDoc findField(ClassDoc cd, String name) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
143 |
for (FieldDoc m : cd.fields()) { |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
144 |
if (name.equals(m.name())) |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
145 |
return m; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
146 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
147 |
|
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
148 |
return null; |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
149 |
} |
8457813125e3
8135307: CompletionFailure thrown when calling FieldDoc.type, if the field's type is missing
jlahoda
parents:
diff
changeset
|
150 |
} |