test/tools/javac/doctree/LiteralTest.java

Thu, 21 Feb 2013 15:26:46 +0000

author
mcimadamore
date
Thu, 21 Feb 2013 15:26:46 +0000
changeset 1599
9f0ec00514b6
parent 0
959103a6100f
permissions
-rw-r--r--

8007461: Regression: bad overload resolution when inner class and outer class have method with same name
Summary: Fix regression in varargs method resolution introduced by bad refactoring
Reviewed-by: jjg

     1 /*
     2  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     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
     7  * published by the Free Software Foundation.
     8  *
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12  * version 2 for more details (a copy is included in the LICENSE file that
    13  * accompanied this code).
    14  *
    15  * You should have received a copy of the GNU General Public License version
    16  * 2 along with this work; if not, write to the Free Software Foundation,
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18  *
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    22  */
    24 /*
    25  * @test
    26  * @bug 7021614
    27  * @summary extend com.sun.source API to support parsing javadoc comments
    28  * @build DocCommentTester
    29  * @run main DocCommentTester LiteralTest.java
    30  */
    32 class LiteralTest {
    33     /** {@literal if (a < b) { }} */
    34     void minimal() { }
    35 /*
    36 DocComment[DOC_COMMENT, pos:0
    37   firstSentence: 1
    38     Literal[LITERAL, pos:0, if_(a_<_b)_{_}]
    39   body: empty
    40   block tags: empty
    41 ]
    42 */
    44     /** [{@literal if (a < b) { }}] */
    45     void in_brackets() { }
    46 /*
    47 DocComment[DOC_COMMENT, pos:0
    48   firstSentence: 3
    49     Text[TEXT, pos:0, []
    50     Literal[LITERAL, pos:1, if_(a_<_b)_{_}]
    51     Text[TEXT, pos:26, ]]
    52   body: empty
    53   block tags: empty
    54 ]
    55 */
    57     /** [ {@literal if (a < b) { }} ] */
    58     void in_brackets_with_whitespace() { }
    59 /*
    60 DocComment[DOC_COMMENT, pos:0
    61   firstSentence: 3
    62     Text[TEXT, pos:0, [_]
    63     Literal[LITERAL, pos:2, if_(a_<_b)_{_}]
    64     Text[TEXT, pos:27, _]]
    65   body: empty
    66   block tags: empty
    67 ]
    68 */
    70     /**
    71      * {@literal {@literal nested} }
    72      */
    73     void nested() { }
    74 /*
    75 DocComment[DOC_COMMENT, pos:1
    76   firstSentence: 1
    77     Literal[LITERAL, pos:1, {@literal_nested}_]
    78   body: empty
    79   block tags: empty
    80 ]
    81 */
    83     /**
    84      * {@literal if (a < b) {
    85      *        }
    86      * }
    87      */
    88     void embedded_newline() { }
    89 /*
    90 DocComment[DOC_COMMENT, pos:1
    91   firstSentence: 1
    92     Literal[LITERAL, pos:1, if_(a_<_b)_{|________}|_]
    93   body: empty
    94   block tags: empty
    95 ]
    96 */
    99     /** {@literal if (a < b) { } */
   100     void unterminated_1() { }
   101 /*
   102 DocComment[DOC_COMMENT, pos:0
   103   firstSentence: 1
   104     Erroneous[ERRONEOUS, pos:0
   105       code: compiler.err.dc.unterminated.inline.tag
   106       body: {@literal_if_(a_<_b)_{_}
   107     ]
   108   body: empty
   109   block tags: empty
   110 ]
   111 */
   113     /**
   114      * {@literal if (a < b) { }
   115      * @author jjg */
   116     void unterminated_2() { }
   117 /*
   118 DocComment[DOC_COMMENT, pos:1
   119   firstSentence: 1
   120     Erroneous[ERRONEOUS, pos:1
   121       code: compiler.err.dc.unterminated.inline.tag
   122       body: {@literal_if_(a_<_b)_{_}
   123     ]
   124   body: empty
   125   block tags: 1
   126     Author[AUTHOR, pos:27
   127       name: 1
   128         Text[TEXT, pos:35, jjg]
   129     ]
   130 ]
   131 */
   133 }

mercurial