3412N/A * Copyright (c) 2009, 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 2362N/A * published by the Free Software Foundation. 2362N/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. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary ClassReader does not read parameter names correctly 0N/A // The following enums control the generation of the test methods to be compiled. 0N/A /** Declare methods inside the outermost container. */ 0N/A /** Declare methods inside a container with a 'static' modifier. */ 0N/A /** Declare methods inside a container without a 'static' modifier. */ 0N/A /** Declare methods inside a local class in an initializer. */ 0N/A /** Declare methods inside an anonymous class in an initializer. */ 0N/A /** Declare methods inside a local class in a method. */ 0N/A /** Declare methods inside an anonymous class in a method. */ 0N/A /** Method body does not reference external final variables. */ 0N/A /** Method body references external final variables. */ 0N/A * Create a file containing lots of method definitions to be tested. 3412N/A * There are 3 sets of nested loops that generate the methods. 0N/A * 1. The outermost set declares [generic] (class | interface | enum) 0N/A * 2. The middle set declares [(nested | inner | anon | local)] class 0N/A * 3. The innermost set declares 0N/A * [generic] (constructor|method|static-method|bridge-method) [using final variables in outer scope] 0N/A * Invalid combinations are filtered out. 0N/A // This interface is used to force bridge methods to be generated, by 0N/A // implementing its methods with subtypes of Object 0N/A // Outermost set of loops, to generate a top level container 0N/A // Middle set of loops, to generate an optional nested container 0N/A // if the nested kind is none, there is no point iterating over all 0N/A // nested generic kinds, so arbitarily limit it to just one kind 0N/A // if the nested kind is none, there is no point iterating over all 0N/A // nested class kinds, so arbitarily limit it to just one kind 0N/A default: {
// INNER, NESTED, LOCAL 0N/A // Innermost loops, to generate methods 0N/A// out.write("// " + outerGenericKind 0N/A// + " " + outerClassKind 0N/A// + " " + nestedKind 0N/A// + " " + nestedGenericKind 0N/A// + " " + nestedClassKind 0N/A// + " " + methodGenericKind 0N/A// + " " + methodKind 0N/A // add a dummy parameter to avoid duplicate declaration out.
write(
", int i3) { int i = fi1; }\n");
// methods Base.base_m1 and Base.base_m2 are declared for the // benefit of bridge methods. They need to be implemented // whether or not a final variable is used. //System.err.println("verify: " + m.params()); // interfaces don't have saved names // -- no Code attribute for the LocalVariableTable attribute // abstract methods don't have saved names // -- no Code attribute for the LocalVariableTable attribute // The rest of this method assumes the local conventions in the test program //File testSrc = new File(System.getProperty("test.src"), "."); //args.add(new File(testSrc, "Test.java").getPath()); throw new Exception(
"compilation failed unexpectedly");