Weird Static Block Behaviour
Hi There,
I have a class to provide constants that is initialised using a static block...
publicfinalclass ConstantNames{
publicstaticfinal String NAME1="Name 1",
NAME2="Name 2",
NAME3="Name 3",
NAME4="Name 4",
NAME5="Name 5",
NAME6="Name 6",
NAME7="Name 7";
privatestaticfinal Set<String> VALUES;
static{
VALUES = CollectionsUtils.makeSet(NAME1, NAME2, NAME3, NAME4, NAME5, NAME6, NAME7);
}
publicstatic Set<String> values(){
return VALUES;
}
/**
* Prevents construction.
*/
private ConstantNames (){
}
}
It works as expected in my local environment (Win XP/JDK 1.5) but in the production environment (Linux/JDK 1.5) It 'loses' NAME7 such that...
ConstantNames.values().contains("Name 7")
...returns false (its true for "Name 1" .. "Name 6")
Can anyone shed any light on this for me - thanks

