Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-76747

Use enhanced for-loop when iterating over arrays or collections when possible

    Details

    • Branch Version/s:
      7.0.x
    • Backported to Branch:
      Committed
    • Priority Level:
      Low

      Description

      Instead of using the general for-loop:

       

      for (int i = 0; i < names.length; i++) {
          String name = names[i];
         ...
      }
      

      use the enhanced for-loop:

       

      for (String name : names) {
          ...
      }
      

       

       

        Attachments

          Activity

            People

            Assignee:
            jason.pince Jason Pince
            Reporter:
            hugo.huijser Hugo Huijser
            Recent user:
            Csaba Turcsan
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.0.0 DXP FP35
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                7.1.X
                Master