Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5470

Refactor detection of global error

    Details

    • Type: Task
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.3.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      In HasGlobalErrors, a simpler stream operation can be used. Instead of:

      item.getGlobalErrors().stream().filter(c -> code.equals(c.getCode())).findFirst().isPresent()
      

      the same logic can be applied using anyMatch:

      item.getGlobalErrors().stream().anyMatch(c -> code.equals(c.getCode()))
      

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  michal Michal Fotyga
                  Reporter:
                  michal Michal Fotyga
                  Watchers:
                  Daniel Kayiwa, Michal Fotyga
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: