Thu, 30 Jul 2009 10:29:53 +0100
6827648: Extremely slow compilation time for visitor pattern code + generics
Summary: Javac unnecessarily recomputates type-substitutions multiple times
Reviewed-by: jjg
1 #
2 # Copyright 1998-2003 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 # CA 95054 USA or visit www.sun.com if you need additional information or
21 # have any questions.
22 #
24 # @test
25 # @bug 4087314 4800342
26 # @summary Verify allowed access to protected class from another package.
27 # @author William Maddox (maddox)
28 #
29 # @run shell ProtectedInnerClass.sh
32 if [ "${TESTSRC}" = "" ]
33 then
34 echo "TESTSRC not set. Test cannot execute. Failed."
35 exit 1
36 fi
37 echo "TESTSRC=${TESTSRC}"
38 if [ "${TESTJAVA}" = "" ]
39 then
40 echo "TESTJAVA not set. Test cannot execute. Failed."
41 exit 1
42 fi
43 echo "TESTJAVA=${TESTJAVA}"
44 if [ "${TESTCLASSES}" = "" ]
45 then
46 echo "TESTCLASSES not set. Test cannot execute. Failed."
47 exit 1
48 fi
49 echo "TESTCLASSES=${TESTCLASSES}"
50 echo "CLASSPATH=${CLASSPATH}"
52 # set platform-dependent variables
53 OS=`uname -s`
54 case "$OS" in
55 SunOS | Linux )
56 NULL=/dev/null
57 PS=":"
58 FS="/"
59 ;;
60 Windows* )
61 NULL=NUL
62 PS=";"
63 FS="\\"
64 ;;
65 * )
66 echo "Unrecognized system!"
67 exit 1;
68 ;;
69 esac
71 rm -f ${TESTCLASSES}${FS}p1${FS}*.class ${TESTCLASSES}${FS}p2${FS}*.class
73 "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}${FS}p1${FS}ProtectedInnerClass1.java" "${TESTSRC}${FS}p2${FS}ProtectedInnerClass2.java"
74 "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -classpath "${CLASSPATH}${PS}${TESTCLASSES}" p2.ProtectedInnerClass2
75 result=$?
76 if [ $result -eq 0 ]
77 then
78 echo "Passed"
79 else
80 echo "Failed"
81 fi
82 exit $result