try { String bundleStr= (String)v.elementAt(i); bundle = new String[] { null, null}; int ix = bundleStr.indexOf(";"); try { bundle[0] = bundleStr.substring(0, ix).trim(); bundle[1] = bundleStr.substring(ix + 1).trim(); } catch (Exception e) { throw new IllegalArgumentException("Bundle entries must be in the format location;level"); } }catch(ClassCastException cce){ throw new IllegalArgumentException ("Wrong type supplied when attempting to set log level for " + "specific bundle." + " Correct type to use is String."); } if(bundle==null){ throw new IllegalArgumentException ("Empty configuration supplied when attempting to set log level "+ " for specific bundle."); } bundle[LOCATION_POS]= bundle[LOCATION_POS].trim(); if(bundle[LOCATION_POS] == null || bundle[LOCATION_POS].length() <= 0){ throw new IllegalArgumentException ("No bundle location given when setting log level for specific " + "bundle."); } if(bundle[FILTER_POS] == null){ throw new IllegalArgumentException("No log level given for bundle: " + bundle[LOCATION_POS] + ". " + "Please supply a valid log level."); } int testFilter=0; testFilter=LogUtil.toLevel((((String)bundle[FILTER_POS]).trim()), -1); if(testFilter == -1){ throw new ConfigurationException(BL_FILTERS, "Undefined log level <" + bundle[FILTER_POS] + "> specified for bundle <" + bundle[LOCATION_POS] + ">."); } if(testFilter==0){ v.removeElementAt(i); i--; } else{ bundle[FILTER_POS]= LogUtil.fromLevel(testFilter); checkLocation(bundle[LOCATION_POS]); }
try { bundle = getBL(v.elementAt(i)); }catch(ClassCastException cce){ throw new IllegalArgumentException ("Wrong type supplied when attempting to set log level for " + "specific bundle." + " Correct type to use is String."); } if(bundle==null){ throw new IllegalArgumentException ("Empty configuration supplied when attempting to set log level "+ " for specific bundle."); } bundle[LOCATION_POS]= bundle[LOCATION_POS].trim(); if(bundle[LOCATION_POS] == null || bundle[LOCATION_POS].length() <= 0){ throw new IllegalArgumentException ("No bundle location given when setting log level for specific " + "bundle."); } if(bundle[FILTER_POS] == null){ throw new IllegalArgumentException("No log level given for bundle: " + bundle[LOCATION_POS] + ". " + "Please supply a valid log level."); } int testFilter=0; testFilter=LogUtil.toLevel((((String)bundle[FILTER_POS]).trim()), -1); if(testFilter == -1){ throw new ConfigurationException(BL_FILTERS, "Undefined log level <" + bundle[FILTER_POS] + "> specified for bundle <" + bundle[LOCATION_POS] + ">."); } if(testFilter==0){ v.removeElementAt(i); i--; } else{ bundle[FILTER_POS]= LogUtil.fromLevel(testFilter); checkLocation(bundle[LOCATION_POS]); }
  private void checkBundleLogLevel(Dictionary cfg)    throws ConfigurationException, IllegalArgumentException{	    Vector v = null;    try {      v = (Vector)cfg.get(BL_FILTERS);    } catch(ClassCastException cce) {      throw new IllegalArgumentException	("Wrong type supplied when attempting to set log level for " +	 "specific bundle." +	 " Correct type to use is Vector of String[].");    }    if (v != null) {      String[] bundle=null;      for(int i= 0 ; i < v.size() ; i++) {	try {	  String bundleStr= (String)v.elementAt(i);	  bundle = new String[] { null, null};	  int ix = bundleStr.indexOf(";");	  try {	    bundle[0] = bundleStr.substring(0, ix).trim();	    bundle[1] = bundleStr.substring(ix + 1).trim();	  } catch (Exception e) {	    throw new IllegalArgumentException("Bundle entries must be in the format location;level");	  }	}catch(ClassCastException cce){	  throw new IllegalArgumentException	    ("Wrong type supplied when attempting to set log level for " +	     "specific bundle." + 	     " Correct type to use is String.");	}	if(bundle==null){	  throw new IllegalArgumentException	    ("Empty configuration supplied when attempting to set log level "+	     " for specific bundle.");	}	bundle[LOCATION_POS]= bundle[LOCATION_POS].trim();	if(bundle[LOCATION_POS] == null || bundle[LOCATION_POS].length() <= 0){	  throw new IllegalArgumentException	    ("No bundle location given when setting log level for specific " +	     "bundle.");	}	if(bundle[FILTER_POS] == null){	  throw new IllegalArgumentException("No log level given for bundle: " 					     + bundle[LOCATION_POS] + ". " +					     "Please supply a valid log level.");	}		int testFilter=0;	testFilter=LogUtil.toLevel((((String)bundle[FILTER_POS]).trim()), -1);	if(testFilter == -1){	  throw new ConfigurationException(BL_FILTERS, 					   "Undefined log level <" 					   + bundle[FILTER_POS] + 					   "> specified for bundle <"  					   + bundle[LOCATION_POS] + ">.");	} 	if(testFilter==0){ 	  v.removeElementAt(i); i--;	}	else{	  bundle[FILTER_POS]= LogUtil.fromLevel(testFilter);  	  checkLocation(bundle[LOCATION_POS]);	}      }    }  }