public void init()

in command-line-debugger/src/main/java/org/apache/ant/debugger/DebugCommandSet.java [35:78]


	public void init(Map commands) {
		if (commands != null)
			commandSupport.putAll(commands);
		Properties props = new Properties();
		try {
			InputStream is = Thread.currentThread().getContextClassLoader()
					.getResourceAsStream(
							"org/apache/ant/debugger/debug-support.properties");
			props.load(is);
			Enumeration en = props.keys();
			while (en.hasMoreElements()) {
				String key = (String) en.nextElement();
				String className = props.getProperty(key);
				Class commandClass;
				try {
					commandClass = Class.forName(className);
					Object command = commandClass.newInstance();
					if (command instanceof DebugSupport)
						commandSupport.put(key, command);
					else
						project
								.log(
										"Command Class: "
												+ className
												+ " does not implement DebugSupport. Ignoring.",
										Project.MSG_WARN);
				} catch (ClassNotFoundException e) {
					project.log("Could not find class: " + className,
							Project.MSG_WARN);
				} catch (InstantiationException e) {
					project.log("Could not instantiate class: " + className,
							Project.MSG_WARN);
				} catch (IllegalAccessException e) {
					project.log("Illegal Access while instantiating class: "
							+ className, Project.MSG_WARN);
				}
			}
		} catch (IOException ioe) {
			// if the resource could not be located, then initialize with what
			// is known
			throw new BuildException(
					"Could not locate debug-support.properties");
		}
	}