}  String uniqueId = attributes.getValue("uid"); if (uniqueId != null) { bugInstance.setUniqueId(uniqueId);
	public void startElement(String uri, String name, String qName, Attributes attributes)		throws SAXException {		// URI should always be empty.		// So, qName is the name of the element.		if (!elementStack.isEmpty()) {			String outerElement = elementStack.get(elementStack.size() - 1);			if (outerElement.equals("BugCollection")) {				// Parsing a top-level element of the BugCollection				if (qName.equals("Project")) {					// Project element					String filename = attributes.getValue("filename");					if (filename != null)						project.setProjectFileName(filename);				} else if (qName.equals("BugInstance")) {					// BugInstance element - get required type and priority attributes					String type = getRequiredAttribute(attributes, "type", qName);					String priority = getRequiredAttribute(attributes, "priority", qName);					try {						int prio = Integer.parseInt(priority);						bugInstance = new BugInstance(type, prio);					} catch (NumberFormatException e) {						throw new SAXException("BugInstance with invalid priority value \"" +							priority + "\"", e);					}				}			} else if (outerElement.equals("BugInstance")) {				// Parsing an attribute or property of a BugInstance				BugAnnotation bugAnnotation = null;				if (qName.equals("Class")) {					String className = getRequiredAttribute(attributes, "classname", qName);					bugAnnotation = new ClassAnnotation(className);				} else if (qName.equals("Method") || qName.equals("Field")) {					String classname = getRequiredAttribute(attributes, "classname", qName);					String fieldOrMethodName = getRequiredAttribute(attributes, "name", qName);					String signature = getRequiredAttribute(attributes, "signature", qName);					if (qName.equals("Method")) {						// Save in field in case of nested SourceLine elements.						methodAnnotation =							new MethodAnnotation(classname, fieldOrMethodName, signature);						bugAnnotation = methodAnnotation;					} else {						String isStatic = getRequiredAttribute(attributes, "isStatic", qName);						bugAnnotation = new FieldAnnotation(classname, fieldOrMethodName, signature,							Boolean.valueOf(isStatic).booleanValue());					}				} else if (qName.equals("SourceLine")) {					bugAnnotation = createSourceLineAnnotation(qName, attributes);				} else if (qName.equals("Int")) {					try {						String value = getRequiredAttribute(attributes, "value", qName);						String role = attributes.getValue("role");						bugAnnotation = new IntAnnotation(Integer.parseInt(value));						if (role != null)							bugAnnotation.setDescription(role);					} catch (NumberFormatException e) {						throw new SAXException("Bad integer value in Int");					}				} else if (qName.equals("Property")) {					// A BugProperty.					String propName = getRequiredAttribute(attributes, "name", qName);					String propValue = getRequiredAttribute(attributes, "value", qName);					bugInstance.setProperty(propName, propValue);				}				if (bugAnnotation != null)					bugInstance.add(bugAnnotation);			} else if (outerElement.equals("Method")) {				if (qName.equals("SourceLine")) {					// Method elements can contain nested SourceLine elements.					methodAnnotation.setSourceLines(createSourceLineAnnotation(qName, attributes));				}			}		}		textBuffer.delete(0, textBuffer.length());		elementStack.add(qName);	}