Condition[] getConditions(Bundle bundle) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
Condition[] getConditions(Bundle bundle) {
	Condition[] getConditions(Bundle bundle) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {		Condition conditions[] = new Condition[conds.length];		for (int i = 0; i < conds.length; i++) {			/*			 * TODO: I think we can pre-get the Constructors in our own			 * constructor			 */			Class clazz;			try {				clazz = Class.forName(conds[i].getType());			} catch (ClassNotFoundException e) {				/* If the class isn't there, we fail */				return null;			}			Constructor constructor = null;			Method method = null;			int argCount = conds[i].getArgs().length;			if (argCount < condClassArray.length) {				try {					method = clazz.getMethod("getInstance", condClassArray[argCount]); //$NON-NLS-1$					if ((method.getModifiers() & Modifier.STATIC) == 0) {						method = null;					}				} catch (NoSuchMethodException e) {					// This is a normal case				}				if (method == null) {					constructor = clazz.getConstructor(condClassArray[argCount]);				}			} else {				Class clazzes[] = new Class[argCount + 1];				clazzes[0] = Bundle.class;				for (int j = 1; j <= argCount; j++) {					clazzes[j] = String.class;				}				try {					method = clazz.getMethod("getInstance", clazzes); //$NON-NLS-1$					if ((method.getModifiers() & Modifier.STATIC) == 0) {						method = null;					}				} catch (NoSuchMethodException e) {					// This is a normal case				}				if (method == null) {					constructor = clazz.getConstructor(clazzes);				}			}			String strArgs[] = conds[i].getArgs();			Object args[] = new Object[strArgs.length + 1];			args[0] = bundle;			System.arraycopy(strArgs, 0, args, 1, strArgs.length);			Condition condition = null;			if (method != null) {				condition = (Condition) method.invoke(null, args);			} else {				condition = (Condition) constructor.newInstance(args);			}			conditions[i] = condition;		}		return conditions;	}