Omaha #4442 Fix locking of area notations in followups.

Change-Id: I4ad06f23004c1436c84767d022efaf7df36f2f19

Former-commit-id: 9fb4fcc33d9eaf2df0e0c89c5bf3bb09670bab64
This commit is contained in:
Ron Anderson 2015-07-07 11:28:11 -05:00
parent b1501e5871
commit b49c7f1d8f

View file

@ -146,32 +146,38 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
* @return
*/
private String headline(String headline) {
// Marine products follow different locking rules
if (isMarineProduct()) {
// The full headline of a marine product should be locked.
headline = WarnGenPatterns.LOCK_START + headline
+ WarnGenPatterns.LOCK_END;
} else {
Set<String> notations = new HashSet<String>();
Set<String> names = new HashSet<String>();
for (AffectedAreas affectedArea : affectedAreas) {
if ((affectedArea.getAreaNotation() != null)
&& (affectedArea.getAreaNotation().trim().length() != 0)) {
notations.add(affectedArea.getAreaNotation());
notations.add(affectedArea.getAreaNotation().toUpperCase());
}
if ((affectedArea.getAreasNotation() != null)
&& (affectedArea.getAreasNotation().trim().length() != 0)) {
notations.add(affectedArea.getAreasNotation());
notations
.add(affectedArea.getAreasNotation().toUpperCase());
}
if ((affectedArea.getName() != null)
&& (affectedArea.getName().trim().length() != 0)) {
/*
* force area name to upper case for headlines since headlines
* are all upper case
* force area name to upper case for headlines since
* headlines are all upper case
*/
names.add(affectedArea.getName().toUpperCase());
}
}
// Marine products follow different locking rules
if (!isMarineProduct()) {
headline = keywords(headline);
Iterator<String> iterator1 = notations.iterator();
while (iterator1.hasNext()) {
@ -192,10 +198,6 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
+ WarnGenPatterns.LOCK_END);
}
}
} else {
// The full headline of a marine product should be locked.
headline = WarnGenPatterns.LOCK_START + headline
+ WarnGenPatterns.LOCK_END;
}
return headline;