Skip to content

Commit bc13252

Browse files
authored
Merge pull request hub4j#1307 from bitwiseman/task/urlcleanup
Code cleanup
2 parents e403ce4 + cba827d commit bc13252

33 files changed

+242
-219
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,12 @@
342342
</executions>
343343
<configuration>
344344
<java>
345+
<includes>
346+
<include>src/main/java/**/*.java</include>
347+
<include>src/main/java11/**/*.java</include>
348+
<include>src/test/java/**/*.java</include>
349+
</includes>
350+
345351
<eclipse>
346352
<file>${basedir}/src/build/eclipse/formatter.xml</file>
347353
</eclipse>

src/main/java/org/kohsuke/github/AbstractBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* @param <S>
3838
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
3939
* the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}.
40+
*
41+
* @author Liam Newman
4042
*/
4143
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
4244

src/main/java/org/kohsuke/github/AbuseLimitHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* GitHubBuilder#withAbuseLimitHandler(GitHubAbuseLimitHandler)
1717
* @see <a href="https://developer.github.com/v3/#abuse-rate-limits">documentation</a>
1818
* @see RateLimitHandler
19+
* @deprecated Switch to {@link GitHubAbuseLimitHandler}.
1920
*/
2021
@Deprecated
2122
public abstract class AbuseLimitHandler extends GitHubAbuseLimitHandler {

src/main/java/org/kohsuke/github/GHRateLimit.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Rate limit.
2626
*
27-
* @author Kohsuke Kawaguchi
27+
* @author Liam Newman
2828
*/
2929
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "JSON API")
3030
public class GHRateLimit {
@@ -380,6 +380,7 @@ static void reset() {
380380
* A rate limit record.
381381
*
382382
* @since 1.100
383+
* @author Liam Newman
383384
*/
384385
public static class Record {
385386
/**

src/main/java/org/kohsuke/github/GitHubAbuseLimitHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @author Kohsuke Kawaguchi
1414
* @see GitHubBuilder#withAbuseLimitHandler(AbuseLimitHandler) GitHubBuilder#withRateLimitHandler(AbuseLimitHandler)
1515
* @see GitHubRateLimitHandler
16+
*
17+
* @author Liam Newman
1618
*/
1719
public abstract class GitHubAbuseLimitHandler extends GitHubConnectorResponseErrorHandler {
1820

src/main/java/org/kohsuke/github/GitHubClient.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.kohsuke.github.connector.GitHubConnector;
99
import org.kohsuke.github.connector.GitHubConnectorRequest;
1010
import org.kohsuke.github.connector.GitHubConnectorResponse;
11-
import org.kohsuke.github.function.BodyHandler;
11+
import org.kohsuke.github.function.FunctionThrows;
1212

1313
import java.io.*;
1414
import java.net.*;
@@ -33,9 +33,14 @@
3333
/**
3434
* A GitHub API Client
3535
* <p>
36-
* A GitHubClient can be used to send requests and retrieve their responses. GitHubClient is thread-safe and can be used
37-
* to send multiple requests. GitHubClient also track some GitHub API information such as {@link GHRateLimit}.
36+
* A GitHubClient can be used to send requests and retrieve their responses. Uses {@link GitHubConnector} as a pluggable
37+
* component to communicate using differing HTTP client libraries.
38+
* <p>
39+
* GitHubClient is thread-safe and can be used to send multiple requests simultaneously. GitHubClient also tracks some
40+
* GitHub API information such as {@link GHRateLimit}.
3841
* </p>
42+
*
43+
* @author Liam Newman
3944
*/
4045
class GitHubClient {
4146

@@ -764,4 +769,14 @@ static class RetryRequestException extends IOException {
764769
this.connectorRequest = connectorRequest;
765770
}
766771
}
772+
773+
/**
774+
* Represents a supplier of results that can throw.
775+
*
776+
* @param <T>
777+
* the type of results supplied by this supplier
778+
*/
779+
@FunctionalInterface
780+
interface BodyHandler<T> extends FunctionThrows<GitHubConnectorResponse, T, IOException> {
781+
}
767782
}

src/main/java/org/kohsuke/github/GitHubConnectorResponseErrorHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
1313

1414
/**
15-
* Pluggable strategy to determine what to detect and choose what to do when various errors occur during an http
16-
* request.
15+
* Pluggable strategy to detect and choose what to do when errors occur during an http request.
1716
*
1817
* @author Liam Newman
1918
*/

src/main/java/org/kohsuke/github/GitHubInteractiveObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Ensures that all data references to GitHub connection are transient.
1414
*
1515
* Classes that do not need to interact with GitHub after they are instantiated do not need to inherit from this class.
16+
*
17+
* @author Liam Newman
1618
*/
1719
abstract class GitHubInteractiveObject {
1820
@JacksonInject

src/main/java/org/kohsuke/github/GitHubPageContentsIterable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*
1515
* @param <T>
1616
* the type of items on each page
17+
*
18+
* @author Liam Newman
1719
*/
1820
class GitHubPageContentsIterable<T> extends PagedIterable<T> {
1921

src/main/java/org/kohsuke/github/GitHubPageIterator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*
2020
* @param <T>
2121
* type of each page (not the items in the page).
22+
*
23+
* @author Liam Newman
2224
*/
2325
class GitHubPageIterator<T> implements Iterator<T> {
2426

0 commit comments

Comments
 (0)