| 
40 | 40 | import java.util.*;  | 
41 | 41 | import java.util.regex.Pattern;  | 
42 | 42 | 
 
  | 
 | 43 | +import static java.util.Objects.requireNonNull;  | 
 | 44 | + | 
43 | 45 | public class GitHubClient {  | 
44 | 46 | 
 
  | 
45 | 47 |     private final static Logger log = LoggerFactory.getLogger(GitHubClient.class);  | 
@@ -76,8 +78,8 @@ public Map<String, Object> singleObjectResult(String method, String path, Object  | 
76 | 78 |     public void forEachPage(String path, Map<String, String> params, int pageSize, PageHandler handler)  | 
77 | 79 |             throws IOException, InterruptedException, URISyntaxException {  | 
78 | 80 | 
 
  | 
79 |  | -        Objects.requireNonNull(path, "'path' must not be null");  | 
80 |  | -        Objects.requireNonNull(params, "'params' must not be null");  | 
 | 81 | +        requireNonNull(path, "'path' must not be null");  | 
 | 82 | +        requireNonNull(params, "'params' must not be null");  | 
81 | 83 | 
 
  | 
82 | 84 |         var effectiveParams = new HashMap<>(params);  | 
83 | 85 |         effectiveParams.put("per_page", String.valueOf(pageSize));  | 
@@ -109,7 +111,7 @@ private static String buildApiUrl(String baseUrl, String path) throws URISyntaxE  | 
109 | 111 |             prefix = "/api/v3";  | 
110 | 112 |         }  | 
111 | 113 | 
 
  | 
112 |  | -        var scheme = Objects.requireNonNull(uri.getScheme(), "Base URL without schema");  | 
 | 114 | +        var scheme = requireNonNull(uri.getScheme(), "Base URL without schema");  | 
113 | 115 |         var port = uri.getPort();  | 
114 | 116 | 
 
  | 
115 | 117 |         var apiUri = new URI(scheme, null, host, port, joinPaths(prefix, path), null, null);  | 
 | 
0 commit comments