private PropertyState[] getPropertyStates() { if (!propertiesRestored) { // return the same state that we loaded return state.properties; } else { final Map<String, String> map = PropertyServiceImpl.getInstance().getProperties(); final PropertyState[] states = new PropertyState[map.size()]; int index = 0; for (final Map.Entry<String, String> entry : map.entrySet()) { states[index++] = new PropertyState(entry.getKey(), entry.getValue()); } return states; } }