On line 2058 in NodeModel.java:
in addAttributeElement()
if (ALLOCATION_INSTANCE.equals(allocation)) {
attrs = this.attrs;
} else if (ALLOCATION_CLASS.equals(allocation)) {
attrs = this.classAttrs;
}
The tool reported to assignment to "attrs = this.attrs" as redundant, but
the bug is that if we're bashing
'attrs', we should have
a local 'attrs' var declared, like we do previously in the code for
addProperty, right?
LinkedHashMap attrs;
if (ALLOCATION_INSTANCE.equals(allocation)) {
attrs = this.attrs;
} else if (ALLOCATION_CLASS.equals(allocation)) {
attrs = this.classAttrs;
} else {
Because it looks like the code in is supposed to just side-effect the attrs
instance var, not actually bash it.
We should really use a different local variable name, to avoid this
confusion.
--
Henry Minsky
Software Architect
[email protected]