Bug 570011 - Add more explanation and highlight the checkboxes
Change-Id: I7e07026ac80d414a40d2089f2b7da60b39a4c777
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
diff --git a/4.19/images/code-style-preferences.png b/4.19/images/code-style-preferences.png
deleted file mode 100644
index 2471af9..0000000
--- a/4.19/images/code-style-preferences.png
+++ /dev/null
Binary files differ
diff --git a/4.19/images/comparator-comparing-preferences.png b/4.19/images/comparator-comparing-preferences.png
new file mode 100644
index 0000000..e133d8b
--- /dev/null
+++ b/4.19/images/comparator-comparing-preferences.png
Binary files differ
diff --git a/4.19/images/comparison-zero-preferences.png b/4.19/images/comparison-zero-preferences.png
new file mode 100644
index 0000000..270abf4
--- /dev/null
+++ b/4.19/images/comparison-zero-preferences.png
Binary files differ
diff --git a/4.19/images/convert-fields-preferences.png b/4.19/images/convert-fields-preferences.png
new file mode 100644
index 0000000..25b3e1a
--- /dev/null
+++ b/4.19/images/convert-fields-preferences.png
Binary files differ
diff --git a/4.19/images/extract-increment-preferences.png b/4.19/images/extract-increment-preferences.png
new file mode 100644
index 0000000..112a24b
--- /dev/null
+++ b/4.19/images/extract-increment-preferences.png
Binary files differ
diff --git a/4.19/images/invert-equals-preferences.png b/4.19/images/invert-equals-preferences.png
new file mode 100644
index 0000000..d2f9089
--- /dev/null
+++ b/4.19/images/invert-equals-preferences.png
Binary files differ
diff --git a/4.19/images/multi-catch-preferences.png b/4.19/images/multi-catch-preferences.png
new file mode 100644
index 0000000..0a99ac7
--- /dev/null
+++ b/4.19/images/multi-catch-preferences.png
Binary files differ
diff --git a/4.19/images/optimization-preferences.png b/4.19/images/optimization-preferences.png
deleted file mode 100644
index ecbc2d0..0000000
--- a/4.19/images/optimization-preferences.png
+++ /dev/null
Binary files differ
diff --git a/4.19/images/pattern-matching-preferences.png b/4.19/images/pattern-matching-preferences.png
new file mode 100644
index 0000000..7534354
--- /dev/null
+++ b/4.19/images/pattern-matching-preferences.png
Binary files differ
diff --git a/4.19/images/primitive-comparison-preferences.png b/4.19/images/primitive-comparison-preferences.png
new file mode 100644
index 0000000..57394e8
--- /dev/null
+++ b/4.19/images/primitive-comparison-preferences.png
Binary files differ
diff --git a/4.19/images/primitive-parsing-preferences.png b/4.19/images/primitive-parsing-preferences.png
new file mode 100644
index 0000000..41ec0e5
--- /dev/null
+++ b/4.19/images/primitive-parsing-preferences.png
Binary files differ
diff --git a/4.19/images/reduce-indentation-preferences.png b/4.19/images/reduce-indentation-preferences.png
new file mode 100644
index 0000000..b2ddefe
--- /dev/null
+++ b/4.19/images/reduce-indentation-preferences.png
Binary files differ
diff --git a/4.19/images/static-inner-class-preferences.png b/4.19/images/static-inner-class-preferences.png
new file mode 100644
index 0000000..8d4bc93
--- /dev/null
+++ b/4.19/images/static-inner-class-preferences.png
Binary files differ
diff --git a/4.19/images/string-replace-preferences.png b/4.19/images/string-replace-preferences.png
new file mode 100644
index 0000000..55044a2
--- /dev/null
+++ b/4.19/images/string-replace-preferences.png
Binary files differ
diff --git a/4.19/images/substring-preferences.png b/4.19/images/substring-preferences.png
new file mode 100644
index 0000000..15f23e0
--- /dev/null
+++ b/4.19/images/substring-preferences.png
Binary files differ
diff --git a/4.19/images/unlooped-while-preferences.png b/4.19/images/unlooped-while-preferences.png
new file mode 100644
index 0000000..be0d79d
--- /dev/null
+++ b/4.19/images/unlooped-while-preferences.png
Binary files differ
diff --git a/4.19/images/unnecessary-code-preferences.png b/4.19/images/unnecessary-code-preferences.png
deleted file mode 100644
index 6a09c34..0000000
--- a/4.19/images/unnecessary-code-preferences.png
+++ /dev/null
Binary files differ
diff --git a/4.19/images/unreachable-block-preferences.png b/4.19/images/unreachable-block-preferences.png
new file mode 100644
index 0000000..bd7c890
--- /dev/null
+++ b/4.19/images/unreachable-block-preferences.png
Binary files differ
diff --git a/4.19/jdt.html b/4.19/jdt.html
index 7ce2312..7851440 100644
--- a/4.19/jdt.html
+++ b/4.19/jdt.html
@@ -76,7 +76,7 @@
<p>
To apply the clean up, select <b>Reduce indentation when possible</b> check box on the <b>Code Style</b> tab in your clean up profile.
</p>
- <p><img src="images/code-style-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/reduce-indentation-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -93,12 +93,44 @@
<td class="content">
A new clean up has been added that moves increment or decrement outside an expression.
<p>
- It moves before the prefix expressions, it moves after the postfix expressions, it converts as postfix expressions, it does not move increments from loop condition and it does not cleanup several increments in the same statement.
+ A prefix increment/decrement (<code>++i</code>) first changes the value of the variable and then returns the updated value.
+ A postfix increment/decrement (<code>i++</code>) first returns the original value and then changes the value of the variable.
+ </p>
+ <p>
+ But let's look at this code:
+ </p>
+ <p>
+ <pre>int i = j++;</pre>
+ </p>
+ <p>
+ Most of the developers hardly remember which from the increment or the assignment comes first. One way to make the code obvious is to write the increment/decrement in a dedicated statement:
+ </p>
+ <p>
+ <pre>int i = j;
+j++;</pre>
+ </p>
+ <p>
+ And so for the prefix expressions:
+ </p>
+ <p>
+ <pre>int i = ++j;</pre>
+ </p>
+ <p>
+ ...it goes like this:
+ </p>
+ <p>
+ <pre>j++;
+int i = j;</pre>
+ </p>
+ <p>
+ The cleanup moves a prefix expression above the statement and a postfix expression below.
+ It does not move increments from loop condition and it does not cleanup several increments in the same statement.
+ The increment/decrement is always rewritten as a postfix expression for standardization.
</p>
<p>
To apply the clean up, select <b>Extract increment/decrement from statement</b> check box on the <b>Code Style</b> tab in your clean up profile.
</p>
- <p><img src="images/code-style-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/extract-increment-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -131,7 +163,7 @@
<p>
To apply the clean up, select <b>Pattern matching for instanceof</b> check box on the <b>Java Feature</b> tab in your clean up profile.
</p>
- <p><img src="images/java-feature-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/pattern-matching-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -158,7 +190,7 @@
<p>
To apply the clean up, select <b>Use Comparator.comparing()</b> check box on the <b>Java Feature</b> tab in your clean up profile.
</p>
- <p><img src="images/java-feature-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/comparator-comparing-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -180,7 +212,7 @@
<p>
To apply the clean up, select <b>Use Multi-catch</b> check box on the <b>Java Feature</b> tab in your clean up profile.
</p>
- <p><img src="images/java-feature-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/multi-catch-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -202,7 +234,7 @@
<p>
To apply the clean up, select <b>Convert fields into local variables if the use is only local</b> check box on the <b>Optimization</b> tab in your clean up profile.
</p>
- <p><img src="images/optimization-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/convert-fields-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -221,7 +253,7 @@
<p>
To apply the clean up, select <b>Make inner classes static where possible</b> check box on the <b>Optimization</b> tab in your clean up profile.
</p>
- <p><img src="images/optimization-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/static-inner-class-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -243,7 +275,7 @@
<p>
To apply the clean up, select <b>Use String::replace instead of String::replaceAll when no regex used</b> check box on the <b>Optimization</b> tab in your clean up profile.
</p>
- <p><img src="images/optimization-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/string-replace-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -266,7 +298,7 @@
<p>
To apply the clean up, select <b>Primitive comparison</b> check box on the <b>Optimization</b> tab in your clean up profile.
</p>
- <p><img src="images/optimization-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/primitive-comparison-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -288,7 +320,7 @@
<p>
To apply the clean up, select <b>Primitive parsing</b> check box on the <b>Optimization</b> tab in your clean up profile.
</p>
- <p><img src="images/optimization-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/primitive-parsing-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -349,7 +381,7 @@
<p>
To apply the clean up, select <b>Redundant String.substring() parameter</b> check box on the <b>Unnecessary code</b> tab in your clean up profile.
</p>
- <p><img src="images/unnecessary-code-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/substring-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -380,7 +412,7 @@
<p>
To apply the clean up, select <b>Unreachable block</b> check box on the <b>Unnecessary code</b> tab in your clean up profile.
</p>
- <p><img src="images/unnecessary-code-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/unreachable-block-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -405,7 +437,7 @@
<p>
To apply the clean up, select <b>Convert loop into if when possible</b> check box on the <b>Unnecessary code</b> tab in your clean up profile.
</p>
- <p><img src="images/unnecessary-code-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/unlooped-while-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -445,7 +477,7 @@
<p>
To apply the clean up, select <b>Avoid Object::equals or String::equalsIgnoreCase on null objects</b> check box on the <b>Source Fixing</b> tab in your clean up profile.
</p>
- <p><img src="images/source-fixing-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/invert-equals-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>
@@ -470,7 +502,7 @@
<p>
To apply the clean up, select <b>Compare to zero</b> check box on the <b>Source Fixing</b> tab in your clean up profile.
</p>
- <p><img src="images/source-fixing-preferences.png" alt="Preferences" width="800 px"/></p>
+ <p><img src="images/comparison-zero-preferences.png" alt="Preferences" width="800 px"/></p>
<p>
For the given code:
</p>