diff --git a/4.26/images/extract-local-var-after.png b/4.26/images/extract-local-var-after.png new file mode 100644 index 0000000000..41be50bad0 Binary files /dev/null and b/4.26/images/extract-local-var-after.png differ diff --git a/4.26/images/extract-local-var-before.png b/4.26/images/extract-local-var-before.png new file mode 100644 index 0000000000..17cf614057 Binary files /dev/null and b/4.26/images/extract-local-var-before.png differ diff --git a/4.26/jdt.html b/4.26/jdt.html index 557544d718..56298d1534 100644 --- a/4.26/jdt.html +++ b/4.26/jdt.html @@ -105,6 +105,19 @@
For example, in the following class, a call to the String length() method is made after verifying the String variable is not null.
+If we select the s.length() call and choose to extract this to a local variable to replace all occurrences, the result is:
+Note how the declaration is after the if statement to ensure that the check for null occurs first
+