if (authorNode == null) throw new Exception("'author' tag expected under 'commit'"); String author = authorNode.getFirstChild().getNodeValue();
String author = null; if (authorNode != null) { author = authorNode.getFirstChild().getNodeValue(); }
	public static CmdLineRemoteDirEntry[] createDirEntries(byte[] cmdLineResults) throws SVNClientException {		Collection logMessages = new ArrayList();				try {			// Create a builder factory			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();			factory.setValidating(false);    			// Create the builder and parse the file			InputSource source = new InputSource(new ByteArrayInputStream(cmdLineResults));			Document doc = factory.newDocumentBuilder().parse(source);						// This is the XML we need to parse			//<?xml version="1.0" encoding="utf-8"?>			//<lists>			//<list path=".">			//<entry kind="file">			//	<name>svnClientAdapter.jar</name>			//	<size>8199</size>			//	<commit revision="409">			//		<author>cchab</author>			//		<date>2004-01-31T16:44:06.761532Z</date>			//	</commit>			//</entry>			//</list>			//</lists>						NodeList nodes = doc.getElementsByTagName("entry");						for(int i = 0; i < nodes.getLength(); i++) {				Node logEntry = nodes.item(i);				String kindName = logEntry.getAttributes().getNamedItem("kind").getNodeValue();				Element nameNode = getFirstNamedElement(logEntry, "name");				if (nameNode == null) throw new Exception("'name' tag expected under 'entry'");				String name = nameNode.getFirstChild().getNodeValue();				long size = 0;				Element sizeNode = null;				if ("file".equals(kindName))				{					sizeNode = getNextNamedElement(nameNode, "size");					if (sizeNode == null) throw new Exception("'size' tag expected under 'entry'");					size = Long.parseLong(sizeNode.getFirstChild().getNodeValue());				}				else				{					sizeNode = nameNode; 				}				Element commitNode = getNextNamedElement(sizeNode, "commit");				if (commitNode == null) throw new Exception("'commit' tag expected under 'entry'");				Node revisionAttribute = commitNode.getAttributes().getNamedItem("revision");                SVNRevision.Number rev = Helper.toRevNum(revisionAttribute.getNodeValue());				Element authorNode = getFirstNamedElement(commitNode, "author");				if (authorNode == null) throw new Exception("'author' tag expected under 'commit'");				String author = authorNode.getFirstChild().getNodeValue();								Element dateNode = getNextNamedElement(authorNode, "date");				if (dateNode == null) throw new Exception("'date' tag expected under 'commit'");				Date date = Helper.convertXMLDate(dateNode.getFirstChild().getNodeValue());				SVNNodeKind kind = SVNNodeKind.UNKNOWN;				if ("file".equals(kindName))				{					kind = SVNNodeKind.FILE;									}				else if ("dir".equals(kindName))				{					kind = SVNNodeKind.DIR;				}				CmdLineRemoteDirEntry entry = new CmdLineRemoteDirEntry(name, rev, size, author, date, kind);				logMessages.add(entry);						}		} catch (Exception e) {			throw new SVNClientException(e);		} 				return (CmdLineRemoteDirEntry[]) logMessages.toArray(new CmdLineRemoteDirEntry[logMessages.size()]);				}