Yet another victim of .substring() holds original string buffer.

This commit is contained in:
Maxim Shafirov
2010-11-12 21:23:47 +03:00
parent 6b5802b50d
commit e9aaaa7e56
@@ -103,8 +103,9 @@ public class VirtualDirectoryImpl extends VirtualFileSystemEntry {
// do not extract getId from under the synchronized block since it will cause a concurrency problem.
int id = ourPersistence.getId(this, name);
if (id > 0) {
NewVirtualFile child = createChild(name, id);
map.put(name, child);
final String shorty = new String(name);
NewVirtualFile child = createChild(shorty, id); // So we don't hold whole char[] buffer of a lengthy path
map.put(shorty, child);
return child;
}
}