merge of '155618ea1e5d1088da55cc657cc6b6d95e44e862'

and '6060c1530835d871f99ceba7209ed4031c582573'
This commit is contained in:
dev
2011-07-22 15:18:43 +00:00

View File

@@ -158,8 +158,8 @@ public class RateStat {
RateStat rs = (RateStat) obj; RateStat rs = (RateStat) obj;
if (DataHelper.eq(getGroupName(), rs.getGroupName()) && DataHelper.eq(getDescription(), rs.getDescription()) if (DataHelper.eq(getGroupName(), rs.getGroupName()) && DataHelper.eq(getDescription(), rs.getDescription())
&& DataHelper.eq(getName(), rs.getName())) { && DataHelper.eq(getName(), rs.getName())) {
for (Entry<Long, Rate> e: _rates.entrySet()) for (Rate r: _rates.values())
if (!e.getValue().equals(rs.getRate(e.getValue().getPeriod()))) return false; if (!r.equals(rs.getRate(r.getPeriod()))) return false;
return true; return true;
} }
@@ -175,13 +175,13 @@ public class RateStat {
buf.append("# ").append(NL).append(NL); buf.append("# ").append(NL).append(NL);
out.write(buf.toString().getBytes()); out.write(buf.toString().getBytes());
buf.setLength(0); buf.setLength(0);
for (Entry<Long, Rate> e: _rates.entrySet()){ for (Rate r: _rates.values()){
buf.append("#######").append(NL); buf.append("#######").append(NL);
buf.append("# Period : ").append(DataHelper.formatDuration(e.getValue().getPeriod())).append(" for rate ") buf.append("# Period : ").append(DataHelper.formatDuration(r.getPeriod())).append(" for rate ")
.append(_groupName).append(" - ").append(_statName).append(NL); .append(_groupName).append(" - ").append(_statName).append(NL);
buf.append(NL); buf.append(NL);
String curPrefix = prefix + "." + DataHelper.formatDuration(e.getValue().getPeriod()); String curPrefix = prefix + "." + DataHelper.formatDuration(r.getPeriod());
e.getValue().store(curPrefix, buf); r.store(curPrefix, buf);
out.write(buf.toString().getBytes()); out.write(buf.toString().getBytes());
buf.setLength(0); buf.setLength(0);
} }