X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugInstance.java;fp=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugInstance.java;h=9e0395fd0334b1863c02abf5560dc6bddba7d011;hp=b805096c67551c7f3a35847b12f6660bc35acca0;hb=1b9389a8ec38485bbe14e9aa572af4510758e7a5;hpb=e9a80ba4b35ce25d00d259038c7d2cb0a954dcc4 diff --git a/prod/net/jaekl/cfb/xml/BugInstance.java b/prod/net/jaekl/cfb/xml/BugInstance.java index b805096..9e0395f 100644 --- a/prod/net/jaekl/cfb/xml/BugInstance.java +++ b/prod/net/jaekl/cfb/xml/BugInstance.java @@ -18,10 +18,11 @@ public class BugInstance extends ParseResult { static final String TAG = "BugInstance"; static final String[] INTERNAL = { }; - static final Object[][] EXTERNAL = { { BugClass.TAG, BugClass.class}, - { BugMethod.TAG, BugMethod.class}, - { LocalVariable.TAG, LocalVariable.class}, - { SourceLine.TAG, SourceLine.class} }; + static final Object[][] EXTERNAL = { { BugClass.TAG, BugClass.class }, + { BugMethod.TAG, BugMethod.class }, + { Field.TAG, Field.class }, + { LocalVariable.TAG, LocalVariable.class }, + { SourceLine.TAG, SourceLine.class } }; static final String CATEGORY = "category"; static final String TYPE = "type"; @@ -30,7 +31,7 @@ public class BugInstance extends ParseResult { String m_type; ArrayList m_classes; ArrayList m_methods; - ArrayList m_locals; + ArrayList m_vars; ArrayList m_lines; ArrayList m_locations; @@ -41,7 +42,7 @@ public class BugInstance extends ParseResult { m_category = m_type = null; m_classes = new ArrayList(); m_methods = new ArrayList(); - m_locals = new ArrayList(); + m_vars = new ArrayList(); m_lines = new ArrayList(); m_locations = new ArrayList(); } @@ -50,7 +51,7 @@ public class BugInstance extends ParseResult { String category, String type, Location[] locations, - LocalVariable[] variables) + Variable[] variables) { super(TAG, INTERNAL, EXTERNAL); @@ -63,12 +64,12 @@ public class BugInstance extends ParseResult { m_lines = new ArrayList(); m_locations = new ArrayList(Arrays.asList(locations)); - m_locals = new ArrayList(Arrays.asList(variables)); + m_vars = new ArrayList(Arrays.asList(variables)); } public String getCategory() { return m_category; } public String getType() { return m_type; } - public List getVariables() { return Collections.unmodifiableList(m_locals); } + public List getVariables() { return Collections.unmodifiableList(m_vars); } public List getLocations() { return Collections.unmodifiableList(m_locations); } @Override @@ -102,11 +103,18 @@ public class BugInstance extends ParseResult { m_methods.add((BugMethod)pr); } } + else if (Field.TAG.equals(localName)) { + ParseResult[] collected = collectParsedChildren(Field.class); + for (ParseResult pr : collected) { + assert(pr instanceof Field); + m_vars.add((Field)pr); + } + } else if (LocalVariable.TAG.equals(localName)) { ParseResult[] collected = collectParsedChildren(LocalVariable.class); for (ParseResult pr : collected) { assert(pr instanceof LocalVariable); - m_locals.add((LocalVariable)pr); + m_vars.add((LocalVariable)pr); } } else if (SourceLine.TAG.equals(localName)) { @@ -139,10 +147,8 @@ public class BugInstance extends ParseResult { for (BugMethod bm : m_methods) { bm.dump(pw, childIndent); } - for (LocalVariable lv : m_locals) { - if (null != lv) { - lv.dump(pw, childIndent); - } + for (Variable var : m_vars) { + pw.println(margin + " " + var.getDescription()); } for (SourceLine sl : m_lines) { sl.dump(pw, childIndent);