langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
76 import com.sun.tools.javac.tree.DCTree.DCSerial; |
76 import com.sun.tools.javac.tree.DCTree.DCSerial; |
77 import com.sun.tools.javac.tree.DCTree.DCSerialData; |
77 import com.sun.tools.javac.tree.DCTree.DCSerialData; |
78 import com.sun.tools.javac.tree.DCTree.DCSerialField; |
78 import com.sun.tools.javac.tree.DCTree.DCSerialField; |
79 import com.sun.tools.javac.tree.DCTree.DCSince; |
79 import com.sun.tools.javac.tree.DCTree.DCSince; |
80 import com.sun.tools.javac.tree.DCTree.DCStartElement; |
80 import com.sun.tools.javac.tree.DCTree.DCStartElement; |
|
81 import com.sun.tools.javac.tree.DCTree.DCSummary; |
81 import com.sun.tools.javac.tree.DCTree.DCText; |
82 import com.sun.tools.javac.tree.DCTree.DCText; |
82 import com.sun.tools.javac.tree.DCTree.DCThrows; |
83 import com.sun.tools.javac.tree.DCTree.DCThrows; |
83 import com.sun.tools.javac.tree.DCTree.DCUnknownBlockTag; |
84 import com.sun.tools.javac.tree.DCTree.DCUnknownBlockTag; |
84 import com.sun.tools.javac.tree.DCTree.DCUnknownInlineTag; |
85 import com.sun.tools.javac.tree.DCTree.DCUnknownInlineTag; |
85 import com.sun.tools.javac.tree.DCTree.DCUses; |
86 import com.sun.tools.javac.tree.DCTree.DCUses; |
410 tree.pos = pos; |
411 tree.pos = pos; |
411 return tree; |
412 return tree; |
412 } |
413 } |
413 |
414 |
414 @Override @DefinedBy(Api.COMPILER_TREE) |
415 @Override @DefinedBy(Api.COMPILER_TREE) |
|
416 public DCSummary newSummaryTree(List<? extends DocTree> text) { |
|
417 DCSummary tree = new DCSummary(cast(text)); |
|
418 tree.pos = pos; |
|
419 return tree; |
|
420 } |
|
421 |
|
422 @Override @DefinedBy(Api.COMPILER_TREE) |
415 public DCText newTextTree(String text) { |
423 public DCText newTextTree(String text) { |
416 DCText tree = new DCText(text); |
424 DCText tree = new DCText(text); |
417 tree.pos = pos; |
425 tree.pos = pos; |
418 return tree; |
426 return tree; |
419 } |
427 } |
495 if (foundFirstSentence) { |
503 if (foundFirstSentence) { |
496 body.add((DCTree) dt); |
504 body.add((DCTree) dt); |
497 continue; |
505 continue; |
498 } |
506 } |
499 switch (dt.getKind()) { |
507 switch (dt.getKind()) { |
|
508 case SUMMARY: |
|
509 foundFirstSentence = true; |
|
510 break; |
500 case TEXT: |
511 case TEXT: |
501 DCText tt = (DCText) dt; |
512 DCText tt = (DCText) dt; |
502 String s = tt.getBody(); |
513 String s = tt.getBody(); |
503 DocTree peekedNext = itr.hasNext() |
514 DocTree peekedNext = itr.hasNext() |
504 ? alist.get(itr.nextIndex()) |
515 ? alist.get(itr.nextIndex()) |