Skip to content

Commit

Permalink
#1747 more longs
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jun 5, 2024
1 parent f6493b0 commit 2d70523
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<version>1.34.1</version>
</parent>
<artifactId>jcabi-github</artifactId>
<version>2.0-SNAPSHOT</version>
<version>1.9.1</version>
<packaging>jar</packaging>
<name>jcabi-github</name>
<description>Object Oriented Github API</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jcabi/github/Comments.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public interface Comments {
* @return Comment
* @see <a href="https://developer.github.com/v3/issues/comments/#get-a-single-comment">Get a Single Comment</a>
*/
Comment get(int number);
Comment get(long number);

/**
* Iterate them all.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/jcabi/github/RtComments.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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()
);
}

Expand All @@ -125,7 +125,7 @@ public Iterable<Comment> 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())
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jcabi/github/mock/MkComment.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class MkComment implements Comment {
/**
* Comment number.
*/
private final transient int num;
private final transient long num;

/**
* Public ctor.
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/jcabi/github/mock/MkComments.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -124,7 +124,7 @@ public Iterable<Comment> 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))
)
);
}
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jcabi/github/safe/SfComments.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 2d70523

Please sign in to comment.