@Override public synchronized void setLastBuildNumber(Integer lastBuildNumber, GameJob job) { if ((lastBuildNumber != null) && (lastBuildNumber >= job.getMinBuildNumber())) { properties.setProperty( PROPERTY_PREFIX_LAST_BUILD_NUMBER + job.name(), lastBuildNumber.toString()); } else { properties.setProperty( PROPERTY_PREFIX_LAST_BUILD_NUMBER + job.name(), LAST_BUILD_NUMBER_DEFAULT); } }
private void initLastBuildNumber() { for (GameJob j : GameJob.values()) { final String key = PROPERTY_PREFIX_LAST_BUILD_NUMBER + j.name(); final String lastBuildNumberStr = properties.getProperty(key); Integer lastBuildNumber = null; if (lastBuildNumberStr != null) { try { lastBuildNumber = Integer.parseInt(lastBuildNumberStr); } catch (NumberFormatException e) { logger.warn(WARN_MSG_INVALID_VALUE, lastBuildNumberStr, key); } } if ((lastBuildNumber != null) && (lastBuildNumber >= j.getMinBuildNumber())) { properties.setProperty(key, lastBuildNumber.toString()); } else { properties.setProperty(key, LAST_BUILD_NUMBER_DEFAULT); } } }