Mercurial > jhg
diff src/org/tmatesoft/hg/internal/Pool.java @ 196:e2115da4cf6a
Pool objects to avoid memory polution with duplicates
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 18 Apr 2011 18:04:24 +0200 |
parents | c9b305df0b89 |
children | 3dcd3dd90c77 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Pool.java Fri Apr 15 05:17:44 2011 +0200 +++ b/src/org/tmatesoft/hg/internal/Pool.java Mon Apr 18 18:04:24 2011 +0200 @@ -36,4 +36,18 @@ } return rv; } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(Pool.class.getSimpleName()); + sb.append('<'); + if (!unify.isEmpty()) { + sb.append(unify.keySet().iterator().next().getClass().getName()); + } + sb.append('>'); + sb.append(':'); + sb.append(unify.size()); + return sb.toString(); + } } \ No newline at end of file