Fixes #195 by adding static initialisation of the maps rather then using the constructor

This commit is contained in:
Daniel Kvist 2016-02-04 23:27:31 +01:00
parent 724c084abf
commit 77c4a04d3d

View File

@ -119,10 +119,9 @@ public class HtmlEncoder
}; };
/** /**
* <p>Constructor for HtmlEncoder.</p> * Initialises the mappings between entities and characters
*/ */
public HtmlEncoder() static {
{
for (int i = 0; i < entities.length; i++) for (int i = 0; i < entities.length; i++)
e2i.put((String) entities[i][0], (Integer) entities[i][1]); e2i.put((String) entities[i][0], (Integer) entities[i][1]);
for (int i = 0; i < entities.length; i++) for (int i = 0; i < entities.length; i++)