This fixes the issue where InstanceIdentifier.toString() would remain
empty, causing weird debug statements like:
2014-04-14 02:26:50.284 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-6-2] TRACE o.o.c.m.s.d.s.impl.MutableDataTree - Resolving modification apply strategy for
Change-Id: Ibde143c614d49f27385da729ac4054627e601b57
Signed-off-by: Robert Varga <rovarga@cisco.com>
if (toStringCache != null) {
return toStringCache;
}
- StringBuilder builder = new StringBuilder();
+
+ final StringBuilder builder = new StringBuilder('/');
+ boolean first = true;
for (PathArgument argument : path) {
- builder.append("/");
+ if (first) {
+ first = false;
+ } else {
+ builder.append('/');
+ }
builder.append(argument.toString());
}
+
toStringCache = builder.toString();
return toStringCache;
}