Thu, 23 Oct 2008 17:59:43 +0100
6711619: javac doesn't allow access to protected members in intersection types
Summary: Accordingly to new accessibility rules all members of intersection types (but private ones) should be accessible
Reviewed-by: jjg
1 #!/bin/sh
3 #
4 # Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved.
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 #
7 # This code is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License version 2 only, as
9 # published by the Free Software Foundation.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 # CA 95054 USA or visit www.sun.com if you need additional information or
23 # have any questions.
24 #
27 # @test
28 # @bug 4204897 4256097 4785453 4863609
29 # @summary Test that '.jar' files in -extdirs are found.
30 # @author maddox
31 #
32 # @run shell/timeout=180 ExtDirs.sh
34 if [ "${TESTSRC}" = "" ]
35 then
36 echo "TESTSRC not set. Test cannot execute. Failed."
37 exit 1
38 fi
39 echo "TESTSRC=${TESTSRC}"
40 if [ "${TESTJAVA}" = "" ]
41 then
42 echo "TESTJAVA not set. Test cannot execute. Failed."
43 exit 1
44 fi
45 echo "TESTJAVA=${TESTJAVA}"
46 if [ "${TESTCLASSES}" = "" ]
47 then
48 echo "TESTCLASSES not set. Test cannot execute. Failed."
49 exit 1
50 fi
51 echo "TESTCLASSES=${TESTCLASSES}"
52 echo "CLASSPATH=${CLASSPATH}"
54 # set platform-dependent variables
55 OS=`uname -s`
56 case "$OS" in
57 SunOS | Linux )
58 NULL=/dev/null
59 PS=":"
60 FS="/"
61 ;;
62 Windows* )
63 NULL=NUL
64 PS=";"
65 FS="\\"
66 ;;
67 * )
68 echo "Unrecognized system!"
69 exit 1;
70 ;;
71 esac
73 fail() {
74 echo 'FAIL: unexpected result encountered'
75 exit 1
76 }
78 javac="${TESTJAVA}${FS}bin${FS}javac"
80 for i in 1 2 3; do
81 if test ! -d ext${i}; then mkdir ext${i}; fi
82 cp ${TESTSRC}${FS}ext${i}${FS}*.jar ext${i}
83 done
85 echo "Test 1"
86 $javac ${TESTTOOLVMOPTS} -d . -extdirs ext1 "${TESTSRC}${FS}ExtDirTest_1.java"
87 if [ $? -ne 0 ] ; then fail ; fi
89 echo "Test 2"
90 $javac ${TESTTOOLVMOPTS} -d . -extdirs ext1${PS}ext2 "${TESTSRC}${FS}ExtDirTest_2.java"
91 if [ $? -ne 0 ] ; then fail ; fi
93 echo "Test 3"
94 $javac ${TESTTOOLVMOPTS} -d . -extdirs ext3 "${TESTSRC}${FS}ExtDirTest_3.java"
95 if [ $? -ne 0 ] ; then fail ; fi
97 echo PASS: all tests gave expected results
98 exit 0