I am attempting to find a way to force Java to load/initialize an enumerated type (which is nested within a class that contains a static Map).
This is important to me be
Can't you just put initialization of the map in the static initializer of the Enum type?
public enum SomeEnum
{
Member1, Member2, Member3 ...
private static Map map = ...;
static
{
...populate map...
}
...
EDIT: It appears that the issue was that the Enum member definitions need to come first. I guess I just glossed over this. I fixed the example.