Skip to content
Snippets Groups Projects
Unverified Commit b41e342a authored by Manuel Leduc's avatar Manuel Leduc Committed by GitHub
Browse files

XWIKI-19875: TaskData.type values are duplicated in memory (#1868)

parent 036919eb
No related branches found
No related tags found
No related merge requests found
......@@ -129,7 +129,11 @@ public String getType()
@Unstable
public void setType(String type)
{
this.type = type;
// Replace duplicate strings with a canonical version. This is useful to lower the memory footprint when
// initializing tasks from sources where each type string is a new object (e.g., from the database), to avoid
// having a lot of String object with the same task type value (e.g., mention or links). We don't do the same
// for other field as they are either transient (e.g., instanceId), or more diverse (e.g., version).
this.type = type.intern();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment