View | Details | Raw Unified | Return to bug 40150
Collapse All | Expand All

(-)file_not_specified_in_diff (-42 / +32 lines)
Lines 22-24 Link Here
22
import java.util.ArrayList;
22
import java.util.*;
23
import java.util.Iterator;
24
import java.util.List;
25
--
Lines 252-268 Link Here
252
        roleClasses.clear();
250
         parseClassNames(roleClassNames, roleClasses);
253
        String temp = this.roleClassNames;
254
        if (temp == null) {
255
            return;
256
        }
257
        while (true) {
258
            int comma = temp.indexOf(',');
259
            if (comma < 0) {
260
                break;
261
            }
262
            roleClasses.add(temp.substring(0, comma).trim());
263
            temp = temp.substring(comma + 1);
264
        }
265
        temp = temp.trim();
266
        if (temp.length() > 0) {
267
            roleClasses.add(temp);
268
        }
269
--
Line 271 Link Here
271
253
     /**
272
--
254
      * Parses a comma-delimited list of class names, and store the class names
255
      * in the provided List. Each class must implement <code>java.security.Principal</code>.
256
      * 
257
      * @param classNamesString a comma-delimited list of fully qualified class names.
258
      * @param classNamesList the list in which the class names will be stored.
259
      *        The list is cleared before being populated. 
260
      */
261
     protected void parseClassNames(String classNamesString, List classNamesList) {
262
    	 classNamesList.clear();
263
         if (classNamesString == null) return;
264
         
265
         String[] classNames = classNamesString.split("[ ]*,[ ]*");
266
         for (int i=0; i<classNames.length; i++) {
267
        	 if (classNames[i].length()==0) continue;        	
268
        	 try {
269
  				Class principalClass = Class.forName(classNames[i]);	
270
  				if (Principal.class.isAssignableFrom(principalClass)) {
271
  					classNamesList.add(classNames[i]);					
272
  				} else {
273
  					log.error("Class "+classNames[i]+" is not implementing "+
274
  							"java.security.Principal! Class not added.");
275
  				}				
276
  			} catch (ClassNotFoundException e) {
277
  				log.error("Class "+classNames[i]+" not found! Class not added.");
278
  			}
279
         }
280
     }
281
     
Lines 292-308 Link Here
292
        userClasses.clear();
302
        parseClassNames(userClassNames, userClasses);
293
        String temp = this.userClassNames;
294
        if (temp == null) {
295
            return;
296
        }
297
        while (true) {
298
            int comma = temp.indexOf(',');
299
            if (comma < 0) {
300
                break;
301
            }
302
            userClasses.add(temp.substring(0, comma).trim());
303
            temp = temp.substring(comma + 1);
304
        }
305
        temp = temp.trim();
306
        if (temp.length() > 0) {
307
            userClasses.add(temp);
308
        }
309
--

Return to bug 40150