2362N/A * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary JPDA: Add support for JSR-014 Generics 0N/A * @run build TestScaffold VMConnection TargetListener TargetAdapter 0N/A * @run main GenericsTest 0N/A /********** target program **********/ 0N/A /********** test program **********/ 0N/A * The 1.5 FE must be able to talk to a 1.4 BE, ie, JDWP version <= 1.4. 0N/A * This is hard to test since this test file must be compiled with 0N/A * -source 1.5 which will cause its class file to be version 49 which 0N/A * won't run on a pre 1.5 JDK. We can simulate this though 0N/A * to this test which causes the debuggee to be run on that JDK. 0N/A * This should be a version of 1.5 that accepts classfile version 49, 0N/A * but which still contains the 1.4 version of JDWP. 0N/A * This trick verifies that the calls to genericSignature() methods 0N/A * in the test do not cause the generic JDWP commands to be issued. 0N/A * The value to use for this is currently: 0N/A /********** test core **********/ 0N/A * Get to the top of main() 0N/A * to determine targetClass and mainThread 0N/A * Prove that arrays aren't broken and that 0N/A * null is returned if there is no generic signature 0N/A failure(
"FAILED: Expected generic signature = null for " 0N/A // prove that primitives aren't broken. 0N/A // Verify genericSignature for a class 0N/A failure(
"FAILED: Expected generic signature for gen1: " +
0N/A // Verify genericSignature() for a field 0N/A // there is only one field 0N/A failure(
"FAILED: Expected generic signature for field1: " +
0N/A // Verify genericSignature() for a method 0N/A // There is only uno 0N/A failure(
"FAILED: Expected generic signature for method1: " +
0N/A // Verify this is not a bridge method 0N/A failure(
"FAILED: Expected gen1.method1 to not be a bridge" 0N/A +
" method but it is");
0N/A // Verify genericSignature for a local var 0N/A //jjh Uncomment when generics for local vars are available from 0N/A //jjh javac and hotspot. See: 0N/A //jjh 4914602 LVT entries for classfile version > 49 must be converted 0N/A //jjh if (!useOld && !expected.equals(genSig)) { 0N/A //jjh failure("FAILED: Expected generic signature for local var: " + 0N/A //jjh expected + ", received: " + genSig); 0N/A // Verify genericSignature() for a method2 0N/A // There is only uno 0N/A failure(
"FAILED: Expected generic signature for method2: " +
0N/A // Verify this is not a bridge method 0N/A failure(
"FAILED: Expected gen1.method2 to not be a bridge" 0N/A +
" method but it is");
0N/A // Verify genericSignature for a local var 0N/A failure(
"FAILED: Expected generic signature for local var: " +
0N/A * There should be two methods - the first is the 0N/A * method1 defined in Sub1, and the 2nd is a javac generated 0N/A failure(
"FAILED: Expected Sub1.method1 to be a bridge method" 0N/A // Verify genericSignature for a non generic class 0N/A failure(
"FAILED: Expected generic signature = null for " 0N/A // Verify genericSignature for a non generic field 0N/A failure(
"FAILED: Expected generic signature = null for " 0N/A // Verify genericSignature for a non generic method 0N/A failure(
"FAILED: Expected generic signature = null for " 0N/A * resume the target listening for events 0N/A * deal with results of test 0N/A * if anything has called failure("foo") testFailed will be true