diff --git a/pom.xml b/pom.xml index 68cf7c6cf..f5304c9a3 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. 1.34.1 jcabi-github - 2.0-SNAPSHOT + 1.9.1 jar jcabi-github Object Oriented Github API diff --git a/src/main/java/com/jcabi/github/Comments.java b/src/main/java/com/jcabi/github/Comments.java index 244ab6e87..dacb238e3 100644 --- a/src/main/java/com/jcabi/github/Comments.java +++ b/src/main/java/com/jcabi/github/Comments.java @@ -62,7 +62,7 @@ public interface Comments { * @return Comment * @see Get a Single Comment */ - Comment get(int number); + Comment get(long number); /** * Iterate them all. diff --git a/src/main/java/com/jcabi/github/RtComments.java b/src/main/java/com/jcabi/github/RtComments.java index f061649e0..11749743d 100644 --- a/src/main/java/com/jcabi/github/RtComments.java +++ b/src/main/java/com/jcabi/github/RtComments.java @@ -98,7 +98,7 @@ public Issue issue() { } @Override - public Comment get(final int number) { + public Comment get(final long number) { return new RtComment(this.entry, this.owner, number); } @@ -115,7 +115,7 @@ public Comment post(final String text) throws IOException { .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) // @checkstyle MultipleStringLiterals (1 line) - .json().readObject().getInt("id") + .json().readObject().getJsonNumber("id").longValue() ); } @@ -125,7 +125,7 @@ public Iterable iterate(final Date since) { this.request.uri() .queryParam("since", new Github.Time(since)) .back(), - object -> this.get(object.getInt("id")) + object -> this.get(object.getJsonNumber("id").longValue()) ); } diff --git a/src/main/java/com/jcabi/github/mock/MkComment.java b/src/main/java/com/jcabi/github/mock/MkComment.java index 1bf0c4eff..ef0c80538 100644 --- a/src/main/java/com/jcabi/github/mock/MkComment.java +++ b/src/main/java/com/jcabi/github/mock/MkComment.java @@ -78,7 +78,7 @@ final class MkComment implements Comment { /** * Comment number. */ - private final transient int num; + private final transient long num; /** * Public ctor. @@ -94,7 +94,7 @@ final class MkComment implements Comment { final String login, final Coordinates rep, final int issue, - final int number + final long number ) { this.storage = stg; this.self = login; diff --git a/src/main/java/com/jcabi/github/mock/MkComments.java b/src/main/java/com/jcabi/github/mock/MkComments.java index 52f523034..579044e5c 100644 --- a/src/main/java/com/jcabi/github/mock/MkComments.java +++ b/src/main/java/com/jcabi/github/mock/MkComments.java @@ -112,7 +112,7 @@ public Issue issue() { } @Override - public Comment get(final int number) { + public Comment get(final long number) { return new MkComment( this.storage, this.self, this.repo, this.ticket, number ); @@ -124,7 +124,7 @@ public Iterable iterate(final Date since) { this.storage, String.format("%s/comment", this.xpath()), xml -> this.get( - Integer.parseInt(xml.xpath("number/text()").get(0)) + Long.parseLong(xml.xpath("number/text()").get(0)) ) ); } @@ -134,14 +134,14 @@ public Comment post( final String text ) throws IOException { this.storage.lock(); - final int number; + final long number; try { final String timestamp = new Github.Time().toString(); number = 1 + this.storage.xml() .nodes("//comment/number").size(); this.storage.apply( new Directives().xpath(this.xpath()).add("comment") - .add("number").set(Integer.toString(number)).up() + .add("number").set(Long.toString(number)).up() .add("url") .set( String.format( diff --git a/src/main/java/com/jcabi/github/safe/SfComments.java b/src/main/java/com/jcabi/github/safe/SfComments.java index b78ee395c..90b3230d6 100644 --- a/src/main/java/com/jcabi/github/safe/SfComments.java +++ b/src/main/java/com/jcabi/github/safe/SfComments.java @@ -77,7 +77,7 @@ public Issue issue() { } @Override - public Comment get(final int number) { + public Comment get(final long number) { return new SfComment(this.origin.get(number)); }