--- old/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/PoolHelper.java 2018-09-19 14:25:13.000000000 -0700 +++ /dev/null 2018-09-19 14:25:13.000000000 -0700 @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jdk.experimental.bytecode; - -import java.util.function.Consumer; -import java.util.function.ToIntBiFunction; - -/** - * An interface for building and tracking constant pools. - * - * @param the type of the symbol representation - * @param the type of type descriptors representation - * @param the type of pool entries - */ -public interface PoolHelper { - int putClass(S symbol); - - int putFieldRef(S owner, CharSequence name, T type); - - int putMethodRef(S owner, CharSequence name, T type, boolean isInterface); - - int putUtf8(CharSequence s); - - int putInt(int i); - - int putFloat(float f); - - int putLong(long l); - - int putDouble(double d); - - int putString(String s); - - int putType(T t); - - int putMethodType(T t); - - int putHandle(int refKind, S owner, CharSequence name, T type); - - int putHandle(int refKind, S owner, CharSequence name, T type, boolean isInterface); - - int putInvokeDynamic(CharSequence invokedName, T invokedType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgs); - - int putDynamicConstant(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgs); - - int size(); - - E entries(); - - interface StaticArgListBuilder { - StaticArgListBuilder add(int i); - StaticArgListBuilder add(float f); - StaticArgListBuilder add(long l); - StaticArgListBuilder add(double d); - StaticArgListBuilder add(String s); - StaticArgListBuilder add(int refKind, S owner, CharSequence name, T type); - StaticArgListBuilder add(Z z, ToIntBiFunction, Z> poolFunc); - StaticArgListBuilder add(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgList); - } -} --- /dev/null 2018-09-19 14:25:13.000000000 -0700 +++ new/test/lib/bytecode/jdk/experimental/bytecode/PoolHelper.java 2018-09-19 14:25:13.000000000 -0700 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.experimental.bytecode; + +import java.util.function.Consumer; +import java.util.function.ToIntBiFunction; + +/** + * An interface for building and tracking constant pools. + * + * @param the type of the symbol representation + * @param the type of type descriptors representation + * @param the type of pool entries + */ +public interface PoolHelper { + int putClass(S symbol); + + int putFieldRef(S owner, CharSequence name, T type); + + int putMethodRef(S owner, CharSequence name, T type, boolean isInterface); + + int putUtf8(CharSequence s); + + int putInt(int i); + + int putFloat(float f); + + int putLong(long l); + + int putDouble(double d); + + int putString(String s); + + int putType(T t); + + int putMethodType(T t); + + int putHandle(int refKind, S owner, CharSequence name, T type); + + int putHandle(int refKind, S owner, CharSequence name, T type, boolean isInterface); + + int putInvokeDynamic(CharSequence invokedName, T invokedType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgs); + + int putDynamicConstant(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgs); + + int size(); + + E entries(); + + interface StaticArgListBuilder { + StaticArgListBuilder add(int i); + StaticArgListBuilder add(float f); + StaticArgListBuilder add(long l); + StaticArgListBuilder add(double d); + StaticArgListBuilder add(String s); + StaticArgListBuilder add(int refKind, S owner, CharSequence name, T type); + StaticArgListBuilder add(Z z, ToIntBiFunction, Z> poolFunc); + StaticArgListBuilder add(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer> staticArgList); + } +}