The only possible way for the else branch to be executed is if getProperty returns null despite your assurances that it doesn't.


System.out.println(userProperties.getProperty("LAST_LOGTIME"));
...