X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugInstance.java;h=4c78f8d5606d62ed6ab991e3248236801ac94ab5;hp=ee5bac0474aa3a24e38dcbfae3c8f7b7fb1f1db9;hb=a46ab60a0c205d1e56cfb10a84f559167bcaa737;hpb=598968590bf67cf87d3243878f7ebb2ff8015065 diff --git a/prod/net/jaekl/cfb/xml/BugInstance.java b/prod/net/jaekl/cfb/xml/BugInstance.java index ee5bac0..4c78f8d 100644 --- a/prod/net/jaekl/cfb/xml/BugInstance.java +++ b/prod/net/jaekl/cfb/xml/BugInstance.java @@ -2,8 +2,8 @@ package net.jaekl.cfb.xml; 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; @@ -19,8 +19,10 @@ public class BugInstance extends ParseResult { { 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 m_classes; ArrayList m_methods; @@ -30,14 +32,18 @@ public class BugInstance extends ParseResult { public BugInstance() { super(TAG, INTERNAL, EXTERNAL); - m_type = null; + m_category = m_type = null; m_classes = new ArrayList(); m_methods = new ArrayList(); m_locals = new ArrayList(); m_lines = new ArrayList(); } + public String getCategory() { return m_category; } public String getType() { return m_type; } + public List getClasses() { return Collections.unmodifiableList(m_classes); } + public List getMethods() { return Collections.unmodifiableList(m_methods); } + public List getLines() { return Collections.unmodifiableList(m_lines); } @Override public void endContents(String uri, String localName, String qName, String chars) @@ -84,6 +90,7 @@ public class BugInstance extends ParseResult { public void handleMainAttributes(Attributes attr) throws MissingAttributeException { m_type = this.getRequiredAttr(TAG, attr, TYPE); + m_category = this.getRequiredAttr(TAG, attr, CATEGORY); } @Override @@ -93,6 +100,7 @@ public class BugInstance extends ParseResult { 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); }