public GHUser[] getContributors(final GHRepository repository) throws Exception {
final Field field = GHRepository.class.getDeclaredField("root");
field.setAccessible(true);
final GitHub gitHub = (GitHub) field.get(repository);
final GHUser owner = repository.getOwner();
final String login = owner.getLogin();
final String name = repository.getName();
final Method retrieveMethod = GitHub.class.getDeclaredMethod("retrieve");
retrieveMethod.setAccessible(true);
final Object request = retrieveMethod.invoke(gitHub);
final Method toMethod = request.getClass().getDeclaredMethod("to", String.class, Class.class);
toMethod.setAccessible(true);
return (GHUser[]) toMethod.invoke(request, "/repos/" + login + "/" + name + "/contributors", GHUser[].class);
}
Now, I'm using the following workaround:
java