From: SourceForge.net <no...@so...> - 2008-07-25 23:16:20
|
Bugs item #2028321, was opened at 2008-07-25 23:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=2028321&group_id=209147 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: parseAcl method has a bug Initial Comment: code for finding colons is incorrect. It gets the same colon twice and then considers it a wrong parse private static ArrayList<ACL> parseACLs(String aclString) { ArrayList<ACL> acl; String acls[] = aclString.split(","); acl = new ArrayList<ACL>(); for (String a : acls) { int firstColon = a.indexOf(':'); int lastColon = a.indexOf(':'); if (firstColon == -1 || lastColon == -1 || firstColon == lastColon) { //HERE**** <- first and last colon indexes are always the same**** System.err .println(a + " does not have the form scheme:id:perm"); continue; } ACL newAcl = new ACL(); newAcl.setId(new Id(a.substring(0, firstColon), a.substring( firstColon + 1, lastColon))); newAcl.setPerms(getPermFromString(a.substring(lastColon + 1))); acl.add(newAcl); } return acl; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=2028321&group_id=209147 |