author | jlahoda |
Thu, 09 Oct 2014 10:08:52 +0200 | |
changeset 26993 | 513b2cae81c3 |
parent 26100 | bb7dd001d190 |
child 27552 | 8a4b2d3639c1 |
permissions | -rw-r--r-- |
25434
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
1 |
/* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
4 |
* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
8 |
* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
13 |
* accompanied this code). |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
14 |
* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
18 |
* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
21 |
* questions. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
22 |
*/ |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
23 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
24 |
/* |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
25 |
* @test |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
26 |
* @bug 8042261 |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
27 |
* @summary Checking what attribute is generated by annotation Deprecated |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
28 |
* or javadoc deprecated for field, method, class(inner/local), interface. |
26100 | 29 |
* @library /tools/lib /tools/javac/lib ../lib |
30 |
* @build ToolBox TestBase TestResult InMemoryFileManager |
|
25434
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
31 |
* @run main DeprecatedTest |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
32 |
*/ |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
33 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
34 |
import com.sun.tools.classfile.Attribute; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
35 |
import com.sun.tools.classfile.ClassFile; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
36 |
import com.sun.tools.classfile.ConstantPoolException; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
37 |
import com.sun.tools.classfile.Deprecated_attribute; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
38 |
import com.sun.tools.classfile.Field; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
39 |
import com.sun.tools.classfile.InnerClasses_attribute; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
40 |
import com.sun.tools.classfile.InnerClasses_attribute.Info; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
41 |
import com.sun.tools.classfile.Method; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
42 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
43 |
import javax.tools.JavaFileObject; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
44 |
import java.io.IOException; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
45 |
import java.util.Map; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
46 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
47 |
public class DeprecatedTest extends TestResult { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
48 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
49 |
private static final String[] sources = new String[]{ |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
50 |
"@Deprecated public class deprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
51 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
52 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
53 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
54 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
55 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
56 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
57 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
58 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
59 |
+ "@Deprecated public void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
60 |
+ "@Deprecated public int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
61 |
+ "public void notDeprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
62 |
+ "public int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
63 |
+ "public void f() {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
64 |
+ " @Deprecated class deprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
65 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
66 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
67 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
68 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
69 |
+ " }\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
70 |
+ " class notDeprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
71 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
72 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
73 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
74 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
75 |
+ " }}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
76 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
77 |
"@Deprecated public interface deprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
78 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
79 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
80 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
81 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
82 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
83 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
84 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
85 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
86 |
+ "@Deprecated void deprecated01();\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
87 |
+ "void notDeprecated01();\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
88 |
+ "@Deprecated default void deprecated02() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
89 |
+ "default void notDeprecated02() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
90 |
+ "@Deprecated int deprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
91 |
+ "int notDeprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
92 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
93 |
"@Deprecated public enum deprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
94 |
+ "@Deprecated deprecated, notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
95 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
96 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
97 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
98 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
99 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
100 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
101 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
102 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
103 |
+ "@Deprecated public void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
104 |
+ "public void notDeprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
105 |
+ "public void f() {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
106 |
+ " @Deprecated class deprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
107 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
108 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
109 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
110 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
111 |
+ " }\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
112 |
+ " class notDeprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
113 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
114 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
115 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
116 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
117 |
+ " }}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
118 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
119 |
"@Deprecated public @interface deprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
120 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
121 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
122 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
123 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
124 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
125 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
126 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
127 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
128 |
+ "@Deprecated int deprecated() default 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
129 |
+ "int notDeprecated() default 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
130 |
+ "@Deprecated int deprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
131 |
+ "int notDeprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
132 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
133 |
"public class notDeprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
134 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
135 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
136 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
137 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
138 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
139 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
140 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
141 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
142 |
+ "@Deprecated public void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
143 |
+ "@Deprecated public int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
144 |
+ "public void notDeprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
145 |
+ "public int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
146 |
+ "public void f() {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
147 |
+ " @Deprecated class deprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
148 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
149 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
150 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
151 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
152 |
+ " }\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
153 |
+ " class notDeprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
154 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
155 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
156 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
157 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
158 |
+ " }}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
159 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
160 |
"public interface notDeprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
161 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
162 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
163 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
164 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
165 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
166 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
167 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
168 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
169 |
+ "@Deprecated void deprecated01();\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
170 |
+ "void notDeprecated01();\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
171 |
+ "@Deprecated default void deprecated02() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
172 |
+ "default void notDeprecated02() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
173 |
+ "@Deprecated int deprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
174 |
+ "int notDeprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
175 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
176 |
"public enum notDeprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
177 |
+ "@Deprecated deprecated, notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
178 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
179 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
180 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
181 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
182 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
183 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
184 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
185 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
186 |
+ "@Deprecated public void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
187 |
+ "public void notDeprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
188 |
+ "public void f() {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
189 |
+ " @Deprecated class deprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
190 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
191 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
192 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
193 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
194 |
+ " }\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
195 |
+ " class notDeprecatedLocal {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
196 |
+ " @Deprecated int deprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
197 |
+ " @Deprecated void deprecated() {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
198 |
+ " int notDeprecated;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
199 |
+ " void notDeprecated(){}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
200 |
+ " }}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
201 |
+ "}", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
202 |
"public @interface notDeprecated {\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
203 |
+ "@Deprecated class deprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
204 |
+ "@Deprecated interface deprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
205 |
+ "@Deprecated enum deprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
206 |
+ "@Deprecated @interface deprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
207 |
+ "class notDeprecatedInner01 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
208 |
+ "interface notDeprecatedInner02 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
209 |
+ "enum notDeprecatedInner03 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
210 |
+ "@interface notDeprecatedInner04 {}\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
211 |
+ "@Deprecated int deprecated() default 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
212 |
+ "int notDeprecated() default 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
213 |
+ "@Deprecated int deprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
214 |
+ "int notDeprecated = 0;\n" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
215 |
+ "}"}; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
216 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
217 |
public static void main(String[] args) throws TestFailedException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
218 |
new DeprecatedTest().test(); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
219 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
220 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
221 |
public void test() throws TestFailedException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
222 |
try { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
223 |
for (String src : sources) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
224 |
test(src); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
225 |
test(src.replaceAll("@Deprecated", "/** @deprecated */")); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
226 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
227 |
} catch (Exception e) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
228 |
addFailure(e); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
229 |
} finally { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
230 |
checkStatus(); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
231 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
232 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
233 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
234 |
private void test(String src) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
235 |
addTestCase(src); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
236 |
printf("Testing test case :\n%s\n", src); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
237 |
try { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
238 |
Map<String, ? extends JavaFileObject> classes = compile(src).getClasses(); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
239 |
String outerClassName = classes.containsKey("deprecated") |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
240 |
? "deprecated" |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
241 |
: "notDeprecated"; |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
242 |
echo("Testing outer class : " + outerClassName); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
243 |
ClassFile cf = ClassFile.read(classes.get(outerClassName).openInputStream()); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
244 |
Deprecated_attribute attr = (Deprecated_attribute) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
245 |
cf.getAttribute(Attribute.Deprecated); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
246 |
testAttribute(outerClassName, attr, cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
247 |
testInnerClasses(cf, classes); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
248 |
testMethods(cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
249 |
testFields(cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
250 |
} catch (Exception e) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
251 |
addFailure(e); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
252 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
253 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
254 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
255 |
private void testInnerClasses(ClassFile cf, Map<String, ? extends JavaFileObject> classes) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
256 |
throws ConstantPoolException, IOException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
257 |
InnerClasses_attribute innerAttr = (InnerClasses_attribute) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
258 |
cf.getAttribute(Attribute.InnerClasses); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
259 |
for (Info innerClass : innerAttr.classes) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
260 |
String innerClassName = cf.constant_pool. |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
261 |
getClassInfo(innerClass.inner_class_info_index).getName(); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
262 |
echo("Testing inner class : " + innerClassName); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
263 |
ClassFile innerCf = ClassFile.read(classes.get(innerClassName).openInputStream()); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
264 |
Deprecated_attribute attr = (Deprecated_attribute) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
265 |
innerCf.getAttribute(Attribute.Deprecated); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
266 |
String innerClassSimpleName = innerClass.getInnerName(cf.constant_pool); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
267 |
testAttribute(innerClassSimpleName, attr, innerCf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
268 |
if (innerClassName.contains("Local")) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
269 |
testMethods(innerCf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
270 |
testFields(innerCf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
271 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
272 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
273 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
274 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
275 |
private void testMethods(ClassFile cf) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
276 |
throws ConstantPoolException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
277 |
for (Method m : cf.methods) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
278 |
String methodName = cf.constant_pool.getUTF8Value(m.name_index); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
279 |
echo("Testing method : " + methodName); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
280 |
Deprecated_attribute attr = (Deprecated_attribute) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
281 |
m.attributes.get(Attribute.Deprecated); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
282 |
testAttribute(methodName, attr, cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
283 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
284 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
285 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
286 |
private void testFields(ClassFile cf) throws ConstantPoolException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
287 |
for (Field f : cf.fields) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
288 |
String fieldName = cf.constant_pool.getUTF8Value(f.name_index); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
289 |
echo("Testing field : " + fieldName); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
290 |
Deprecated_attribute attr = (Deprecated_attribute) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
291 |
f.attributes.get(Attribute.Deprecated); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
292 |
testAttribute(fieldName, attr, cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
293 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
294 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
295 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
296 |
private void testAttribute(String name, Deprecated_attribute attr, ClassFile cf) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
297 |
throws ConstantPoolException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
298 |
if (name.contains("deprecated")) { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
299 |
testDeprecatedAttribute(name, attr, cf); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
300 |
} else { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
301 |
assertNull(attr, name + " should not have deprecated attribute"); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
302 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
303 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
304 |
|
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
305 |
private void testDeprecatedAttribute(String name, Deprecated_attribute attr, ClassFile cf) |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
306 |
throws ConstantPoolException { |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
307 |
assertNotNull(attr, name + " must have deprecated attribute"); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
308 |
assertEquals(0, attr.attribute_length, |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
309 |
"attribute_length should equal to 0"); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
310 |
assertEquals("Deprecated", |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
311 |
cf.constant_pool.getUTF8Value(attr.attribute_name_index), |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
312 |
name + " attribute_name_index"); |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
313 |
} |
823512a72660
8042261: Implement classfile tests for Deprecated attribute.
jjg
parents:
diff
changeset
|
314 |
} |