author | jlahoda |
Thu, 12 Sep 2019 17:47:24 +0200 | |
branch | JDK-8226585-branch |
changeset 58109 | ee07de0d2c16 |
parent 55306 | ea43db53de91 |
child 58440 | 4c8a6d1d066c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
55306 | 2 |
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.source.util; |
|
27 |
||
28 |
import com.sun.source.tree.*; |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
29 |
import com.sun.source.tree.CaseTree.CaseKind; |
10 | 30 |
|
31 |
/** |
|
32 |
* A TreeVisitor that visits all the child tree nodes. |
|
33 |
* To visit nodes of a particular type, just override the |
|
34 |
* corresponding visitXYZ method. |
|
35 |
* Inside your method, call super.visitXYZ to visit descendant |
|
36 |
* nodes. |
|
37 |
* |
|
38 |
* <p>The default implementation of the visitXYZ methods will determine |
|
39 |
* a result as follows: |
|
40 |
* <ul> |
|
25287 | 41 |
* <li>If the node being visited has no children, the result will be {@code null}. |
10 | 42 |
* <li>If the node being visited has one child, the result will be the |
43 |
* result of calling {@code scan} on that child. The child may be a simple node |
|
44 |
* or itself a list of nodes. |
|
45 |
* <li> If the node being visited has more than one child, the result will |
|
46 |
* be determined by calling {@code scan} each child in turn, and then combining the |
|
47 |
* result of each scan after the first with the cumulative result |
|
48 |
* so far, as determined by the {@link #reduce} method. Each child may be either |
|
49 |
* a simple node of a list of nodes. The default behavior of the {@code reduce} |
|
50 |
* method is such that the result of the visitXYZ method will be the result of |
|
51 |
* the last child scanned. |
|
52 |
* </ul> |
|
53 |
* |
|
54 |
* <p>Here is an example to count the number of identifier nodes in a tree: |
|
55 |
* <pre> |
|
13844 | 56 |
* class CountIdentifiers extends TreeScanner<Integer,Void> { |
10 | 57 |
* {@literal @}Override |
58 |
* public Integer visitIdentifier(IdentifierTree node, Void p) { |
|
59 |
* return 1; |
|
60 |
* } |
|
61 |
* {@literal @}Override |
|
62 |
* public Integer reduce(Integer r1, Integer r2) { |
|
63 |
* return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2); |
|
64 |
* } |
|
65 |
* } |
|
66 |
* </pre> |
|
67 |
* |
|
25287 | 68 |
* @param <R> the return type of this visitor's methods. Use {@link |
69 |
* Void} for visitors that do not need to return results. |
|
70 |
* @param <P> the type of the additional parameter to this visitor's |
|
71 |
* methods. Use {@code Void} for visitors that do not need an |
|
72 |
* additional parameter. |
|
73 |
* |
|
10 | 74 |
* @author Peter von der Ahé |
75 |
* @author Jonathan Gibbons |
|
76 |
* @since 1.6 |
|
77 |
*/ |
|
78 |
public class TreeScanner<R,P> implements TreeVisitor<R,P> { |
|
79 |
||
25287 | 80 |
/** |
81 |
* Scans a single node. |
|
82 |
* @param tree the node to be scanned |
|
83 |
* @param p a parameter value passed to the visit method |
|
84 |
* @return the result value from the visit method |
|
10 | 85 |
*/ |
25287 | 86 |
public R scan(Tree tree, P p) { |
87 |
return (tree == null) ? null : tree.accept(this, p); |
|
10 | 88 |
} |
89 |
||
90 |
private R scanAndReduce(Tree node, P p, R r) { |
|
91 |
return reduce(scan(node, p), r); |
|
92 |
} |
|
93 |
||
25287 | 94 |
/** |
95 |
* Scans a sequence of nodes. |
|
96 |
* @param nodes the nodes to be scanned |
|
97 |
* @param p a parameter value to be passed to the visit method for each node |
|
98 |
* @return the combined return value from the visit methods. |
|
99 |
* The values are combined using the {@link #reduce reduce} method. |
|
10 | 100 |
*/ |
101 |
public R scan(Iterable<? extends Tree> nodes, P p) { |
|
102 |
R r = null; |
|
103 |
if (nodes != null) { |
|
104 |
boolean first = true; |
|
105 |
for (Tree node : nodes) { |
|
106 |
r = (first ? scan(node, p) : scanAndReduce(node, p, r)); |
|
107 |
first = false; |
|
108 |
} |
|
109 |
} |
|
110 |
return r; |
|
111 |
} |
|
112 |
||
113 |
private R scanAndReduce(Iterable<? extends Tree> nodes, P p, R r) { |
|
114 |
return reduce(scan(nodes, p), r); |
|
115 |
} |
|
116 |
||
117 |
/** |
|
118 |
* Reduces two results into a combined result. |
|
119 |
* The default implementation is to return the first parameter. |
|
120 |
* The general contract of the method is that it may take any action whatsoever. |
|
25287 | 121 |
* @param r1 the first of the values to be combined |
122 |
* @param r2 the second of the values to be combined |
|
123 |
* @return the result of combining the two parameters |
|
10 | 124 |
*/ |
125 |
public R reduce(R r1, R r2) { |
|
126 |
return r1; |
|
127 |
} |
|
128 |
||
129 |
||
130 |
/* *************************************************************************** |
|
131 |
* Visitor methods |
|
132 |
****************************************************************************/ |
|
133 |
||
25287 | 134 |
/** |
135 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
136 |
* |
|
137 |
* @param node {@inheritDoc} |
|
138 |
* @param p {@inheritDoc} |
|
139 |
* @return the result of scanning |
|
140 |
*/ |
|
141 |
@Override |
|
10 | 142 |
public R visitCompilationUnit(CompilationUnitTree node, P p) { |
24069 | 143 |
R r = scan(node.getPackage(), p); |
10 | 144 |
r = scanAndReduce(node.getImports(), p, r); |
145 |
r = scanAndReduce(node.getTypeDecls(), p, r); |
|
146 |
return r; |
|
147 |
} |
|
148 |
||
25287 | 149 |
/** |
150 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
151 |
* |
|
152 |
* @param node {@inheritDoc} |
|
153 |
* @param p {@inheritDoc} |
|
154 |
* @return the result of scanning |
|
155 |
*/ |
|
156 |
@Override |
|
24069 | 157 |
public R visitPackage(PackageTree node, P p) { |
158 |
R r = scan(node.getAnnotations(), p); |
|
159 |
r = scanAndReduce(node.getPackageName(), p, r); |
|
160 |
return r; |
|
161 |
} |
|
162 |
||
25287 | 163 |
/** |
164 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
165 |
* |
|
166 |
* @param node {@inheritDoc} |
|
167 |
* @param p {@inheritDoc} |
|
168 |
* @return the result of scanning |
|
169 |
*/ |
|
170 |
@Override |
|
10 | 171 |
public R visitImport(ImportTree node, P p) { |
172 |
return scan(node.getQualifiedIdentifier(), p); |
|
173 |
} |
|
174 |
||
25287 | 175 |
/** |
176 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
177 |
* |
|
178 |
* @param node {@inheritDoc} |
|
179 |
* @param p {@inheritDoc} |
|
180 |
* @return the result of scanning |
|
181 |
*/ |
|
182 |
@Override |
|
10 | 183 |
public R visitClass(ClassTree node, P p) { |
184 |
R r = scan(node.getModifiers(), p); |
|
185 |
r = scanAndReduce(node.getTypeParameters(), p, r); |
|
186 |
r = scanAndReduce(node.getExtendsClause(), p, r); |
|
187 |
r = scanAndReduce(node.getImplementsClause(), p, r); |
|
188 |
r = scanAndReduce(node.getMembers(), p, r); |
|
189 |
return r; |
|
190 |
} |
|
191 |
||
25287 | 192 |
/** |
193 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
194 |
* |
|
195 |
* @param node {@inheritDoc} |
|
196 |
* @param p {@inheritDoc} |
|
197 |
* @return the result of scanning |
|
198 |
*/ |
|
199 |
@Override |
|
10 | 200 |
public R visitMethod(MethodTree node, P p) { |
201 |
R r = scan(node.getModifiers(), p); |
|
202 |
r = scanAndReduce(node.getReturnType(), p, r); |
|
203 |
r = scanAndReduce(node.getTypeParameters(), p, r); |
|
204 |
r = scanAndReduce(node.getParameters(), p, r); |
|
15385 | 205 |
r = scanAndReduce(node.getReceiverParameter(), p, r); |
10 | 206 |
r = scanAndReduce(node.getThrows(), p, r); |
207 |
r = scanAndReduce(node.getBody(), p, r); |
|
6597
9367c22c445f
6983239: TreeScanner does not scan default value for method
jjg
parents:
6148
diff
changeset
|
208 |
r = scanAndReduce(node.getDefaultValue(), p, r); |
10 | 209 |
return r; |
210 |
} |
|
211 |
||
25287 | 212 |
/** |
213 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
214 |
* |
|
215 |
* @param node {@inheritDoc} |
|
216 |
* @param p {@inheritDoc} |
|
217 |
* @return the result of scanning |
|
218 |
*/ |
|
219 |
@Override |
|
10 | 220 |
public R visitVariable(VariableTree node, P p) { |
221 |
R r = scan(node.getModifiers(), p); |
|
222 |
r = scanAndReduce(node.getType(), p, r); |
|
17580 | 223 |
r = scanAndReduce(node.getNameExpression(), p, r); |
10 | 224 |
r = scanAndReduce(node.getInitializer(), p, r); |
225 |
return r; |
|
226 |
} |
|
227 |
||
25287 | 228 |
/** |
229 |
* {@inheritDoc} This implementation returns {@code null}. |
|
230 |
* |
|
231 |
* @param node {@inheritDoc} |
|
232 |
* @param p {@inheritDoc} |
|
233 |
* @return the result of scanning |
|
234 |
*/ |
|
235 |
@Override |
|
10 | 236 |
public R visitEmptyStatement(EmptyStatementTree node, P p) { |
237 |
return null; |
|
238 |
} |
|
239 |
||
25287 | 240 |
/** |
241 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
242 |
* |
|
243 |
* @param node {@inheritDoc} |
|
244 |
* @param p {@inheritDoc} |
|
245 |
* @return the result of scanning |
|
246 |
*/ |
|
247 |
@Override |
|
10 | 248 |
public R visitBlock(BlockTree node, P p) { |
249 |
return scan(node.getStatements(), p); |
|
250 |
} |
|
251 |
||
25287 | 252 |
/** |
253 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
254 |
* |
|
255 |
* @param node {@inheritDoc} |
|
256 |
* @param p {@inheritDoc} |
|
257 |
* @return the result of scanning |
|
258 |
*/ |
|
259 |
@Override |
|
10 | 260 |
public R visitDoWhileLoop(DoWhileLoopTree node, P p) { |
261 |
R r = scan(node.getStatement(), p); |
|
262 |
r = scanAndReduce(node.getCondition(), p, r); |
|
263 |
return r; |
|
264 |
} |
|
265 |
||
25287 | 266 |
/** |
267 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
268 |
* |
|
269 |
* @param node {@inheritDoc} |
|
270 |
* @param p {@inheritDoc} |
|
271 |
* @return the result of scanning |
|
272 |
*/ |
|
273 |
@Override |
|
10 | 274 |
public R visitWhileLoop(WhileLoopTree node, P p) { |
275 |
R r = scan(node.getCondition(), p); |
|
276 |
r = scanAndReduce(node.getStatement(), p, r); |
|
277 |
return r; |
|
278 |
} |
|
279 |
||
25287 | 280 |
/** |
281 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
282 |
* |
|
283 |
* @param node {@inheritDoc} |
|
284 |
* @param p {@inheritDoc} |
|
285 |
* @return the result of scanning |
|
286 |
*/ |
|
287 |
@Override |
|
10 | 288 |
public R visitForLoop(ForLoopTree node, P p) { |
289 |
R r = scan(node.getInitializer(), p); |
|
290 |
r = scanAndReduce(node.getCondition(), p, r); |
|
291 |
r = scanAndReduce(node.getUpdate(), p, r); |
|
292 |
r = scanAndReduce(node.getStatement(), p, r); |
|
293 |
return r; |
|
294 |
} |
|
295 |
||
25287 | 296 |
/** |
297 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
298 |
* |
|
299 |
* @param node {@inheritDoc} |
|
300 |
* @param p {@inheritDoc} |
|
301 |
* @return the result of scanning |
|
302 |
*/ |
|
303 |
@Override |
|
10 | 304 |
public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { |
305 |
R r = scan(node.getVariable(), p); |
|
306 |
r = scanAndReduce(node.getExpression(), p, r); |
|
307 |
r = scanAndReduce(node.getStatement(), p, r); |
|
308 |
return r; |
|
309 |
} |
|
310 |
||
25287 | 311 |
/** |
312 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
313 |
* |
|
314 |
* @param node {@inheritDoc} |
|
315 |
* @param p {@inheritDoc} |
|
316 |
* @return the result of scanning |
|
317 |
*/ |
|
318 |
@Override |
|
10 | 319 |
public R visitLabeledStatement(LabeledStatementTree node, P p) { |
320 |
return scan(node.getStatement(), p); |
|
321 |
} |
|
322 |
||
25287 | 323 |
/** |
324 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
325 |
* |
|
326 |
* @param node {@inheritDoc} |
|
327 |
* @param p {@inheritDoc} |
|
328 |
* @return the result of scanning |
|
329 |
*/ |
|
330 |
@Override |
|
10 | 331 |
public R visitSwitch(SwitchTree node, P p) { |
332 |
R r = scan(node.getExpression(), p); |
|
333 |
r = scanAndReduce(node.getCases(), p, r); |
|
334 |
return r; |
|
335 |
} |
|
336 |
||
25287 | 337 |
/** |
338 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
339 |
* |
|
340 |
* @param node {@inheritDoc} |
|
341 |
* @param p {@inheritDoc} |
|
342 |
* @return the result of scanning |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
343 |
* |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
344 |
* @preview |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
345 |
* This method is modeling switch expressions, |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
346 |
* which are part of a preview feature and may be removed |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
347 |
* if the preview feature is removed. |
25287 | 348 |
*/ |
349 |
@Override |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
350 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
351 |
@SuppressWarnings("preview") |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
352 |
public R visitSwitchExpression(SwitchExpressionTree node, P p) { |
10 | 353 |
R r = scan(node.getExpression(), p); |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
354 |
r = scanAndReduce(node.getCases(), p, r); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
355 |
return r; |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
356 |
} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
357 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
358 |
/** |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
359 |
* {@inheritDoc} This implementation scans the children in left to right order. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
360 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
361 |
* @param node {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
362 |
* @param p {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
363 |
* @return the result of scanning |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
364 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
365 |
@Override |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
366 |
@SuppressWarnings("preview") |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
367 |
public R visitCase(CaseTree node, P p) { |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
368 |
R r = scan(node.getExpressions(), p); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
369 |
if (node.getCaseKind() == CaseKind.RULE) |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
370 |
r = scanAndReduce(node.getBody(), p, r); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
371 |
else |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
372 |
r = scanAndReduce(node.getStatements(), p, r); |
10 | 373 |
return r; |
374 |
} |
|
375 |
||
25287 | 376 |
/** |
377 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
378 |
* |
|
379 |
* @param node {@inheritDoc} |
|
380 |
* @param p {@inheritDoc} |
|
381 |
* @return the result of scanning |
|
382 |
*/ |
|
383 |
@Override |
|
10 | 384 |
public R visitSynchronized(SynchronizedTree node, P p) { |
385 |
R r = scan(node.getExpression(), p); |
|
386 |
r = scanAndReduce(node.getBlock(), p, r); |
|
387 |
return r; |
|
388 |
} |
|
389 |
||
25287 | 390 |
/** |
391 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
392 |
* |
|
393 |
* @param node {@inheritDoc} |
|
394 |
* @param p {@inheritDoc} |
|
395 |
* @return the result of scanning |
|
396 |
*/ |
|
397 |
@Override |
|
10 | 398 |
public R visitTry(TryTree node, P p) { |
6148
3a8158299c51
6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents:
5520
diff
changeset
|
399 |
R r = scan(node.getResources(), p); |
3a8158299c51
6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents:
5520
diff
changeset
|
400 |
r = scanAndReduce(node.getBlock(), p, r); |
10 | 401 |
r = scanAndReduce(node.getCatches(), p, r); |
402 |
r = scanAndReduce(node.getFinallyBlock(), p, r); |
|
403 |
return r; |
|
404 |
} |
|
405 |
||
25287 | 406 |
/** |
407 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
408 |
* |
|
409 |
* @param node {@inheritDoc} |
|
410 |
* @param p {@inheritDoc} |
|
411 |
* @return the result of scanning |
|
412 |
*/ |
|
413 |
@Override |
|
10 | 414 |
public R visitCatch(CatchTree node, P p) { |
415 |
R r = scan(node.getParameter(), p); |
|
416 |
r = scanAndReduce(node.getBlock(), p, r); |
|
417 |
return r; |
|
418 |
} |
|
419 |
||
25287 | 420 |
/** |
421 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
422 |
* |
|
423 |
* @param node {@inheritDoc} |
|
424 |
* @param p {@inheritDoc} |
|
425 |
* @return the result of scanning |
|
426 |
*/ |
|
427 |
@Override |
|
10 | 428 |
public R visitConditionalExpression(ConditionalExpressionTree node, P p) { |
429 |
R r = scan(node.getCondition(), p); |
|
430 |
r = scanAndReduce(node.getTrueExpression(), p, r); |
|
431 |
r = scanAndReduce(node.getFalseExpression(), p, r); |
|
432 |
return r; |
|
433 |
} |
|
434 |
||
25287 | 435 |
/** |
436 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
437 |
* |
|
438 |
* @param node {@inheritDoc} |
|
439 |
* @param p {@inheritDoc} |
|
440 |
* @return the result of scanning |
|
441 |
*/ |
|
442 |
@Override |
|
10 | 443 |
public R visitIf(IfTree node, P p) { |
444 |
R r = scan(node.getCondition(), p); |
|
445 |
r = scanAndReduce(node.getThenStatement(), p, r); |
|
446 |
r = scanAndReduce(node.getElseStatement(), p, r); |
|
447 |
return r; |
|
448 |
} |
|
449 |
||
25287 | 450 |
/** |
451 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
452 |
* |
|
453 |
* @param node {@inheritDoc} |
|
454 |
* @param p {@inheritDoc} |
|
455 |
* @return the result of scanning |
|
456 |
*/ |
|
457 |
@Override |
|
10 | 458 |
public R visitExpressionStatement(ExpressionStatementTree node, P p) { |
459 |
return scan(node.getExpression(), p); |
|
460 |
} |
|
461 |
||
25287 | 462 |
/** |
463 |
* {@inheritDoc} This implementation returns {@code null}. |
|
464 |
* |
|
465 |
* @param node {@inheritDoc} |
|
466 |
* @param p {@inheritDoc} |
|
467 |
* @return the result of scanning |
|
468 |
*/ |
|
469 |
@Override |
|
10 | 470 |
public R visitBreak(BreakTree node, P p) { |
55306 | 471 |
return null; |
10 | 472 |
} |
473 |
||
25287 | 474 |
/** |
475 |
* {@inheritDoc} This implementation returns {@code null}. |
|
476 |
* |
|
477 |
* @param node {@inheritDoc} |
|
478 |
* @param p {@inheritDoc} |
|
479 |
* @return the result of scanning |
|
480 |
*/ |
|
481 |
@Override |
|
10 | 482 |
public R visitContinue(ContinueTree node, P p) { |
483 |
return null; |
|
484 |
} |
|
485 |
||
25287 | 486 |
/** |
487 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
488 |
* |
|
489 |
* @param node {@inheritDoc} |
|
490 |
* @param p {@inheritDoc} |
|
491 |
* @return the result of scanning |
|
492 |
*/ |
|
493 |
@Override |
|
10 | 494 |
public R visitReturn(ReturnTree node, P p) { |
495 |
return scan(node.getExpression(), p); |
|
496 |
} |
|
497 |
||
25287 | 498 |
/** |
499 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
500 |
* |
|
501 |
* @param node {@inheritDoc} |
|
502 |
* @param p {@inheritDoc} |
|
503 |
* @return the result of scanning |
|
504 |
*/ |
|
505 |
@Override |
|
10 | 506 |
public R visitThrow(ThrowTree node, P p) { |
507 |
return scan(node.getExpression(), p); |
|
508 |
} |
|
509 |
||
25287 | 510 |
/** |
511 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
512 |
* |
|
513 |
* @param node {@inheritDoc} |
|
514 |
* @param p {@inheritDoc} |
|
515 |
* @return the result of scanning |
|
516 |
*/ |
|
517 |
@Override |
|
10 | 518 |
public R visitAssert(AssertTree node, P p) { |
519 |
R r = scan(node.getCondition(), p); |
|
520 |
r = scanAndReduce(node.getDetail(), p, r); |
|
521 |
return r; |
|
522 |
} |
|
523 |
||
25287 | 524 |
/** |
525 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
526 |
* |
|
527 |
* @param node {@inheritDoc} |
|
528 |
* @param p {@inheritDoc} |
|
529 |
* @return the result of scanning |
|
530 |
*/ |
|
531 |
@Override |
|
10 | 532 |
public R visitMethodInvocation(MethodInvocationTree node, P p) { |
533 |
R r = scan(node.getTypeArguments(), p); |
|
534 |
r = scanAndReduce(node.getMethodSelect(), p, r); |
|
535 |
r = scanAndReduce(node.getArguments(), p, r); |
|
536 |
return r; |
|
537 |
} |
|
538 |
||
25287 | 539 |
/** |
540 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
541 |
* |
|
542 |
* @param node {@inheritDoc} |
|
543 |
* @param p {@inheritDoc} |
|
544 |
* @return the result of scanning |
|
545 |
*/ |
|
546 |
@Override |
|
10 | 547 |
public R visitNewClass(NewClassTree node, P p) { |
548 |
R r = scan(node.getEnclosingExpression(), p); |
|
549 |
r = scanAndReduce(node.getIdentifier(), p, r); |
|
550 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
551 |
r = scanAndReduce(node.getArguments(), p, r); |
|
552 |
r = scanAndReduce(node.getClassBody(), p, r); |
|
553 |
return r; |
|
554 |
} |
|
555 |
||
25287 | 556 |
/** |
557 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
558 |
* |
|
559 |
* @param node {@inheritDoc} |
|
560 |
* @param p {@inheritDoc} |
|
561 |
* @return the result of scanning |
|
562 |
*/ |
|
563 |
@Override |
|
10 | 564 |
public R visitNewArray(NewArrayTree node, P p) { |
565 |
R r = scan(node.getType(), p); |
|
566 |
r = scanAndReduce(node.getDimensions(), p, r); |
|
567 |
r = scanAndReduce(node.getInitializers(), p, r); |
|
19491 | 568 |
r = scanAndReduce(node.getAnnotations(), p, r); |
569 |
for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) { |
|
570 |
r = scanAndReduce(dimAnno, p, r); |
|
571 |
} |
|
10 | 572 |
return r; |
573 |
} |
|
574 |
||
25287 | 575 |
/** |
576 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
577 |
* |
|
578 |
* @param node {@inheritDoc} |
|
579 |
* @param p {@inheritDoc} |
|
580 |
* @return the result of scanning |
|
581 |
*/ |
|
582 |
@Override |
|
11141 | 583 |
public R visitLambdaExpression(LambdaExpressionTree node, P p) { |
584 |
R r = scan(node.getParameters(), p); |
|
585 |
r = scanAndReduce(node.getBody(), p, r); |
|
586 |
return r; |
|
587 |
} |
|
588 |
||
25287 | 589 |
/** |
590 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
591 |
* |
|
592 |
* @param node {@inheritDoc} |
|
593 |
* @param p {@inheritDoc} |
|
594 |
* @return the result of scanning |
|
595 |
*/ |
|
596 |
@Override |
|
10 | 597 |
public R visitParenthesized(ParenthesizedTree node, P p) { |
598 |
return scan(node.getExpression(), p); |
|
599 |
} |
|
600 |
||
25287 | 601 |
/** |
602 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
603 |
* |
|
604 |
* @param node {@inheritDoc} |
|
605 |
* @param p {@inheritDoc} |
|
606 |
* @return the result of scanning |
|
607 |
*/ |
|
608 |
@Override |
|
10 | 609 |
public R visitAssignment(AssignmentTree node, P p) { |
610 |
R r = scan(node.getVariable(), p); |
|
611 |
r = scanAndReduce(node.getExpression(), p, r); |
|
612 |
return r; |
|
613 |
} |
|
614 |
||
25287 | 615 |
/** |
616 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
617 |
* |
|
618 |
* @param node {@inheritDoc} |
|
619 |
* @param p {@inheritDoc} |
|
620 |
* @return the result of scanning |
|
621 |
*/ |
|
622 |
@Override |
|
10 | 623 |
public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { |
624 |
R r = scan(node.getVariable(), p); |
|
625 |
r = scanAndReduce(node.getExpression(), p, r); |
|
626 |
return r; |
|
627 |
} |
|
628 |
||
25287 | 629 |
/** |
630 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
631 |
* |
|
632 |
* @param node {@inheritDoc} |
|
633 |
* @param p {@inheritDoc} |
|
634 |
* @return the result of scanning |
|
635 |
*/ |
|
636 |
@Override |
|
10 | 637 |
public R visitUnary(UnaryTree node, P p) { |
638 |
return scan(node.getExpression(), p); |
|
639 |
} |
|
640 |
||
25287 | 641 |
/** |
642 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
643 |
* |
|
644 |
* @param node {@inheritDoc} |
|
645 |
* @param p {@inheritDoc} |
|
646 |
* @return the result of scanning |
|
647 |
*/ |
|
648 |
@Override |
|
10 | 649 |
public R visitBinary(BinaryTree node, P p) { |
650 |
R r = scan(node.getLeftOperand(), p); |
|
651 |
r = scanAndReduce(node.getRightOperand(), p, r); |
|
652 |
return r; |
|
653 |
} |
|
654 |
||
25287 | 655 |
/** |
656 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
657 |
* |
|
658 |
* @param node {@inheritDoc} |
|
659 |
* @param p {@inheritDoc} |
|
660 |
* @return the result of scanning |
|
661 |
*/ |
|
662 |
@Override |
|
10 | 663 |
public R visitTypeCast(TypeCastTree node, P p) { |
664 |
R r = scan(node.getType(), p); |
|
665 |
r = scanAndReduce(node.getExpression(), p, r); |
|
666 |
return r; |
|
667 |
} |
|
668 |
||
25287 | 669 |
/** |
670 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
671 |
* |
|
672 |
* @param node {@inheritDoc} |
|
673 |
* @param p {@inheritDoc} |
|
674 |
* @return the result of scanning |
|
675 |
*/ |
|
676 |
@Override |
|
10 | 677 |
public R visitInstanceOf(InstanceOfTree node, P p) { |
678 |
R r = scan(node.getExpression(), p); |
|
679 |
r = scanAndReduce(node.getType(), p, r); |
|
680 |
return r; |
|
681 |
} |
|
682 |
||
25287 | 683 |
/** |
684 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
685 |
* |
|
686 |
* @param node {@inheritDoc} |
|
687 |
* @param p {@inheritDoc} |
|
688 |
* @return the result of scanning |
|
689 |
*/ |
|
690 |
@Override |
|
10 | 691 |
public R visitArrayAccess(ArrayAccessTree node, P p) { |
692 |
R r = scan(node.getExpression(), p); |
|
693 |
r = scanAndReduce(node.getIndex(), p, r); |
|
694 |
return r; |
|
695 |
} |
|
696 |
||
25287 | 697 |
/** |
698 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
699 |
* |
|
700 |
* @param node {@inheritDoc} |
|
701 |
* @param p {@inheritDoc} |
|
702 |
* @return the result of scanning |
|
703 |
*/ |
|
704 |
@Override |
|
10 | 705 |
public R visitMemberSelect(MemberSelectTree node, P p) { |
706 |
return scan(node.getExpression(), p); |
|
707 |
} |
|
708 |
||
25287 | 709 |
/** |
710 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
711 |
* |
|
712 |
* @param node {@inheritDoc} |
|
713 |
* @param p {@inheritDoc} |
|
714 |
* @return the result of scanning |
|
715 |
*/ |
|
716 |
@Override |
|
11142 | 717 |
public R visitMemberReference(MemberReferenceTree node, P p) { |
718 |
R r = scan(node.getQualifierExpression(), p); |
|
719 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
720 |
return r; |
|
721 |
} |
|
722 |
||
25287 | 723 |
/** |
724 |
* {@inheritDoc} This implementation returns {@code null}. |
|
725 |
* |
|
726 |
* @param node {@inheritDoc} |
|
727 |
* @param p {@inheritDoc} |
|
728 |
* @return the result of scanning |
|
729 |
*/ |
|
730 |
@Override |
|
10 | 731 |
public R visitIdentifier(IdentifierTree node, P p) { |
732 |
return null; |
|
733 |
} |
|
734 |
||
25287 | 735 |
/** |
736 |
* {@inheritDoc} This implementation returns {@code null}. |
|
737 |
* |
|
738 |
* @param node {@inheritDoc} |
|
739 |
* @param p {@inheritDoc} |
|
740 |
* @return the result of scanning |
|
741 |
*/ |
|
742 |
@Override |
|
10 | 743 |
public R visitLiteral(LiteralTree node, P p) { |
744 |
return null; |
|
745 |
} |
|
746 |
||
25287 | 747 |
/** |
748 |
* {@inheritDoc} This implementation returns {@code null}. |
|
749 |
* |
|
750 |
* @param node {@inheritDoc} |
|
751 |
* @param p {@inheritDoc} |
|
752 |
* @return the result of scanning |
|
753 |
*/ |
|
754 |
@Override |
|
10 | 755 |
public R visitPrimitiveType(PrimitiveTypeTree node, P p) { |
756 |
return null; |
|
757 |
} |
|
758 |
||
25287 | 759 |
/** |
760 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
761 |
* |
|
762 |
* @param node {@inheritDoc} |
|
763 |
* @param p {@inheritDoc} |
|
764 |
* @return the result of scanning |
|
765 |
*/ |
|
766 |
@Override |
|
10 | 767 |
public R visitArrayType(ArrayTypeTree node, P p) { |
768 |
return scan(node.getType(), p); |
|
769 |
} |
|
770 |
||
25287 | 771 |
/** |
772 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
773 |
* |
|
774 |
* @param node {@inheritDoc} |
|
775 |
* @param p {@inheritDoc} |
|
776 |
* @return the result of scanning |
|
777 |
*/ |
|
778 |
@Override |
|
10 | 779 |
public R visitParameterizedType(ParameterizedTypeTree node, P p) { |
780 |
R r = scan(node.getType(), p); |
|
781 |
r = scanAndReduce(node.getTypeArguments(), p, r); |
|
782 |
return r; |
|
783 |
} |
|
784 |
||
25287 | 785 |
/** |
786 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
787 |
* |
|
788 |
* @param node {@inheritDoc} |
|
789 |
* @param p {@inheritDoc} |
|
790 |
* @return the result of scanning |
|
791 |
*/ |
|
792 |
@Override |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
793 |
public R visitUnionType(UnionTypeTree node, P p) { |
7074 | 794 |
return scan(node.getTypeAlternatives(), p); |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
795 |
} |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
796 |
|
25287 | 797 |
/** |
798 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
799 |
* |
|
800 |
* @param node {@inheritDoc} |
|
801 |
* @param p {@inheritDoc} |
|
802 |
* @return the result of scanning |
|
803 |
*/ |
|
804 |
@Override |
|
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
805 |
public R visitIntersectionType(IntersectionTypeTree node, P p) { |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
806 |
return scan(node.getBounds(), p); |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
807 |
} |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
13844
diff
changeset
|
808 |
|
25287 | 809 |
/** |
810 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
811 |
* |
|
812 |
* @param node {@inheritDoc} |
|
813 |
* @param p {@inheritDoc} |
|
814 |
* @return the result of scanning |
|
815 |
*/ |
|
816 |
@Override |
|
10 | 817 |
public R visitTypeParameter(TypeParameterTree node, P p) { |
15385 | 818 |
R r = scan(node.getAnnotations(), p); |
819 |
r = scanAndReduce(node.getBounds(), p, r); |
|
3149 | 820 |
return r; |
10 | 821 |
} |
822 |
||
25287 | 823 |
/** |
824 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
825 |
* |
|
826 |
* @param node {@inheritDoc} |
|
827 |
* @param p {@inheritDoc} |
|
828 |
* @return the result of scanning |
|
829 |
*/ |
|
830 |
@Override |
|
10 | 831 |
public R visitWildcard(WildcardTree node, P p) { |
832 |
return scan(node.getBound(), p); |
|
833 |
} |
|
834 |
||
25287 | 835 |
/** |
836 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
837 |
* |
|
838 |
* @param node {@inheritDoc} |
|
839 |
* @param p {@inheritDoc} |
|
840 |
* @return the result of scanning |
|
841 |
*/ |
|
842 |
@Override |
|
10 | 843 |
public R visitModifiers(ModifiersTree node, P p) { |
844 |
return scan(node.getAnnotations(), p); |
|
845 |
} |
|
846 |
||
25287 | 847 |
/** |
848 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
849 |
* |
|
850 |
* @param node {@inheritDoc} |
|
851 |
* @param p {@inheritDoc} |
|
852 |
* @return the result of scanning |
|
853 |
*/ |
|
854 |
@Override |
|
10 | 855 |
public R visitAnnotation(AnnotationTree node, P p) { |
856 |
R r = scan(node.getAnnotationType(), p); |
|
857 |
r = scanAndReduce(node.getArguments(), p, r); |
|
858 |
return r; |
|
859 |
} |
|
860 |
||
25287 | 861 |
/** |
862 |
* {@inheritDoc} This implementation scans the children in left to right order. |
|
863 |
* |
|
864 |
* @param node {@inheritDoc} |
|
865 |
* @param p {@inheritDoc} |
|
866 |
* @return the result of scanning |
|
867 |
*/ |
|
868 |
@Override |
|
869 |
public R visitAnnotatedType(AnnotatedTypeTree node, P p) { |
|
870 |
R r = scan(node.getAnnotations(), p); |
|
871 |
r = scanAndReduce(node.getUnderlyingType(), p, r); |
|
872 |
return r; |
|
873 |
} |
|
15385 | 874 |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
875 |
@Override |
36526 | 876 |
public R visitModule(ModuleTree node, P p) { |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
877 |
R r = scan(node.getAnnotations(), p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
878 |
r = scanAndReduce(node.getName(), p, r); |
36526 | 879 |
r = scanAndReduce(node.getDirectives(), p, r); |
880 |
return r; |
|
881 |
} |
|
882 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
883 |
@Override |
36526 | 884 |
public R visitExports(ExportsTree node, P p) { |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
885 |
R r = scan(node.getPackageName(), p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
886 |
r = scanAndReduce(node.getModuleNames(), p, r); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
887 |
return r; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
888 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
889 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
890 |
@Override |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
891 |
public R visitOpens(OpensTree node, P p) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
892 |
R r = scan(node.getPackageName(), p); |
36526 | 893 |
r = scanAndReduce(node.getModuleNames(), p, r); |
894 |
return r; |
|
895 |
} |
|
896 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
897 |
@Override |
36526 | 898 |
public R visitProvides(ProvidesTree node, P p) { |
899 |
R r = scan(node.getServiceName(), p); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
900 |
r = scanAndReduce(node.getImplementationNames(), p, r); |
36526 | 901 |
return r; |
902 |
} |
|
903 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
904 |
@Override |
36526 | 905 |
public R visitRequires(RequiresTree node, P p) { |
906 |
return scan(node.getModuleName(), p); |
|
907 |
} |
|
908 |
||
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
909 |
@Override |
36526 | 910 |
public R visitUses(UsesTree node, P p) { |
911 |
return scan(node.getServiceName(), p); |
|
912 |
} |
|
913 |
||
25287 | 914 |
/** |
915 |
* {@inheritDoc} This implementation returns {@code null}. |
|
916 |
* |
|
917 |
* @param node {@inheritDoc} |
|
918 |
* @param p {@inheritDoc} |
|
919 |
* @return the result of scanning |
|
920 |
*/ |
|
921 |
@Override |
|
10 | 922 |
public R visitOther(Tree node, P p) { |
923 |
return null; |
|
924 |
} |
|
925 |
||
25287 | 926 |
/** |
927 |
* {@inheritDoc} This implementation returns {@code null}. |
|
928 |
* |
|
929 |
* @param node {@inheritDoc} |
|
930 |
* @param p {@inheritDoc} |
|
931 |
* @return the result of scanning |
|
932 |
*/ |
|
933 |
@Override |
|
10 | 934 |
public R visitErroneous(ErroneousTree node, P p) { |
935 |
return null; |
|
936 |
} |
|
55306 | 937 |
|
938 |
/** |
|
939 |
* {@inheritDoc} This implementation returns {@code null}. |
|
940 |
* |
|
941 |
* @param node {@inheritDoc} |
|
942 |
* @param p {@inheritDoc} |
|
943 |
* @return the result of scanning |
|
944 |
* |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
945 |
* @preview |
55306 | 946 |
* This method is modeling switch expressions, |
947 |
* which are part of a preview feature and may be removed |
|
948 |
* if the preview feature is removed. |
|
949 |
*/ |
|
950 |
@Override |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
951 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
952 |
@SuppressWarnings("preview") |
55306 | 953 |
public R visitYield(YieldTree node, P p) { |
954 |
return scan(node.getValue(), p); |
|
955 |
} |
|
10 | 956 |
} |