Kaydet (Commit) 9d2a3acf authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1327203 UwF: Unwritten field

Change-Id: I120b6cd6908ab4263a3ec3f8318aff8e507ab62b
üst 5d999513
...@@ -44,7 +44,6 @@ public class XMLTools { ...@@ -44,7 +44,6 @@ public class XMLTools {
} }
private final HashMap<String, Attribute> attrByName = new HashMap<String, Attribute>() ; private final HashMap<String, Attribute> attrByName = new HashMap<String, Attribute>() ;
private final ArrayList<Attribute> attributes = new ArrayList<Attribute>() ; private final ArrayList<Attribute> attributes = new ArrayList<Attribute>() ;
private PrintWriter log = null ;
/** /**
* Creates a class instance. * Creates a class instance.
...@@ -83,47 +82,30 @@ public class XMLTools { ...@@ -83,47 +82,30 @@ public class XMLTools {
****************************************/ ****************************************/
public short getLength() { public short getLength() {
if (log != null)
log.println("getLength() called -> " + attributes.size()) ;
return (short) attributes.size() ; return (short) attributes.size() ;
} }
public String getNameByIndex(short idx) { public String getNameByIndex(short idx) {
String name = attributes.get(idx).Name ; String name = attributes.get(idx).Name ;
if (log != null)
log.println("getNameByIndex(" + idx + ") called -> '" +
name + "'") ;
return name ; return name ;
} }
public String getTypeByIndex(short idx) { public String getTypeByIndex(short idx) {
String type = attributes.get(idx).Type ; String type = attributes.get(idx).Type ;
if (log != null)
log.println("getTypeByIndex(" + idx + ") called -> '" +
type + "'") ;
return type; return type;
} }
public String getTypeByName(String name) { public String getTypeByName(String name) {
String type = attrByName.get(name).Type ; String type = attrByName.get(name).Type ;
if (log != null)
log.println("getTypeByName('" + name + "') called -> '" +
type + "'") ;
return type; return type;
} }
public String getValueByIndex(short idx) { public String getValueByIndex(short idx) {
String value = attributes.get(idx).Value ; String value = attributes.get(idx).Value ;
if (log != null) return value;
log.println("getValueByIndex(" + idx + ") called -> '" +
value + "'") ;
return value;
} }
public String getValueByName(String name) { public String getValueByName(String name) {
String value = attrByName.get(name).Value ; String value = attrByName.get(name).Value ;
if (log != null)
log.println("getValueByName('" + name + "') called -> '" +
value + "'") ;
return value; return value;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment