Ignore:
Timestamp:
08/14/19 14:22:44 (5 years ago)
Author:
bln4
Message:

Fixed bug for when there are no surrogates left for a primary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/encryption/items/surrogates/Label.java

    r1415 r1430  
    5454
    5555        public static List<String> getAccessibleLabelsNames(ItemsList itemsList) {
     56                // TODO make copy of itemsList in here and then adjust callers so they do not need to make copy.
     57                // Alternatively, filter instead of removeIf
    5658                Text[] userLabels = KeyList.UserLabels.get();
    5759                Stream<String> accessibleUserWideLabels = Arrays.asList(userLabels).stream().map(label -> label.getText());
    5860               
    59                 Predicate<Item> isLabelWithoutEncryptionLabel = item -> item.getEncryptionLabel() == null || item.getEncryptionLabel().isEmpty();
    60                 itemsList.removeIf(isLabelWithoutEncryptionLabel);
     61                Predicate<Item> isItemWithoutEncryptionLabel = item -> item.getEncryptionLabel() == null || item.getEncryptionLabel().isEmpty();
     62                itemsList.removeIf(isItemWithoutEncryptionLabel);
    6163                Stream<String> accessibleFrameLocalLabels = itemsList.underlying().stream().map(item -> item.getEncryptionLabel()).distinct();
    6264               
Note: See TracChangeset for help on using the changeset viewer.