             (jdb-end (region-end))
             (subblock-start-mark (make-marker))
             (subblock-end-mark (make-marker))
-            match-end-start-re);;end bindings
+            match-end-start-re
+            );;end bindings
+
+        (if (< jdb-end jdb-start)
+            ;; Exchange if the region begin/end points are out of order.
+            (let ((swap-pt jdb-end))
+              (setq jdb-end jdb-start
+                    jdb-start swap-pt)
+              )
+          )
+
         (save-excursion
           (goto-char jdb-start)
           (while (re-search-forward jpw-javadoc-chk-invalid-start-re

  (let ((entity (cdr (assoc (match-string 0)
                            jpw-javadoc-invalid-chars-table)))
        );;end bindings
        (if (looking-at jpw-javadoc-replacement-entity-re)
            (goto-char (match-end 0))
          ;; else
          (replace-match entity t t))
        );;end let
  )



    '>' with '&lt;'
    '&' with '&amp;'
    '@' with '&#064;'
    '/*' with '/&#042;'
    '*/' with '&#042;/'
{jpw: 06/2012}"

  (if (< end-mark start-mark)
      ;; Exchange marks that are out of order.
