Fix regression in Vector.listIterator.add() introduced in N.

AOSP commit 887ab3fe607c582e10e33b3d631401d7a791aaed touched Vector.Itr
to fix an app compability bug, but did not make a corresponding change
to Vector.ListItr which extends Vector.Itr. Specifically, ListItr.add()
does not account for the extra element in the hasNext() logic that it
inherits from the super class. This causes iteration to terminate
prematurely when an element was added via the ListIterator.

This CL fixes the regression by incrementing limit during ListItr.add().

Bug: 27430229
Bug: 30974375

Test: VectorTest
Test: 842 guava-testlib tests for Vector; coverage for Vector was
      contributed to guava-testlib in http://cl/130778873

(cherry picked from commit c13c9eddc3f7eeb760fcd9032b85ef2767cc82ba)

Change-Id: I9a565f11f7b8b7368cf967d66e986d6130e17267
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/VectorTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/VectorTest.java
index a9f64a2..a16c4e4 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/VectorTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/VectorTest.java
@@ -30,6 +30,7 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.NoSuchElementException;
 import java.util.Spliterator;
 import java.util.Vector;
@@ -850,6 +851,15 @@
         }
     }
 
+    // http://b/30974375
+    public void test_listIterator_addAndPrevious() {
+        ListIterator<String> it = new Vector<String>().listIterator();
+        assertFalse(it.hasNext());
+        it.add("value");
+        assertEquals("value", it.previous());
+        assertTrue(it.hasNext());
+    }
+
     /**
      * java.util.Vector#remove(int)
      */
diff --git a/ojluni/src/main/java/java/util/Vector.java b/ojluni/src/main/java/java/util/Vector.java
index b2bc200..0f2dedd 100755
--- a/ojluni/src/main/java/java/util/Vector.java
+++ b/ojluni/src/main/java/java/util/Vector.java
@@ -1238,6 +1238,7 @@
                 checkForComodification();
                 Vector.this.add(i, e);
                 expectedModCount = modCount;
+                limit++;
             }
             cursor = i + 1;
             lastRet = -1;