} else if (qName.equals("Method")) { } else if (qName.equals("Field")) {
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")) { bugAnnotation = new MethodAnnotation(classname, fieldOrMethodName, signature); } else { String isStatic = getRequiredAttribute(attributes, "isStatic", qName); bugAnnotation = new FieldAnnotation(classname, fieldOrMethodName, signature, Boolean.valueOf(isStatic)); }
	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.setFileName(filename);				} else if (qName.equals("BugInstance")) {					// BugInstance element - get required type and priority attributes					String type = attributes.getValue("type");					String priority = attributes.getValue("priority");					if (type == null)						throw new SAXException("BugInstance missing type attribute");					if (priority == null)						throw new SAXException("BugInstance missing priority attribute");					try {						int prio = Integer.parseInt(priority);						bugInstance = new BugInstance(type, prio);					} catch (NumberFormatException e) {						throw new SAXException("BugInstance with invalid priority value \"" +							priority + "\"");					}				}			} else if (outerElement.equals("BugInstance")) {				// Parsing an attribute of a BugInstance				if (qName.equals("Class")) {				} else if (qName.equals("Method")) {				} else if (qName.equals("Field")) {				} else if (qName.equals("SourceLine")) {				} else if (qName.equals("Int")) {				}			}		}		textBuffer.delete(0, textBuffer.length());		elementStack.add(qName);	}