[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] PermissionInfoCollection issues with perms cloning

Hey guys, thanks for responding.

Forgive me for using the work "clone" (however, it really should be a clone in my mind, the base class should have implemented CloneableÂin addition toÂSerializable).

Essentially the PermissionInfoCollection.addPermissions method attempts to create a "copy" of the permission for the purpose adding to it's collection.

However, there is nowhere in the spec that states a permission impl must have either a 0, 1 or 2 String constructor.Â

The only requirements are:

- they extend from the base Permission class
  - thereby should be Serializable
- they be immutable.

So, the "reconstitution" if you will, using the 0, 1 or 2 String constructor is really just working on assumption and accidentally works because all of the implementations in standard java are just that simple.

I'm proposing a different "copy" mechanism that will work for any implementation based on the assumption that they respectÂSerializable as they must. I'm not quite sure what that looks like yet, but I have a few ideas.

However, before going that far, I'm trying to see if I can make a change in our code to avoid the need the change the equinox impl... but i'm struggling with this.

Sincerely,
- Ray


On Thu, Apr 18, 2013 at 8:02 AM, BJ Hargrave <hargrave@xxxxxxxxxx> wrote:
Can you please provide more detail on the issue? What do you mean by "cloning"?
--

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the
OSGi Alliance
hargrave@xxxxxxxxxx





From: Â Â Â ÂRaymond Auge <raymond.auge@xxxxxxxxxxx>
To: Â Â Â ÂEquinox development mailing list <equinox-dev@xxxxxxxxxxx>
Date: Â Â Â Â2013/04/17 18:23
Subject: Â Â Â Â[equinox-dev] PermissionInfoCollection issues with perms cloning
Sent by: Â Â Â Âequinox-dev-bounces@xxxxxxxxxxx




Hello All,

The current implementation ofÂPermissionInfoCollection uses a rather odd method of cloning permissions which breaks our implementation.

Would anyone object to a new cloning technique which relies purely on serialization (which is a required interface of permission impls)?

I'll provide an impl unless someone has a problem with changing the current mechanism.

Thoughts?

--
Raymond Augà Â|ÂSenior Software Architect |ÂLiferay, Inc.Â

---
24-25 October 2012 |ÂLiferayÂSpain SymposiumÂ|Âliferay.com/spain2012
16 November 2012 |ÂLiferayÂItaly SymposiumÂ|Âliferay.com/italy2012

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev




--
Raymond Augà Â|ÂSenior Software Architect |ÂLiferay, Inc.Â

---

24-25 October 2012 |ÂLiferayÂSpain SymposiumÂ|Âliferay.com/spain2012

16 November 2012 |ÂLiferayÂItaly SymposiumÂ|Âliferay.com/italy2012