Tue, 22 Sep 2009 14:06:29 -0700
6884624: Update copyright year
Summary: Update copyright for files that have been modified in 2009 through Septermber
Reviewed-by: tbell, ohair
jrose@267 | 1 | /* |
xdono@404 | 2 | * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. |
jrose@267 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jrose@267 | 4 | * |
jrose@267 | 5 | * This code is free software; you can redistribute it and/or modify it |
jrose@267 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jrose@267 | 7 | * published by the Free Software Foundation. |
jrose@267 | 8 | * |
jrose@267 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jrose@267 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jrose@267 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jrose@267 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jrose@267 | 13 | * accompanied this code). |
jrose@267 | 14 | * |
jrose@267 | 15 | * You should have received a copy of the GNU General Public License version |
jrose@267 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jrose@267 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jrose@267 | 18 | * |
jrose@267 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
jrose@267 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
jrose@267 | 21 | * have any questions. |
jrose@267 | 22 | */ |
jrose@267 | 23 | |
jrose@267 | 24 | /* |
jrose@267 | 25 | * @test |
jrose@267 | 26 | * @bug 6746458 |
jrose@267 | 27 | * @summary Verify correct separate compilation of classes with extended identifiers. |
jrose@267 | 28 | * @author jrose |
jjg@392 | 29 | * @ignore 6877225 test fails on Windows: |
jjg@392 | 30 | * QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class |
jjg@392 | 31 | * (The filename, directory name, or volume label syntax is incorrect) |
jrose@267 | 32 | * |
jrose@267 | 33 | * @library .. |
jrose@267 | 34 | * @run main quid.QuotedIdent2 |
jrose@267 | 35 | */ |
jrose@267 | 36 | /* |
jrose@267 | 37 | * Standalone testing: |
jrose@267 | 38 | * <code> |
jrose@267 | 39 | * $ cd $MY_REPO_DIR/langtools |
jrose@267 | 40 | * $ (cd make; make) |
jrose@267 | 41 | * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java |
jrose@267 | 42 | * $ ./dist/bootstrap/bin/javac -d dist -cp dist test/tools/javac/quid/QuotedIdent2.java |
jrose@267 | 43 | * $ java -version # should print 1.6 or later |
jrose@267 | 44 | * $ java -cp dist QuotedIdent2 |
jrose@267 | 45 | * </code> |
jrose@267 | 46 | */ |
jrose@267 | 47 | |
jrose@267 | 48 | package quid; |
jrose@267 | 49 | |
jrose@267 | 50 | import quid.QuotedIdent.*; |
jrose@267 | 51 | import quid.QuotedIdent.#"*86"; |
jrose@267 | 52 | import static quid.QuotedIdent.#"MAKE-*86"; |
jrose@267 | 53 | |
jrose@267 | 54 | public class QuotedIdent2 { |
jrose@267 | 55 | static void check(int testid, String have, String expect) |
jrose@267 | 56 | throws RuntimeException { |
jrose@267 | 57 | QuotedIdent.check(testid, have, expect); |
jrose@267 | 58 | } |
jrose@267 | 59 | |
jrose@267 | 60 | public static void main(String[] args) throws Exception { |
jrose@267 | 61 | String s; |
jrose@267 | 62 | |
jrose@267 | 63 | s = #"int".valueOf(123).toString(); |
jrose@267 | 64 | check(22, s, "123"); |
jrose@267 | 65 | |
jrose@267 | 66 | s = #"MAKE-*86"().#"555-1212"(); |
jrose@267 | 67 | check(23, s, "[*86.555-1212]"); |
jrose@267 | 68 | |
jrose@267 | 69 | s = #"Yog-Shoggoth".#"(nameless ululation)"; |
jrose@267 | 70 | check(25, s, "Tekeli-li!"); |
jrose@267 | 71 | |
jrose@267 | 72 | s = QuotedIdent.#"int".class.getName(); |
jrose@267 | 73 | check(31, s, QuotedIdent.class.getName()+"$int"); |
jrose@267 | 74 | |
jrose@267 | 75 | Class x86 = Class.forName(QuotedIdent.class.getName()+"$*86"); |
jrose@267 | 76 | if (x86 != #"*86".class) |
jrose@267 | 77 | check(32, "reflected "+x86, "static "+#"*86".class); |
jrose@267 | 78 | |
jrose@267 | 79 | s = (String) x86.getDeclaredMethod("555-1212").invoke(QuotedIdent.#"MAKE-*86"()); |
jrose@267 | 80 | check(31, s, "[*86.555-1212]"); |
jrose@267 | 81 | |
jrose@267 | 82 | System.out.println("OK"); |
jrose@267 | 83 | } |
jrose@267 | 84 | } |