Hi,

The code

WildcardPermission p1 = new WildcardPermission("File:r,w,x:myfile") ;
System.out.println(p1.toString()) ;

prints out [file]:[r, w, x]:[myfile]

I was expecting File:r,w,x:myfile which is the String I passed in the
construction.

Is this by design or is this just a bug ?

I feel toString should return the String passed in via the constructor
or by calling setParts.

toString needs to return parts in the same format that
WildCardPermission expects which is

part:part:part.....

where each part could be subpart,subpart,subpart

The brackets are being printed because the implementation does

buffer.append(part);

where part is a Set.

The current implementation is a problem if I call toString and then
persist the permission as a String to
the a database. Each part will have a bracket around it.

Let me know if I should open a JIRA.

Manoj



-- 
http://khangaonkar.blogspot.com/

Reply via email to