String args[] = new String[2]; args[0] = perms[i].getName(); args[1] = perms[i].getActions();
String args[] = new String[numArgs]; if (numArgs > 0) args[0] = perms[i].getName(); if (numArgs > 1) args[1] = perms[i].getActions();
	int addPermissions(AbstractBundle bundle, PermissionCollection collection, Class permClass) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {		String permClassName = permClass.getName();		Constructor constructor = permClass.getConstructor(twoStringClassArray);		int count = 0;		/*		 * TODO: We need to cache the constructed permissions to enhance		 * performance.		 */		for (int i = 0; i < perms.length; i++) {			if (perms[i].getType().equals(permClassName)) {				count++;				String args[] = new String[2];				args[0] = perms[i].getName();				args[1] = perms[i].getActions();				if (perms[i].getType().equals("java.io.FilePermission")) { //$NON-NLS-1$					// map FilePermissions for relative names to the bundle's data area					if (!args[0].equals("<<ALL FILES>>")) { //$NON-NLS-1$						File file = new File(args[0]);						if (!file.isAbsolute()) { // relative name							if (bundle == null) // default permissions								continue; // no relative file permissions							File target = bundle.framework.getDataFile(bundle, args[0]);							if (target == null) // no bundle data file area								continue; // no relative file permissions							args[0] = target.getPath();						}					}				}				collection.add((Permission) constructor.newInstance(args));			}		}		return count;	}