Make the SchemaElement's connections immutable.
495001
def freeze(self):
        """"""
        self.in_connections = frozenset(self.in_connections)
        self.out_connections = frozenset(self.out_connections)
1311076
private static void copyProperties(Schema oldSchema, Schema newSchema) {
    Preconditions.checkNotNull(oldSchema);
    Preconditions.checkNotNull(newSchema);

    Map<String, JsonNode> props = oldSchema.getJsonProps();
    copyProperties(props, newSchema);
  }
1334272
public void setSchemaArns(java.util.Collection<String> schemaArns) {
        if (schemaArns == null) {
            this.schemaArns = null;
            return;
        }

        this.schemaArns = new java.util.ArrayList<String>(schemaArns);
    }
767276
protected void updatePropertiesInternal(Iterable<Property> properties, Iterable<PropertyRemoveMutation> propertyRemoves) {
        if (propertyRemoves != null) {
            this.propertyRemoveMutations = new ConcurrentSkipListSet<>();
            for (PropertyRemoveMutation propertyRemoveMutation : propertyRemoves) {
                removePropertyInternal(
                        propertyRemoveMutation.getKey(),
                        propertyRemoveMutation.getName(),
                        propertyRemoveMutation.getVisibility()
                );
                this.propertyRemoveMutations.add(propertyRemoveMutation);
            }
        }

        for (Property property : properties) {
            if (property.getKey() == null) {
                throw new IllegalArgumentException("key is required for property");
            }
            Object propertyValue = property.getValue();
            if (propertyValue instanceof PropertyValue && !((PropertyValue) propertyValue).isStore()) {
                continue;
            }
            Property existingProperty = getProperty(property.getKey(), property.getName(), property.getVisibility());
            if (existingProperty == null) {
                this.properties.add(property);
            } else {
                if (existingProperty instanceof MutableProperty) {
                    ((MutableProperty) existingProperty).update(property);
                } else {
                    throw new SecureGraphException("Could not update property of type: " + existingProperty.getClass().getName());
                }
            }
        }
    }
353803
def immutable_task(task, state, pre_state, created):
    """"""
    # noinspection PyUnresolvedReferences,PyProtectedMember
    return TaskData._make(chain(
        (getattr(task, f) for f in TASK_OWN_FIELDS),
        (state, pre_state, created),
    ))
531630
function (propertyName) {
    if (this.isObjectBased) {
      if (!(propertyName in this.attrValue)) { return; }
      delete this.attrValue[propertyName];
      this.data[propertyName] = this.schema[propertyName].default;
    } else {
      this.attrValue = this.schema.default;
      this.data = this.schema.default;
    }
    this.updateProperties(this.attrValue);
  }
393329
def to_immutable(self):
        """"""
        if self._enumeration is None:
            self._get_mutable_enumeration()
        col_obj = self._enumeration['immutable'][self._collection_type]
        return col_obj(self.header, self.values)
1085461
def SetProperties(has_props_cls, input_dict, include_immutable=True):
    """"""
    props = has_props_cls()
    if not isinstance(input_dict, (dict, collections.OrderedDict)):
        raise RuntimeError('input_dict invalid: ', input_dict)
    for k, v in iter(input_dict.items()):
        if (k in has_props_cls._props and (
                include_immutable or
                any(hasattr(has_props_cls._props[k], att) for att in ('required', 'new_name'))
                )
           ):
            p = props._props.get(k)
            if isinstance(p, properties.HasProperties):
                props._set(k, SetProperties(p, v, include_immutable=include_immutable))
            elif isinstance(p, properties.Instance):
                props._set(k, SetProperties(p.instance_class, v, include_immutable=include_immutable))
            elif isinstance(p, properties.List):
                if not isinstance(v, list):
                    raise RuntimeError('property value mismatch', p, v)
                if not isinstance(v[0], properties.HasProperties):
                    prop = p.prop.instance_class
                    newlist = []
                    for i in v:
                        value = SetProperties(prop, i, include_immutable=include_immutable)
                        newlist.append(value)
                    props._set(k, newlist)
                else:
                    props._set(k, v)
            else:
                props._set(k, p.from_json(v))

    # Return others as well
    # others_dict = {k: v for k, v in iter(input_dict.items())
    #                if k not in has_props_cls._props}
    return props
