[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: AbstractCollectionMetaData fails with optional add() ope

adrian@jboss.org do-not-reply at jboss.com
Wed Jul 4 09:48:08 EDT 2007


"juha at jboss.org" wrote : "adrian at jboss.org" wrote : There's no way to check whether a collections is modifiable or otherwise.
  |   | 
  | 
  | True. You could address the scenario by catching the UnsupportedOperationException on Collection.add() and falling back to a default mechanism.
  | 
  | It's not a complete solution but depending on how common you think the use case is, would address it without extra burden of configuration on user's part. 

It doesn't quite work the way you describe.
The collection is first instantiated and then the values added.

We could hack it like you describe, but it wouldn't be very clean.
Maybe it is worth the ugliness for the ease of use? :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060483#4060483

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060483



More information about the jboss-dev-forums mailing list