8000 Change GHRepository getIssue and getPullRequest to not mentiond ID and make it clear it is number · Issue #2033 · hub4j/github-api · GitHub
[go: up one dir, main page]

Skip to content
Change GHRepository getIssue and getPullRequest to not mentiond ID and make it clear it is number #2033
Closed
@rnveach

Description

@rnveach

GHRepository#getIssue takes id as an int. Same with getPullRequest.

public GHIssue getIssue(int id) throws IOException {

public GHPullRequest getPullRequest(int i) throws IOException {

GHIssue and GHPullRequest which extend GHObject returns a long for an id.

To call either, with the original object requires you to downcast.

			if (issue) {
				final GHIssue issue = repository.getIssue((int) item.getId());
			} else {
				final GHPullRequest pullRequest = repository.getPullRequest((int) item.getId());
			}

It seems to me both should be updated to be a long to make everything consistent and not require down casting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0