405839
private void setSchemaOnConnection(Connection connection) throws SQLException {
		logger.finest("Entering " + CLASSNAME +".setSchemaOnConnection()");

		String dbProductName = connection.getMetaData().getDatabaseProductName();
		if (!"Oracle".equals(dbProductName) && !"Microsoft SQL Server".equals(dbProductName)) {
			PreparedStatement ps = null;
			if ("MySQL".equals(dbProductName)) {
				ps = connection.prepareStatement("USE " + schema);
			} else {
				ps = connection.prepareStatement("SET SCHEMA ?");
				ps.setString(1, schema);
			}
			ps.executeUpdate(); 
			ps.close();
		}

		logger.finest("Exiting " + CLASSNAME +".setSchemaOnConnection()");
	}
1371229
static ImmutableSet<ExecutableElement> propertyMethodsIn(Set<ExecutableElement> abstractMethods) {
    ImmutableSet.Builder<ExecutableElement> properties = ImmutableSet.builder();
    for (ExecutableElement method : abstractMethods) {
      if (method.getParameters().isEmpty()
          && method.getReturnType().getKind() != TypeKind.VOID
          && objectMethodToOverride(method) == ObjectMethod.NONE) {
        properties.add(method);
      }
    }
    return properties.build();
  }
380630
public void setSchemas(java.util.Collection<String> schemas) {
        if (schemas == null) {
            this.schemas = null;
            return;
        }

        this.schemas = new java.util.ArrayList<String>(schemas);
    }
405594
function makeImmutableObject(obj) {
    if (!globalConfig.use_static) {
      addPropertyTo(obj, "merge", merge);
      addPropertyTo(obj, "replace", objectReplace);
      addPropertyTo(obj, "without", without);
      addPropertyTo(obj, "asMutable", asMutableObject);
      addPropertyTo(obj, "set", objectSet);
      addPropertyTo(obj, "setIn", objectSetIn);
      addPropertyTo(obj, "update", update);
      addPropertyTo(obj, "updateIn", updateIn);
      addPropertyTo(obj, "getIn", getIn);
    }

    return makeImmutable(obj, mutatingObjectMethods);
  }
956958
private <T> List<T> immutableAdd(List<T> list, T element) {
      List<T> result = new ArrayList<T>(list);
      result.add(element);
      return Collections.unmodifiableList(result);
   }
120149
def coerce(cls, key, value):
        """"""
        if not isinstance(value, MutationList):
            if isinstance(value, list):
                return MutationList(value)

            # this call will raise ValueError
            return Mutable.coerce(key, value)
        else:
            return value
424847
public void makeImmutable() {
    if (!isImmutable) {
      // Note: There's no need to wrap the entryList in an unmodifiableList
      // because none of the list's accessors are exposed. The iterator() of
      // overflowEntries, on the other hand, is exposed so it must be made
      // unmodifiable.
      overflowEntries = overflowEntries.isEmpty() ?
          Collections.<K, V>emptyMap() :
          Collections.unmodifiableMap(overflowEntries);
      isImmutable = true;
    }
  }
920646
private void removeOrTransformHasContainers(final SchemaTableTree schemaTableTree) {
        Set<HasContainer> toRemove = new HashSet<>();
        Set<HasContainer> toAdd = new HashSet<>();
        for (HasContainer hasContainer : schemaTableTree.hasContainers) {
            if (hasContainer.getKey().equals(label.getAccessor())) {
                toRemove.add(hasContainer);
            }

            if (Existence.NULL.equals(hasContainer.getBiPredicate())) {
                // we checked that a non existing property was null, that's fine
                if (!this.getFilteredAllTables().get(schemaTableTree.getSchemaTable().toString()).containsKey(hasContainer.getKey())) {
                    toRemove.add(hasContainer);
                }
            }
            if (Contains.without.equals(hasContainer.getBiPredicate())) {
                Object o = hasContainer.getValue();
                if (o instanceof Collection && ((Collection<?>) o).size() == 0) {
                    //P.without(Collections.emptySet()) translates to the sql IS NOT NULL
                    toRemove.add(hasContainer);
                    toAdd.add(new HasContainer(hasContainer.getKey(), new P<>(Existence.NOTNULL, null)));
                }
            }
        }
        schemaTableTree.hasContainers.removeAll(toRemove);
        schemaTableTree.hasContainers.addAll(toAdd);
    }
866658
function (keys, preserveElems) {
            var i = 0;
            var len = keys ? keys.length : 0;
            for (i; i < len; i++) {
                this.remove(keys[i], preserveElems);
            }
            return this;
        }