Ensure meta models are completely immutable

Description

The internal meta model (BeanMetaDataImpl et al.) as well as the external one (BeanDescriptorImpl et al.) should be completely unmodifiable, as they could potentially be accessed from multiple threads at the same time.

I made some more fields final/unmodifiable with HV-371, but there are some places left which I couldn't change easily and need some more consideration:

  • ConstraintDescriptorImpl#compositionType

  • ElementDescriptorImpl#constraintDescriptors

  • BeanMetaDatImpl#cascadedMembers (could be made unmodifiable after initialization instead of creating a new unmodifiable set with each call of getCascadedMembers()

When looking through the model I found it quite complex to find out which collection fields are already unmodifiable and which not. I therefore thought about introducing a marker annotation @Unmodifiable which could be used to document unmodifiable fields. WDYT?

Environment

None

Activity

Show:

Guillaume Smet October 25, 2017 at 12:50 PM

Looks like all the elements mentioned are immutable in 6. I think we have made quite good progress in making the model immutable.

Closing this one as out of date. Let's open specific issues if we find areas we could improve.

Guillaume Smet October 19, 2017 at 9:46 PM

I think we already improved the situation a lot in HV 6 but let's check that what Hardy mentioned has been taken care of.

Hardy Ferentschik April 19, 2011 at 11:04 PM

Moving the issue post 4.2

Gunnar Morling April 19, 2011 at 11:00 PM

I think we can defer this to post 4.2. The chance that this really causes a problem seems really low (basically the meta-data for a given type would have to be built up in parallel by multiple threads in order to potentially cause issues). I guess it makes sense to address that together with the general meta-model refactoring.

Hardy Ferentschik April 19, 2011 at 10:43 PM

Do we need this for this release? Or can we defer this?

Out of Date

Details

Assignee

Reporter

Participants

Guillaume Smet
Gunnar Morling
Hardy Ferentschik

Components

Priority

Created March 5, 2011 at 1:58 PM
Updated October 25, 2017 at 12:50 PM
Resolved October 25, 2017 at 12:50 PM

Flag notifications