Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-742

Create new method in CollectionUtils to return first element if not null

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.4
    • Fix Version/s: None
    • Component/s: Collection
    • Labels:
      None
    • Flags:
      Patch

      Description

      When we try to get the first element into collection, we have to lead with null point exception. So with this method, when the collection is null or empty, the method will return null, and when not, the method will return the first element.

      In this way, the user don't need to write nothing to lead with null point exception.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wesllhey Wesllhey Holanda
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 8h
                8h
                Remaining:
                Remaining Estimate - 8h
                8h
                Logged:
                Time Spent - Not Specified
                Not Specified