Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-990

Inline assignments within while loop clause get no coverage

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • long term roadmap
    • 3.0.2, 3.1.0, 3.2.0, 3.3.0, 4.0.0
    • CEP Plugin, Reporting
    • None
    • Eclipse Helios, Vista 64bit

    • Severity 2 - Major

      This will work with any type of assignment:

      int i = 0;
      while ((i = i + 1) < 3)

      { System.out.println(i); }

      The "((i = i + 1) < 3)" will get no coverage with the mouseover hint being: "Expression evaluated to true 0 times, false 0 times."


      The following is no problem however:

      int i = 0;
      while ((++i) < 3) { System.out.println(i); }

      Here is another example that won't work:

      public static void inlineAssignment() {
      Class<?> c = Integer.class;
      while ((c = c.getSuperclass()) != null)

      { System.out.println(c); }

      }

      Since Clover is primarily a coverage tool, I marked this issue Major.

            [CLOV-990] Inline assignments within while loop clause get no coverage

            Michael Andreacchio made changes -
            Resolution New: Won't Fix [ 2 ]
            Status Original: Open [ 1 ] New: Closed [ 6 ]
            Marek Parfianowicz made changes -
            Assignee Original: Marek Parfianowicz [ mparfianowicz ]
            jonah (Inactive) made changes -
            Symptom Severity New: Major [ 14431 ]
            Owen made changes -
            Workflow Original: New Clover Workflow [ 898255 ] New: New Clover Workflow - Restricted [ 1475215 ]
            Marek Parfianowicz made changes -
            Affects Version/s New: 3.1.0 [ 15068 ]
            Marek Parfianowicz made changes -
            Affects Version/s New: 4.0.0 [ 38490 ]
            Affects Version/s New: 3.3.0 [ 36826 ]
            Affects Version/s New: 3.2.0 [ 26196 ]
            Piotr Swiecicki made changes -
            Workflow Original: Clover Workflow [ 896627 ] New: New Clover Workflow [ 898255 ]
            Piotr Swiecicki made changes -
            Workflow Original: reviewflow [ 283602 ] New: Clover Workflow [ 896627 ]
            Marek Parfianowicz made changes -
            Fix Version/s New: long term roadmap [ 54394 ]
            Fix Version/s Original: 4.3.x [ 29907 ]
            Marek Parfianowicz made changes -
            Assignee New: Marek Parfianowicz [ mparfianowicz ]

              Unassigned Unassigned
              983aa62a2de2 Benny Bottema
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: