8 # published by the Free Software Foundation.
9 #
10 # This code is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # version 2 for more details (a copy is included in the LICENSE file that
14 # accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License version
17 # 2 along with this work; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 # or visit www.oracle.com if you need additional information or have any
22 # questions.
23 #
24
25 # @test
26 # @bug 8160024
27 # @summary jdb returns invalid argument count if first parameter to Arrays.asList is null
28 #
29 # @run shell/timeout=300 EvalArraysAsList.sh
30 #
31 # The test checks if evaluation of the expression java.util.Arrays.asList(null, "a")
32 # works normally and does not throw an IllegalArgumentException.
33
34 classname=EvalArraysAsList
35
36 createJavaFile()
37 {
38 cat <<EOF > $classname.java.1
39 public class $classname {
40 public static void main(String[] args) {
41 java.util.List<Object> l = java.util.Arrays.asList(null, "a");
42 System.out.println("java.util.Arrays.asList(null, \"a\") returns: " + l);
43 return; // @1 breakpoint
44 }
45 }
46 EOF
47 }
48
49 # drive jdb by sending cmds to it and examining its output
50 dojdbCmds()
51 {
52 setBkpts @1
|
8 # published by the Free Software Foundation.
9 #
10 # This code is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # version 2 for more details (a copy is included in the LICENSE file that
14 # accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License version
17 # 2 along with this work; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 # or visit www.oracle.com if you need additional information or have any
22 # questions.
23 #
24
25 # @test
26 # @bug 8160024
27 # @summary jdb returns invalid argument count if first parameter to Arrays.asList is null
28 # The test checks if evaluation of the expression java.util.Arrays.asList(null, "a")
29 # works normally and does not throw an IllegalArgumentException.
30 #
31 # @run shell/timeout=300 EvalArraysAsList.sh
32 #
33
34
35 classname=EvalArraysAsList
36
37 createJavaFile()
38 {
39 cat <<EOF > $classname.java.1
40 public class $classname {
41 public static void main(String[] args) {
42 java.util.List<Object> l = java.util.Arrays.asList(null, "a");
43 System.out.println("java.util.Arrays.asList(null, \"a\") returns: " + l);
44 return; // @1 breakpoint
45 }
46 }
47 EOF
48 }
49
50 # drive jdb by sending cmds to it and examining its output
51 dojdbCmds()
52 {
53 setBkpts @1
|