/** * Sets the item at the given index. * * @param n {@code >= 0, < size();} which element * @param declaringClass {@code non-null;} the class declaring bootstrap method. * @param bootstrapMethodHandle {@code non-null;} the bootstrap method handle * @param arguments {@code non-null;} the arguments of the bootstrap method */ public void set(int n, CstType declaringClass, CstMethodHandle bootstrapMethodHandle, BootstrapMethodArgumentsList arguments) { set(n, new Item(declaringClass, bootstrapMethodHandle, arguments)); }
methods.set(methodIndex, declaringClass, (CstMethodHandle) cstMethodRef, arguments);
/** * Returns an instance which is the concatenation of the two given * instances. * * @param list1 {@code non-null;} first instance * @param list2 {@code non-null;} second instance * @return {@code non-null;} combined instance */ public static BootstrapMethodsList concat(BootstrapMethodsList list1, BootstrapMethodsList list2) { if (list1 == EMPTY) { return list2; } else if (list2 == EMPTY) { return list1; } int sz1 = list1.size(); int sz2 = list2.size(); BootstrapMethodsList result = new BootstrapMethodsList(sz1 + sz2); for (int i = 0; i < sz1; i++) { result.set(i, list1.get(i)); } for (int i = 0; i < sz2; i++) { result.set(sz1 + i, list2.get(i)); } return result; }