Bug 572932 - [quickfix] Create foreach expression var as array

Enhance the creation of variable when the variable is the expression on
which a foreach loop iterates.

Given:
for (int number : numbers) {
                  ^^^^^^^
}

When:
Selecting "Create a local variable"

Actual:
Object numbers;
for (int number : numbers) {
}

Expected:
int[] numbers;
for (int number : numbers) {
}

Also fix test method name typo.

Change-Id: Iff19fc5180fe66aba8e9da7ecce996932951b9ed
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Depends-On: Ic61e45c2c34a7dc45c58f6c3562e06d1509b6272
diff --git a/4.20/images/foreach-expression-type-after.png b/4.20/images/foreach-expression-type-after.png
new file mode 100644
index 0000000..a52fd75
--- /dev/null
+++ b/4.20/images/foreach-expression-type-after.png
Binary files differ
diff --git a/4.20/images/foreach-expression-type-before.png b/4.20/images/foreach-expression-type-before.png
new file mode 100644
index 0000000..f41406b
--- /dev/null
+++ b/4.20/images/foreach-expression-type-before.png
Binary files differ
diff --git a/4.20/jdt.html b/4.20/jdt.html
index fe97478..8fc22f9 100644
--- a/4.20/jdt.html
+++ b/4.20/jdt.html
@@ -73,6 +73,21 @@
     </td>
   </tr>
   
+  <tr id="foreach-expression-type"><!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=572932 -->
+    <td class="title"><a href="#foreach-expression-type">Better type for the local variable creation quickfix</a></td>
+    <td class="content">
+      The quick fix <b>Create a new local variable</b> has been enhanced. When it creates a variable that is the expression on which a foreach loop iterates, its type is an array of the type of the loop parameter:
+      <p>
+        For the given code:
+      </p>
+      <p><img src="images/foreach-expression-type-before.png" alt="Before"/></p>
+      <p>
+        One gets:
+      </p>
+      <p><img src="images/foreach-expression-type-after.png" alt="After"/></p>
+    </td>
+  </tr>
+  
   <tr id="use-instanceof"> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=569835 -->
     <td class="title"><a href="#use-instanceof">Use instanceof</a></td>
     <td class="content">