From: Seth P. <se...@us...> - 2004-05-14 18:46:40
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3314/com/sun/xacml/ctx Modified Files: RequestCtx.java ResponseCtx.java Status.java Subject.java Log Message: updated to make all incoming/outgoing collections copied and immutable Index: Subject.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx/Subject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Subject.java 17 Mar 2004 18:03:39 -0000 1.2 --- Subject.java 14 May 2004 18:46:23 -0000 1.3 *************** *** 47,50 **** --- 47,51 ---- import java.util.Collections; + import java.util.HashSet; import java.util.Set; *************** *** 121,125 **** this.category = category; ! this.attributes = Collections.unmodifiableSet(attributes); } --- 122,126 ---- this.category = category; ! this.attributes = Collections.unmodifiableSet(new HashSet(attributes)); } Index: RequestCtx.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx/RequestCtx.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RequestCtx.java 17 Mar 2004 18:03:39 -0000 1.7 --- RequestCtx.java 14 May 2004 18:46:23 -0000 1.8 *************** *** 51,54 **** --- 51,55 ---- import java.util.ArrayList; + import java.util.Collections; import java.util.HashSet; import java.util.Iterator; *************** *** 165,169 **** "well formed"); } ! this.subjects = new HashSet(subjects); // make sure resource is well formed --- 166,170 ---- "well formed"); } ! this.subjects = Collections.unmodifiableSet(new HashSet(subjects)); // make sure resource is well formed *************** *** 174,178 **** "well formed"); } ! this.resource = new HashSet(resource); // make sure action is well formed --- 175,179 ---- "well formed"); } ! this.resource = Collections.unmodifiableSet(new HashSet(resource)); // make sure action is well formed *************** *** 183,187 **** "well formed"); } ! this.action = new HashSet(action); // make sure environment is well formed --- 184,188 ---- "well formed"); } ! this.action = Collections.unmodifiableSet(new HashSet(action)); // make sure environment is well formed *************** *** 192,196 **** " well formed"); } ! this.environment = new HashSet(environment); this.documentRoot = documentRoot; --- 193,198 ---- " well formed"); } ! this.environment = ! Collections.unmodifiableSet(new HashSet(environment)); this.documentRoot = documentRoot; Index: ResponseCtx.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx/ResponseCtx.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ResponseCtx.java 17 Mar 2004 18:03:39 -0000 1.3 --- ResponseCtx.java 14 May 2004 18:46:23 -0000 1.4 *************** *** 45,48 **** --- 45,49 ---- import java.io.PrintStream; + import java.util.Collections; import java.util.HashSet; import java.util.Iterator; *************** *** 90,94 **** */ public ResponseCtx(Set results) { ! this.results = new HashSet(results); } --- 91,95 ---- */ public ResponseCtx(Set results) { ! this.results = Collections.unmodifiableSet(new HashSet(results)); } Index: Status.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx/Status.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Status.java 17 Mar 2004 18:03:39 -0000 1.3 --- Status.java 14 May 2004 18:46:23 -0000 1.4 *************** *** 46,49 **** --- 46,50 ---- import java.util.ArrayList; + import java.util.Collections; import java.util.Iterator; import java.util.List; *************** *** 165,169 **** } ! this.code = new ArrayList(code); this.message = message; this.detail = detail; --- 166,170 ---- } ! this.code = Collections.unmodifiableList(new ArrayList(code)); this.message = message; this.detail = detail; *************** *** 176,180 **** */ public List getCode() { ! return new ArrayList(code); } --- 177,181 ---- */ public List getCode() { ! return code; } |