import java.io.PrintWriter;
import java.util.ArrayList;
-
-import javax.tools.JavaFileManager.Location;
+import java.util.Collections;
+import java.util.List;
import org.xml.sax.Attributes;
{ BugMethod.TAG, BugMethod.class},
{ LocalVariable.TAG, LocalVariable.class},
{ SourceLine.TAG, SourceLine.class} };
+ static final String CATEGORY = "category";
static final String TYPE = "type";
+ String m_category;
String m_type;
ArrayList<BugClass> m_classes;
ArrayList<BugMethod> m_methods;
public BugInstance() {
super(TAG, INTERNAL, EXTERNAL);
- m_type = null;
+ m_category = m_type = null;
m_classes = new ArrayList<BugClass>();
m_methods = new ArrayList<BugMethod>();
m_locals = new ArrayList<LocalVariable>();
m_lines = new ArrayList<SourceLine>();
}
+ public String getCategory() { return m_category; }
public String getType() { return m_type; }
+ public List<BugClass> getClasses() { return Collections.unmodifiableList(m_classes); }
+ public List<BugMethod> getMethods() { return Collections.unmodifiableList(m_methods); }
+ public List<SourceLine> getLines() { return Collections.unmodifiableList(m_lines); }
@Override
public void endContents(String uri, String localName, String qName, String chars)
public void handleMainAttributes(Attributes attr) throws MissingAttributeException
{
m_type = this.getRequiredAttr(TAG, attr, TYPE);
+ m_category = this.getRequiredAttr(TAG, attr, CATEGORY);
}
@Override
String margin = String.format("%" + indent + "s", "");
pw.println(margin + TAG + " (" + m_type + ")");
+ pw.println(margin + CATEGORY + " (" + m_category + ")");
for (BugClass bc : m_classes) {
bc.dump(pw, childIndent);
}