For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

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

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