A project's name attribute is required according to repo's
doc/manifest-format.txt:
<!ELEMENT project (annotation*,
project*)>
<!ATTLIST project name CDATA #REQUIRED>
Enforcing this in code makes reading easier (in particular making it
clearer that getName() and getPath() can never return null).
Change-Id: I8c7014dd6042183d7fecb2202af5acdc384aa8e4
Signed-off-by: Jonathan Nieder <jrn@google.com>
String qName,
Attributes attributes) throws SAXException {
if ("project".equals(qName)) { //$NON-NLS-1$
+ if (attributes.getValue("name") == null) { //$NON-NLS-1$
+ throw new SAXException(RepoText.get().invalidManifest);
+ }
currentProject = new RepoProject(
attributes.getValue("name"), //$NON-NLS-1$
attributes.getValue("path"), //$NON-NLS-1$
*/
public RepoProject(String name, String path, String revision,
String remote, String groups) {
+ if (name == null) {
+ throw new NullPointerException();
+ }
this.name = name;
if (path != null)
this.path = path;