// BIFs must take EObject as arguments, not more specific
// types. They should also be public static, so that calls to
// it can be embedded directly in compiled code.
// test argument types
EAtom aname = name.testAtom();
ESeq opts = options.testSeq();
if (aname == null || opts == null) {
// make sure to pass the original arguments to badarg, not
// the converted ones. Java 'null' values are never allowed
// in the erjang world except as a return value from type tests
// and other guard BIFs.
throw ERT.badarg(name, options);
}
// default configuration
EAtom type = am_set;
EAtom access = am_protected;
int keypos = 1;
boolean write_concurrency = false;
boolean read_concurrency = false;
EInternalPID heir_pid = null;
EObject heir_data = null;
boolean is_named = false;
for (; !opts.isNil(); opts = opts.tail()) {
EObject option = opts.head();
EAtom atom;
ETuple2 t2;
ETuple3 t3;
if ((atom = option.testAtom()) != null) {
if (atom == am_bag || atom == am_duplicate_bag
|| atom == am_set || atom == am_ordered_set) {