# disallowChanges

@Incubating
open fun disallowChanges()

Disallows further structural modifications to this collection.

After this method is called, any attempt to add or remove elements — including via add, addLater, addAllLater, remove, clear, etc. — will throw IllegalStateException.

This method does not force the realization of any pending (lazy) elements. Pending elements registered via addLater or register remain lazy; they will still be realized when first accessed. This method only prevents new elements from being added or existing elements from being removed.

Calling this method more than once has no effect.

#### Since

9.5.0

#### Throws

java.lang.IllegalStateException

if called from within a lazy configuration action (e.g., inside a configureEach callback)