Fix errors against latest Gerrit core

Fix breakage due to a core change (Ifc8316278) which tries to avoid
the usage of ChangeIndex and removes createChecked(Change.Id) method.
Due to which the build for the tip version of batch plugin fails.

Also bump WORKSPACE/pom to 3.3.1 so that in-tree and out-of-tree builds are
in sync.

Change-Id: I03b79282804d23bdab74ef575dcb4a28d1e68c77
diff --git a/WORKSPACE b/WORKSPACE
index a064485..28d8aaa 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "cf0bbc90e09a8a1d7c042d79f1555e3fa40984e1",
+    commit = "5703ec25181046b60913d3510a0a5c2f0afa46f8",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
diff --git a/pom.xml b/pom.xml
index c66f0cd..a59e586 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
   <groupId>com.googlesource.gerrit.plugins.batch</groupId>
   <artifactId>batch</artifactId>
   <packaging>jar</packaging>
-  <version>3.3.0-SNAPSHOT</version>
+  <version>3.3.1</version>
   <name>batch</name>
 
   <properties>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
index a2729b7..546ae42 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
@@ -138,18 +138,22 @@
     if (dest.changes != null) {
       // TODO: Is using the first change in the batch for each dest the correct thing to do?
       Change firstInDest =
-          notesFactory.createChecked(dest.changes.get(0).toPatchSetId().changeId()).getChange();
+          notesFactory
+              .createChecked(
+                  Project.nameKey(dest.project), dest.changes.get(0).toPatchSetId().changeId())
+              .getChange();
       SubmissionId submissionId = new SubmissionId(firstInDest);
       for (Batch.Change change : dest.changes) {
-        closeChange(change.toPatchSetId(), dest.sha1, submissionId);
+        closeChange(Project.nameKey(dest.project), change.toPatchSetId(), dest.sha1, submissionId);
       }
     }
   }
 
-  private void closeChange(PatchSet.Id psId, String sha1, SubmissionId submissionId)
+  private void closeChange(
+      Project.NameKey destProject, PatchSet.Id psId, String sha1, SubmissionId submissionId)
       throws IOException, RepositoryNotFoundException, RestApiException, UpdateException,
           PermissionBackendException {
-    ChangeNotes changeNotes = notesFactory.createChecked(psId.changeId());
+    ChangeNotes changeNotes = notesFactory.createChecked(destProject, psId.changeId());
     permissionBackend.user(user).change(changeNotes).check(ChangePermission.READ);
     Change change = changeNotes.getChange();
     PatchSet ps = psUtil.get(changeNotes, psId);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
index 78d173a..1142882 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
@@ -47,7 +47,7 @@
     public PatchSetArgument createForArgument(String token) {
       try {
         PatchSet.Id patchSetId = parsePatchSet(token);
-        ChangeNotes changeNotes = notesFactory.createChecked(patchSetId.changeId());
+        ChangeNotes changeNotes = notesFactory.createCheckedUsingIndexLookup(patchSetId.changeId());
         permissionBackend.user(user).change(changeNotes).check(ChangePermission.READ);
         return new PatchSetArgument(changeNotes.getChange(), psUtil.get(changeNotes, patchSetId));
       } catch (PermissionBackendException | AuthException e) {