author | darcy |
Thu, 23 May 2019 18:47:24 -0700 | |
changeset 55021 | d84176dd57b0 |
permissions | -rw-r--r-- |
55021
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
1 |
/* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
2 |
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
4 |
* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
8 |
* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
13 |
* accompanied this code). |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
14 |
* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
18 |
* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
21 |
* questions. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
22 |
*/ |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
23 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
24 |
/* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
25 |
* @test |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
26 |
* @bug 8224177 |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
27 |
* @summary Test warnings from the annotation processing runtime about malformed supported information from processors. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
28 |
* @compile TestRepeatedItemsRuntime.java |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
29 |
* @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestRepeatedItemsRuntime -proc:only TestRepeatedItemsRuntime.java |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
30 |
* @compile/ref=auric_current.out -XDrawDiagnostics -processor TestRepeatedItemsRuntime -proc:only -Xlint:processing TestRepeatedItemsRuntime.java |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
31 |
*/ |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
32 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
33 |
import java.lang.annotation.*; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
34 |
import java.util.*; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
35 |
import javax.annotation.processing.*; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
36 |
import javax.lang.model.SourceVersion; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
37 |
import javax.lang.model.element.TypeElement; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
38 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
39 |
/** |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
40 |
* A warning should be issued by the logic in |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
41 |
* javax.annotation.processing.AbstractProcessor for the repeated |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
42 |
* information. The "Foo" option warnings occur regardless of source |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
43 |
* level. The number of times the Baz annotation type is repeated |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
44 |
* depends on whether or not the source level supports modules. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
45 |
*/ |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
46 |
@Quux |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
47 |
public class TestRepeatedItemsRuntime extends AbstractProcessor { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
48 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
49 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
50 |
public SourceVersion getSupportedSourceVersion() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
51 |
return SourceVersion.latest(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
52 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
53 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
54 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
55 |
public Set<String>getSupportedOptions() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
56 |
IdentityHashMap<String, Integer> temp = new IdentityHashMap<>(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
57 |
// Use String constructor for identity map. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
58 |
temp.put(new String("foo"), 1); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
59 |
temp.put(new String("foo"), 2); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
60 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
61 |
var returnValue = temp.keySet(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
62 |
assert returnValue.size() == 2; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
63 |
return returnValue; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
64 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
65 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
66 |
/** |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
67 |
* Partial implementation of the Set interface with identity |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
68 |
* semantics and predictable iteration order. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
69 |
* |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
70 |
* The javax.annotation.processing.Processor protocol relies on |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
71 |
* the iterator. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
72 |
*/ |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
73 |
private static class ArrayBackedSet implements Set<String> { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
74 |
private static String[] data = {"Quux", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
75 |
"Quux", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
76 |
"&&&/foo.Bar", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
77 |
"foo.Bar", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
78 |
"foo.Bar", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
79 |
"quux/Quux", |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
80 |
"*"}; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
81 |
public ArrayBackedSet() {} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
82 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
83 |
// Return an iterator of known iteration order so the set warning messages will be predictable. |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
84 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
85 |
public Iterator<String> iterator() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
86 |
return Arrays.asList(data).iterator(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
87 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
88 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
89 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
90 |
public boolean add(String e) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
91 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
92 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
93 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
94 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
95 |
public boolean addAll(Collection<? extends String> c) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
96 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
97 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
98 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
99 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
100 |
public void clear() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
101 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
102 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
103 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
104 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
105 |
public boolean contains(Object o){ |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
106 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
107 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
108 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
109 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
110 |
public boolean containsAll(Collection<?> c) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
111 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
112 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
113 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
114 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
115 |
public boolean equals(Object o) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
116 |
return o == this; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
117 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
118 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
119 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
120 |
public int hashCode() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
121 |
int hash = 0; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
122 |
for (String s : data) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
123 |
hash += s.hashCode(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
124 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
125 |
return hash; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
126 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
127 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
128 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
129 |
public boolean isEmpty() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
130 |
return data.length > 0; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
131 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
132 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
133 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
134 |
public boolean remove(Object o) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
135 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
136 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
137 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
138 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
139 |
public boolean removeAll(Collection<?> c) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
140 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
141 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
142 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
143 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
144 |
public boolean retainAll(Collection<?> c) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
145 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
146 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
147 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
148 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
149 |
public int size() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
150 |
return data.length; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
151 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
152 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
153 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
154 |
public Object[] toArray() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
155 |
return data.clone(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
156 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
157 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
158 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
159 |
public <T> T[] toArray(T[] a) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
160 |
throw new UnsupportedOperationException(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
161 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
162 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
163 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
164 |
@Override |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
165 |
public Set<String>getSupportedAnnotationTypes() { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
166 |
return new ArrayBackedSet(); |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
167 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
168 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
169 |
public boolean process(Set<? extends TypeElement> annotations, |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
170 |
RoundEnvironment roundEnvironment) { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
171 |
return true; |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
172 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
173 |
} |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
174 |
|
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
175 |
@Retention(RetentionPolicy.RUNTIME) |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
176 |
@interface Quux { |
d84176dd57b0
8224177: Harden annotation processing framework to irregular behavior from processors
darcy
parents:
diff
changeset
|
177 |
} |