langtools/test/tools/javah/T7185778.java
author naoto
Tue, 29 Mar 2016 17:06:33 -0700
changeset 36739 145210aba850
parent 30730 d3ce7619db2c
child 36991 7f814aac1f80
permissions -rw-r--r--
8152704: jlink command line output/help message improvement Reviewed-by: mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13690
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 13690
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
13690
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     4
 *
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     8
 *
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    13
 * accompanied this code).
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    14
 *
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    18
 *
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    21
 * questions.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    22
 */
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    23
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    24
/*
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    25
 * @test
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    26
 * @bug 7185778
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    27
 * @summary javah error "Not a valid class name" on class names with dollar signs
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    28
 *   The first two tests are on an inner class name whose name does not contain $.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    29
 *   The second two tests are on an inner class name whose name does contain $.
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    30
 *   The last test is on an outer class whose name contains $.
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 13690
diff changeset
    31
 * @modules jdk.compiler
13690
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    32
 * @run main T7185778 T7185778$inner
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    33
 * @run main T7185778 T7185778.inner
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    34
 * @run main T7185778 T7185778$inner$
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    35
 * @run main T7185778 T7185778.inner$
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    36
 * @run main T7185778 xx$yy
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    37
 */
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    38
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    39
public class T7185778 {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    40
    class inner {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    41
        native byte[] xxxxx(String name);
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    42
    }
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    43
    class inner$ {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    44
        native byte[] xxxxx(String name);
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    45
    }
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    46
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    47
    static public void main(String[] args) {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    48
        int rc = com.sun.tools.javah.Main.run(args, null);
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    49
        if ( rc != 0) {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    50
            throw new Error("javah returned non zero: " + rc);
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    51
        }
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    52
    }
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    53
}
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    54
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    55
class xx$yy {
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    56
    native byte[] xxxxx(String name);
8be9ba21c4a9 7185778: javah error "Not a valid class name" on class names with dollar signs
jjh
parents:
diff changeset
    57
}