A non blocking (almost) DynamicPermissionCollection

2011-12-18 Thread Peter Firmstone
Thoughts? /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Dan Creswell
What kind of thoughts are you after? Appropriateness, code review, something else? On 19 December 2011 05:59, Peter Firmstone wrote: > Thoughts? > > > /* > * Licensed to the Apache Software Foundation (ASF) under one > * or more contributor license agreements.  See the NOTICE file > * distribute

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Peter Firmstone
Anyone notice a problem yet? Even though a Permission probably could and should be immutable, there's an issue, some aren't. Going back to our favourite bad example of a Permission implementation, SocketPermission: SocketPermission mutates on implies calls. Now, most of the state required

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Peter Firmstone
Dan Creswell wrote: What kind of thoughts are you after? Appropriateness, code review, something else? Ideas. It would be nice to lock on each SocketPermission, however that isn't possible, it cannot be wrapped inside SocketPermissionCollection and the latter cannot be guaranteed to be u

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Gregg Wonderly
On 12/18/2011 11:59 PM, Peter Firmstone wrote: @Override public boolean implies(Permission permission) { if ( ! cl.isInstance(permission)) return false; Permission [] p = perms.toArray(new Permission[0]); //perms.size() may change I not sure why you are using an empty Permi

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Peter Firmstone
Gregg Wonderly wrote: On 12/18/2011 11:59 PM, Peter Firmstone wrote: @Override public boolean implies(Permission permission) { if ( ! cl.isInstance(permission)) return false; Permission [] p = perms.toArray(new Permission[0]); //perms.size() may change I not sure why you a

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-19 Thread Gregg Wonderly
On 12/19/2011 1:14 PM, Peter Firmstone wrote: Gregg Wonderly wrote: On 12/18/2011 11:59 PM, Peter Firmstone wrote: @Override public boolean implies(Permission permission) { if ( ! cl.isInstance(permission)) return false; Permission [] p = perms.toArray(new Permission[0]); //

Re: A non blocking (almost) DynamicPermissionCollection

2011-12-20 Thread Peter
Hmm, You're right, the code is more readable with a cast ;) A side effect of Generics being bolted on, hope they fix it some day. Peter. - Original message - > On 12/19/2011 1:14 PM, Peter Firmstone wrote: > > Gregg Wonderly wrote: > > > On 12/18/2011 11:59 PM, Peter Firmstone wrote: >