/** * {@inheritDoc} */ @Override public synchronized void attemptFreeze(BVM.FreezeStatus freezeStatus) { if (this.type.getTag() == TypeTags.OBJECT_TYPE_TAG) { throw new BLangFreezeException("'freeze()' not allowed on '" + getType() + "'"); } if (isOpenForFreeze(this.freezeStatus, freezeStatus)) { this.freezeStatus = freezeStatus; map.values().forEach(val -> { if (val != null) { val.attemptFreeze(freezeStatus); } }); } }