ArrayList devicesList = new ArrayList();
	private void loadDevices( VendorManager vendManager, DeviceGroupManager grManager, LibraryManager libManager, InputStream devicesIS ) 	throws JDOMException, IOException, InvalidComponentException 	{		if (devicesIS == null) {			throw new BuildException("Unable to load devices.xml, no file found.");		}		SAXBuilder builder = new SAXBuilder( false );		Document document = builder.build( devicesIS );		ArrayList devicesList = new ArrayList();		HashMap devicesMap = this.devicesByIdentifier;		List xmlList = document.getRootElement().getChildren();		for (Iterator iter = xmlList.iterator(); iter.hasNext();) {			Element definition = (Element) iter.next();			String identifierStr = definition.getChildTextTrim( "identifier");			if (identifierStr == null) {				throw new InvalidComponentException("Unable to initialise device. Every device needs to define either its [identifier] or its [name] and [vendor]. Check your [devices.xml].");			}			// one xml definition can contain several device-definitions,			// e.g. <identifier>Nokia/3650, Nokia/5550</identifier>			String[] identifiers = StringUtil.splitAndTrim(identifierStr,',');			for (int i = 0; i < identifiers.length; i++) {				String identifier = identifiers[i];				if (devicesMap.get( identifier ) != null) {					throw new InvalidComponentException("The device [" + identifier + "] has been defined twice in [devices.xml]. Please remove one of those definitions.");				}				String[] chunks = StringUtil.split( identifier, '/');				if (chunks.length != 2) {					throw new InvalidComponentException("The device [" + identifier + "] has an invalid [identifier] - every identifier needs to consists of the vendor and the name, e.g. \"Nokia/6600\". Please check you [devices.xml].");				}				String vendorName = chunks[0];				String deviceName = chunks[1];				Vendor vendor = vendManager.getVendor( vendorName );				if (vendor == null) {					throw new InvalidComponentException("Invalid device-specification in [devices.xml]: Please specify the vendor [" + vendorName + "] in the file [vendors.xml].");				}				Device device = new Device( definition, identifier, deviceName, vendor, grManager, libManager, this );				devicesMap.put( identifier, device );				devicesList.add( device );			}		}		this.devices = (Device[]) devicesList.toArray( new Device[ devicesList.size()]);	}