You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
rnveach
changed the title
Change GHRepository getIssue and getPullRequest to support GHObject long id
Change GHRepository getIssue and getPullRequest to not mentiond ID and make it clear it is number
Feb 17, 2025
After actually trying to use the methods, I realize I was in error on how they should be used.
I thought they were asking for the ID, but they actually want the numbers. I am not sure if this was from reading the code, which some parts do say ID or I (which I thought was short for ID), or from asking AI to explain how to do things. But after failing to use them with ID and looking at the underlying code a bit more, I understand now these are numbers.
rnveach
added a commit
to rnveach/github-api
that referenced
this issue
Feb 17, 2025
GHRepository#getIssue
takes id as anint
. Same withgetPullRequest
.github-api/src/main/java/org/kohsuke/github/GHRepository.java
Line 358 in e14ec3b
github-api/src/main/java/org/kohsuke/github/GHRepository.java
Line 1509 in e14ec3b
GHIssue
andGHPullRequest
which extendGHObject
returns along
for anid
.github-api/src/main/java/org/kohsuke/github/GHObject.java
Line 32 in e14ec3b
To call either, with the original object requires you to downcast.
It seems to me both should be updated to be a
long
to make everything consistent and not require down casting.The text was updated successfully, but these errors were encountered: