Skip to content

Commit 8343b6b

Browse files
authored
Merge pull request #2036 from rnveach/unused_exceptions
Removed unused checked exceptions
2 parents 827c537 + 15ca8ba commit 8343b6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+135
-434
lines changed

pom.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,8 @@
383383
<artifactId>japicmp-maven-plugin</artifactId>
384384
<version>0.23.0</version>
385385
<configuration>
386-
<oldVersion>
387-
<dependency>
388-
<groupId>${project.groupId}</groupId>
389-
<artifactId>${project.artifactId}</artifactId>
390-
<version>2.0.0-alpha-1</version>
391-
<type>jar</type>
392-
</dependency>
393-
</oldVersion>
394386
<parameter>
395-
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications> -->
387+
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
396388
<!-- <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning> -->
397389
<onlyModified>true</onlyModified>
398390
<includeSynthetic>true</includeSynthetic>

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.kohsuke.github;
22

3-
import java.io.IOException;
43
import java.util.*;
54

65
// TODO: Auto-generated Javadoc
@@ -66,10 +65,8 @@ public GHRepositorySelection getRepositorySelection() {
6665
* Gets expires at.
6766
*
6867
* @return date when this token expires
69-
* @throws IOException
70-
* on error
7168
*/
72-
public Date getExpiresAt() throws IOException {
69+
public Date getExpiresAt() {
7370
return GitHubClient.parseDate(expires_at);
7471
}
7572
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ public class GHBranch extends GitHubInteractiveObject {
3434
*
3535
* @param name
3636
* the name
37-
* @throws Exception
38-
* the exception
3937
*/
4038
@JsonCreator
41-
GHBranch(@JsonProperty(value = "name", required = true) String name) throws Exception {
39+
GHBranch(@JsonProperty(value = "name", required = true) String name) {
4240
Objects.requireNonNull(name);
4341
this.name = name;
4442
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,8 @@ public PagedIterable<GHPullRequest> listPullRequests() {
520520
* Retrieves a list of branches where this commit is the head commit.
521521
*
522522
* @return {@link PagedIterable} with the branches where the commit is the head commit
523-
* @throws IOException
524-
* the io exception
525523
*/
526-
public PagedIterable<GHBranch> listBranchesWhereHead() throws IOException {
524+
public PagedIterable<GHBranch> listBranchesWhereHead() {
527525
return owner.root()
528526
.createRequest()
529527
.withUrlPath(String.format("/repos/%s/%s/commits/%s/branches-where-head",

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ public GHCommitPointer() {
4949
* This points to the user who owns the {@link #getRepository()}.
5050
*
5151
* @return the user
52-
* @throws IOException
53-
* the io exception
5452
*/
5553
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
56-
public GHUser getUser() throws IOException {
54+
public GHUser getUser() {
5755
if (user != null)
5856
return user.root().intern(user);
5957
return user;

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.kohsuke.github;
22

3-
import java.io.IOException;
4-
53
// TODO: Auto-generated Javadoc
64
/**
75
* Represents a status of a commit.
@@ -69,10 +67,8 @@ public String getDescription() {
6967
* Gets creator.
7068
*
7169
* @return the creator
72-
* @throws IOException
73-
* the io exception
7470
*/
75-
public GHUser getCreator() throws IOException {
71+
public GHUser getCreator() {
7672
return root().intern(creator);
7773
}
7874

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ protected synchronized void populate() throws IOException {
257257
* List immediate children of this directory.
258258
*
259259
* @return the paged iterable
260-
* @throws IOException
261-
* the io exception
262260
*/
263-
public PagedIterable<GHContent> listDirectoryContent() throws IOException {
261+
public PagedIterable<GHContent> listDirectoryContent() {
264262
if (!isDirectory())
265263
throw new IllegalStateException(path + " is not a directory");
266264

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.kohsuke.github;
22

3-
import java.io.IOException;
43
import java.net.URL;
54
import java.util.Collections;
65
import java.util.Map;
@@ -169,10 +168,8 @@ public boolean isProductionEnvironment() {
169168
* Gets creator.
170169
*
171170
* @return the creator
172-
* @throws IOException
173-
* the io exception
174171
*/
175-
public GHUser getCreator() throws IOException {
172+
public GHUser getCreator() {
176173
return root().intern(creator);
177174
}
178175

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ public GHDiscussion() {
3636
* Gets the html url.
3737
*
3838
* @return the html url
39-
* @throws IOException
40-
* Signals that an I/O exception has occurred.
4139
*/
42-
public URL getHtmlUrl() throws IOException {
40+
public URL getHtmlUrl() {
4341
return GitHubClient.parseURL(htmlUrl);
4442
}
4543

@@ -122,10 +120,8 @@ public boolean isPrivate() {
122120
* @param team
123121
* the team in which the discussion will be created.
124122
* @return a {@link GHLabel.Creator}
125-
* @throws IOException
126-
* the io exception
127123
*/
128-
static GHDiscussion.Creator create(GHTeam team) throws IOException {
124+
static GHDiscussion.Creator create(GHTeam team) {
129125
return new GHDiscussion.Creator(team);
130126
}
131127

@@ -154,10 +150,8 @@ static GHDiscussion read(GHTeam team, long discussionNumber) throws IOException
154150
* @param team
155151
* the team
156152
* @return the paged iterable
157-
* @throws IOException
158-
* Signals that an I/O exception has occurred.
159153
*/
160-
static PagedIterable<GHDiscussion> readAll(GHTeam team) throws IOException {
154+
static PagedIterable<GHDiscussion> readAll(GHTeam team) {
161155
return team.root()
162156
.createRequest()
163157
.setRawUrlPath(getRawUrlPath(team, null))

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ public GHUser getActor() throws IOException {
162162
* Gets actor login.
163163
*
164164
* @return the login of the actor.
165-
* @throws IOException
166-
* on error
167165
*/
168-
public String getActorLogin() throws IOException {
166+
public String getActorLogin() {
169167
return actor.getLogin();
170168
}
171169

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,9 @@ void wrapUp(final GitHub root) { // auto-wrapUp when organization is known from
194194
* Gets organization.
195195
*
196196
* @return the organization
197-
* @throws IOException
198-
* the io exception
199197
*/
200198
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
201-
public GHOrganization getOrganization() throws IOException {
199+
public GHOrganization getOrganization() {
202200
return organization;
203201
}
204202

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ public String getGistId() {
7676
* Gets owner.
7777
*
7878
* @return User that owns this Gist.
79-
* @throws IOException
80-
* the io exception
8179
*/
8280
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
83-
public GHUser getOwner() throws IOException {
81+
public GHUser getOwner() {
8482
return owner;
8583
}
8684

@@ -265,10 +263,8 @@ public void delete() throws IOException {
265263
* Updates this gist via a builder.
266264
*
267265
* @return the gh gist updater
268-
* @throws IOException
269-
* the io exception
270266
*/
271-
public GHGistUpdater update() throws IOException {
267+
public GHGistUpdater update() {
272268
return new GHGistUpdater(this);
273269
}
274270

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ public class GHGistUpdater {
4141
* @param content
4242
* the content
4343
* @return the gh gist updater
44-
* @throws IOException
45-
* the io exception
4644
*/
47-
public GHGistUpdater addFile(@Nonnull String fileName, @Nonnull String content) throws IOException {
45+
public GHGistUpdater addFile(@Nonnull String fileName, @Nonnull String content) {
4846
updateFile(fileName, content);
4947
return this;
5048
}
@@ -55,10 +53,8 @@ public GHGistUpdater addFile(@Nonnull String fileName, @Nonnull String content)
5553
* @param fileName
5654
* the file name
5755
* @return the GH gist updater
58-
* @throws IOException
59-
* Signals that an I/O exception has occurred.
6056
*/
61-
public GHGistUpdater deleteFile(@Nonnull String fileName) throws IOException {
57+
public GHGistUpdater deleteFile(@Nonnull String fileName) {
6258
files.put(fileName, null);
6359
return this;
6460
}
@@ -71,10 +67,8 @@ public GHGistUpdater deleteFile(@Nonnull String fileName) throws IOException {
7167
* @param newFileName
7268
* the new file name
7369
* @return the gh gist updater
74-
* @throws IOException
75-
* the io exception
7670
*/
77-
public GHGistUpdater renameFile(@Nonnull String fileName, @Nonnull String newFileName) throws IOException {
71+
public GHGistUpdater renameFile(@Nonnull String fileName, @Nonnull String newFileName) {
7872
Map<String, String> file = files.computeIfAbsent(fileName, d -> new HashMap<>());
7973
file.put("filename", newFileName);
8074
return this;
@@ -88,10 +82,8 @@ public GHGistUpdater renameFile(@Nonnull String fileName, @Nonnull String newFil
8882
* @param content
8983
* the content
9084
* @return the gh gist updater
91-
* @throws IOException
92-
* the io exception
9385
*/
94-
public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String content) throws IOException {
86+
public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String content) {
9587
Map<String, String> file = files.computeIfAbsent(fileName, d -> new HashMap<>());
9688
file.put("content", content);
9789
return this;
@@ -107,11 +99,8 @@ public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String conten
10799
* @param content
108100
* the content
109101
* @return the gh gist updater
110-
* @throws IOException
111-
* the io exception
112102
*/
113-
public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String newFileName, @Nonnull String content)
114-
throws IOException {
103+
public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String newFileName, @Nonnull String content) {
115104
Map<String, String> file = files.computeIfAbsent(fileName, d -> new HashMap<>());
116105
file.put("content", content);
117106
file.put("filename", newFileName);

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,10 @@ public List<GHIssueComment> getComments() throws IOException {
539539
* Obtains all the comments associated with this issue, without any filter.
540540
*
541541
* @return the paged iterable
542-
* @throws IOException
543-
* the io exception
544542
* @see <a href="https://docs.github.com/en/rest/issues/comments#list-issue-comments">List issue comments</a>
545543
* @see #queryComments() queryComments to apply filters.
546544
*/
547-
public PagedIterable<GHIssueComment> listComments() throws IOException {
545+
public PagedIterable<GHIssueComment> listComments() {
548546
return root().createRequest()
549547
.withUrlPath(getIssuesApiRoute() + "/comments")
550548
.toIterable(GHIssueComment[].class, item -> item.wrapUp(this));
@@ -717,10 +715,8 @@ protected String getIssuesApiRoute() {
717715
* Gets assignee.
718716
*
719717
* @return the assignee
720-
* @throws IOException
721-
* the io exception
722718
*/
723-
public GHUser getAssignee() throws IOException {
719+
public GHUser getAssignee() {
724720
return root().intern(assignee);
725721
}
726722

@@ -737,10 +733,8 @@ public List<GHUser> getAssignees() {
737733
* User who submitted the issue.
738734
*
739735
* @return the user
740-
* @throws IOException
741-
* the io exception
742736
*/
743-
public GHUser getUser() throws IOException {
737+
public GHUser getUser() {
744738
return root().intern(user);
745739
}
746740

@@ -752,10 +746,8 @@ public GHUser getUser() throws IOException {
752746
* https://github.com/kohsuke/github-api/issues/60.
753747
*
754748
* @return the closed by
755-
* @throws IOException
756-
* the io exception
757749
*/
758-
public GHUser getClosedBy() throws IOException {
750+
public GHUser getClosedBy() {
759751
if (!"closed".equals(state))
760752
return null;
761753

@@ -864,10 +856,8 @@ protected static List<String> getLogins(Collection<GHUser> users) {
864856
* Lists events for this issue. See https://developer.github.com/v3/issues/events/
865857
*
866858
* @return the paged iterable
867-
* @throws IOException
868-
* the io exception
869859
*/
870-
public PagedIterable<GHIssueEvent> listEvents() throws IOException {
860+
public PagedIterable<GHIssueEvent> listEvents() {
871861
return root().createRequest()
872862
.withUrlPath(getRepository().getApiTailUrl(String.format("/issues/%s/events", number)))
873863
.toIterable(GHIssueEvent[].class, item -> item.wrapUp(this));

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,9 @@ static Collection<String> toNames(Collection<GHLabel> labels) {
143143
* @param repository
144144
* the repository in which the label will be created.
145145
* @return a {@link Creator}
146-
* @throws IOException
147-
* the io exception
148146
*/
149147
@BetaApi
150-
static Creator create(GHRepository repository) throws IOException {
148+
static Creator create(GHRepository repository) {
151149
return new Creator(repository);
152150
}
153151

@@ -176,10 +174,8 @@ static GHLabel read(@Nonnull GHRepository repository, @Nonnull String name) thro
176174
* @param repository
177175
* the repository to read from
178176
* @return iterable of all labels
179-
* @throws IOException
180-
* the io exception
181177
*/
182-
static PagedIterable<GHLabel> readAll(@Nonnull final GHRepository repository) throws IOException {
178+
static PagedIterable<GHLabel> readAll(@Nonnull final GHRepository repository) {
183179
return repository.root()
184180
.createRequest()
185181
.withUrlPath(repository.getApiTailUrl("labels"))

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.kohsuke.github;
22

3-
import java.io.IOException;
4-
53
// TODO: Auto-generated Javadoc
64
/**
75
* Returns any accounts associated with a plan, including free plans.
@@ -72,10 +70,8 @@ public enum Sort {
7270
* OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
7371
*
7472
* @return a paged iterable instance of GHMarketplaceAccountPlan
75-
* @throws IOException
76-
* on error
7773
*/
78-
public PagedIterable<GHMarketplaceAccountPlan> createRequest() throws IOException {
74+
public PagedIterable<GHMarketplaceAccountPlan> createRequest() {
7975
return builder.withUrlPath(String.format("/marketplace_listing/plans/%d/accounts", this.planId))
8076
.toIterable(GHMarketplaceAccountPlan[].class, null);
8177
}

0 commit comments

Comments
 (0)