langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java
changeset 41452 ddaef4bba083
parent 37009 476d8d615222
child 42831 feff6f296019
equal deleted inserted replaced
41451:a847c7aa25a7 41452:ddaef4bba083
   201      * Primarily to produce a DocCommenTree when given a
   201      * Primarily to produce a DocCommenTree when given a
   202      * first sentence and a body, this is useful, in cases
   202      * first sentence and a body, this is useful, in cases
   203      * where the trees are being synthesized by a tool.
   203      * where the trees are being synthesized by a tool.
   204      */
   204      */
   205     @Override @DefinedBy(Api.COMPILER_TREE)
   205     @Override @DefinedBy(Api.COMPILER_TREE)
   206     public DCDocComment newDocCommentTree(List<? extends DocTree> firstSentence, List<? extends DocTree> body, List<? extends DocTree> tags) {
   206     public DCDocComment newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) {
   207         ListBuffer<DCTree> lb = new ListBuffer<>();
   207         ListBuffer<DCTree> lb = new ListBuffer<>();
   208         lb.addAll(cast(firstSentence));
   208         lb.addAll(cast(fullBody));
   209         lb.addAll(cast(body));
   209         List<DCTree> fBody = lb.toList();
   210         List<DCTree> fullBody = lb.toList();
       
   211 
   210 
   212         // A dummy comment to keep the diagnostics logic happy.
   211         // A dummy comment to keep the diagnostics logic happy.
   213         Comment c = new Comment() {
   212         Comment c = new Comment() {
   214             @Override
   213             @Override
   215             public String getText() {
   214             public String getText() {
   229             @Override
   228             @Override
   230             public boolean isDeprecated() {
   229             public boolean isDeprecated() {
   231                 return false;
   230                 return false;
   232             }
   231             }
   233         };
   232         };
   234 
   233         Pair<List<DCTree>, List<DCTree>> pair = splitBody(fullBody);
   235         DCDocComment tree = new DCDocComment(c, fullBody, cast(firstSentence), cast(body), cast(tags));
   234         DCDocComment tree = new DCDocComment(c, fBody, pair.fst, pair.snd, cast(tags));
   236         return tree;
   235         return tree;
   237     }
   236     }
   238 
   237 
   239     @Override @DefinedBy(Api.COMPILER_TREE)
   238     @Override @DefinedBy(Api.COMPILER_TREE)
   240     public DCDocRoot newDocRootTree() {
   239     public DCDocRoot newDocRootTree() {