Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GHPullRequestReviewComment.getLine() always returns -1 #2106

@tsantalis

Description

@tsantalis

Describe the bug
GHPullRequestReviewComment.getLine() API does not return accurate value.
As a matter of fact it always returns -1

To Reproduce
Steps to reproduce the behavior:
For the following PR review comment the line is 422
https://api.github.com/repos/JabRef/jabref/pulls/comments/2127829134

//PR URL: https://github.com/JabRef/jabref/pull/11845
GHRepository repository = ...;
GHPullRequest pullRequest = repository.getPullRequest(11845);
PagedIterable<GHPullRequestReview> reviews = pullRequest.listReviews();

for (GHPullRequestReview review : reviews) {
    PagedIterable<GHPullRequestReviewComment> comments = review.listReviewComments();
    for (GHPullRequestReviewComment comment : comments) {
        String path = comment.getPath();
        int lineNumber = comment.getLine();
    }
}

Expected behavior
The line number for
https://api.github.com/repos/JabRef/jabref/pulls/comments/2127829134
should be 422 instead of -1

Desktop (please complete the following information):

  • OS: iOS
  • Browser [Firefox]
  • Version [139]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions