Skip to content

Commit 59f2ab9

Browse files
committed
CWMSVUE-600 Added code comments/javadoc to explain what is occurring in code.
1 parent 9358e3b commit 59f2ab9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cwms-data-api/src/main/java/cwms/cda/data/dao/RatingSpecDao.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,13 @@ public void create(String xml, boolean failIfExists) {
426426
);
427427
}
428428

429+
/**
430+
* Retrieve effective dates for specs matching the specIdMask and officeIdMask within the given date range.
431+
* NOTE: This makes a separate query to get the list of non-aliased spec ids for the officeIdMask, so that aliased specs can be skipped.
432+
*/
429433
public RatingEffectiveDatesMap retrieveSpecEffectiveDates(String officeIdMask, String specIdMask, Instant begin, Instant end) {
430434
return connectionResult(dsl, conn -> {
435+
//set of non-alias spec ids used to filter out aliased specs
431436
Set<String> ratingIdsNoAliases = getRatingIds(officeIdMask, "*", false);
432437
//office->spec->dates
433438
NavigableMap<String, NavigableMap<String, NavigableSet<Instant>>> specDateMap = new TreeMap<>();
@@ -436,7 +441,7 @@ public RatingEffectiveDatesMap retrieveSpecEffectiveDates(String officeIdMask, S
436441
while(rs.next()) {
437442
String officeId = rs.getString(OFFICE_ID);
438443
String specId = rs.getString(SPECIFICATION_ID);
439-
if(!ratingIdsNoAliases.contains(specId)) { // skip aliased specs
444+
if(!ratingIdsNoAliases.contains(specId)) { // skip aliased specs based on queried list of rating ids not including aliases
440445
continue;
441446
}
442447
Timestamp timestamp = rs.getTimestamp(EFFECTIVE_DATE, GMT_CALENDAR);

0 commit comments

Comments
 (0)