use of org.sonar.api.utils.SonarException in project sonarqube by SonarSource.
the class ProjectAnalysisInfo method loadAnalysisDate.
private Date loadAnalysisDate() {
Date date;
try {
// sonar.projectDate may have been specified as a time
date = settings.getDateTime(CoreProperties.PROJECT_DATE_PROPERTY);
} catch (SonarException e) {
// this is probably just a date
date = settings.getDate(CoreProperties.PROJECT_DATE_PROPERTY);
}
if (date == null) {
date = new Date(system2.now());
settings.setProperty(CoreProperties.PROJECT_DATE_PROPERTY, date, true);
}
return date;
}
Aggregations