I'm writing a class that will hold row data from a file. Therefore it'll have state, but it's immutable state and there will only ever be one set of data. My initial implementation was a static class, with the initializer block calling the method to read the file. By doing this, I could be sure that the data was read when the class was loaded, and none of the accessor methods for the data would have to check for that case.
A reviewer has commented that the class should be a singleton. While I understand his argument about the class having state, I'm thinking that the fact that it's an immutable state (once the file is read, of course) nullifies this argument.
I do have some other concerns, including handling an IOException
(thrown when the reading of the file fails) in a static initialization block, but I'd be interested in opinions about the static vs singleton issue.