Skip to content

Commit

Permalink
Merge pull request #1184 from bitwiseman/no-deprecated
Browse files Browse the repository at this point in the history
Remove @deprecated annotation from Preview and BetaApi elements
  • Loading branch information
bitwiseman authored Jun 15, 2021
2 parents 66c74e9 + bf9e420 commit 9978678
Show file tree
Hide file tree
Showing 34 changed files with 4 additions and 157 deletions.
3 changes: 0 additions & 3 deletions src/main/java/org/kohsuke/github/AbstractBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
*/
@Nonnull
@BetaApi
@Deprecated
public R done() throws IOException {
R result;
if (updateInPlace && baseInstance != null) {
Expand Down Expand Up @@ -129,7 +128,6 @@ public R done() throws IOException {
*/
@Nonnull
@BetaApi
@Deprecated
protected S with(@Nonnull String name, Object value) throws IOException {
requester.with(name, value);
return continueOrDone();
Expand All @@ -150,7 +148,6 @@ protected S with(@Nonnull String name, Object value) throws IOException {
*/
@Nonnull
@BetaApi
@Deprecated
protected S continueOrDone() throws IOException {
// This little bit of roughness in this base class means all inheriting builders get to create Updater and
// Setter classes from almost identical code. Creator can often be implemented with significant code reuse as
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/kohsuke/github/GHApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ GHApp wrapUp(GitHub root) {
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public PagedIterable<GHAppInstallation> listInstallations() {
return root.createRequest()
.withPreview(MACHINE_MAN)
Expand All @@ -215,7 +214,6 @@ public PagedIterable<GHAppInstallation> listInstallations() {
* @see <a href="https://developer.github.com/v3/apps/#get-an-installation">Get an installation</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallation getInstallationById(long id) throws IOException {
return root.createRequest()
.withPreview(MACHINE_MAN)
Expand All @@ -238,7 +236,6 @@ public GHAppInstallation getInstallationById(long id) throws IOException {
* installation</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallation getInstallationByOrganization(String name) throws IOException {
return root.createRequest()
.withPreview(MACHINE_MAN)
Expand All @@ -263,7 +260,6 @@ public GHAppInstallation getInstallationByOrganization(String name) throws IOExc
* installation</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallation getInstallationByRepository(String ownerName, String repositoryName) throws IOException {
return root.createRequest()
.withPreview(MACHINE_MAN)
Expand All @@ -285,7 +281,6 @@ public GHAppInstallation getInstallationByRepository(String ownerName, String re
* @see <a href="https://developer.github.com/v3/apps/#get-a-user-installation">Get a user installation</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallation getInstallationByUser(String name) throws IOException {
return root.createRequest()
.withPreview(MACHINE_MAN)
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ public class GHAppCreateTokenBuilder extends GitHubInteractiveObject {
private final String apiUrlTail;

@BetaApi
@Deprecated
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail) {
this.root = root;
this.apiUrlTail = apiUrlTail;
this.builder = root.createRequest();
}

@BetaApi
@Deprecated
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail, Map<String, GHPermissionType> permissions) {
this(root, apiUrlTail);
permissions(permissions);
Expand All @@ -43,7 +41,6 @@ public class GHAppCreateTokenBuilder extends GitHubInteractiveObject {
* @return a GHAppCreateTokenBuilder
*/
@BetaApi
@Deprecated
public GHAppCreateTokenBuilder repositoryIds(List<Long> repositoryIds) {
this.builder.with("repository_ids", repositoryIds);
return this;
Expand All @@ -58,7 +55,6 @@ public GHAppCreateTokenBuilder repositoryIds(List<Long> repositoryIds) {
* @return a GHAppCreateTokenBuilder
*/
@BetaApi
@Deprecated
public GHAppCreateTokenBuilder permissions(Map<String, GHPermissionType> permissions) {
Map<String, String> retMap = new HashMap<>();
for (Map.Entry<String, GHPermissionType> entry : permissions.entrySet()) {
Expand All @@ -78,7 +74,6 @@ public GHAppCreateTokenBuilder permissions(Map<String, GHPermissionType> permiss
* on error
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallationToken create() throws IOException {
return builder.method("POST")
.withPreview(MACHINE_MAN)
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/kohsuke/github/GHAppInstallation.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public String getRepositoriesUrl() {
* @return the paged iterable
*/
@Preview(MACHINE_MAN)
@Deprecated
public PagedSearchIterable<GHRepository> listRepositories() {
GitHubRequest request;

Expand Down Expand Up @@ -326,7 +325,6 @@ GHAppInstallation wrapUp(GitHub root) {
* @see <a href="https://developer.github.com/v3/apps/#delete-an-installation">Delete an installation</a>
*/
@Preview(GAMBIT)
@Deprecated
public void deleteInstallation() throws IOException {
root.createRequest()
.method("DELETE")
Expand All @@ -348,7 +346,6 @@ public void deleteInstallation() throws IOException {
* @deprecated Use {@link GHAppInstallation#createToken()} instead.
*/
@BetaApi
@Deprecated
public GHAppCreateTokenBuilder createToken(Map<String, GHPermissionType> permissions) {
return new GHAppCreateTokenBuilder(root,
String.format("/app/installations/%d/access_tokens", getId()),
Expand All @@ -365,7 +362,6 @@ public GHAppCreateTokenBuilder createToken(Map<String, GHPermissionType> permiss
* @return a GHAppCreateTokenBuilder instance
*/
@BetaApi
@Deprecated
public GHAppCreateTokenBuilder createToken() {
return new GHAppCreateTokenBuilder(root, String.format("/app/installations/%d/access_tokens", getId()));
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public String getName() {
* @return true if the push to this branch is restricted via branch protection.
*/
@Preview(Previews.LUKE_CAGE)
@Deprecated
public boolean isProtected() {
return protection;
}
Expand All @@ -90,7 +89,6 @@ public boolean isProtected() {
* @return API URL that deals with the protection of this branch.
*/
@Preview(Previews.LUKE_CAGE)
@Deprecated
public URL getProtectionUrl() {
return GitHubClient.parseURL(protection_url);
}
Expand All @@ -103,7 +101,6 @@ public URL getProtectionUrl() {
* the io exception
*/
@Preview(Previews.LUKE_CAGE)
@Deprecated
public GHBranchProtection getProtection() throws IOException {
return root.createRequest()
.withPreview(Previews.LUKE_CAGE)
Expand Down Expand Up @@ -138,7 +135,6 @@ public void disableProtection() throws IOException {
* @see GHCommitStatus#getContext() GHCommitStatus#getContext()
*/
@Preview(Previews.LUKE_CAGE)
@Deprecated
public GHBranchProtectionBuilder enableProtection() {
return new GHBranchProtectionBuilder(this);
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/kohsuke/github/GHBranchProtection.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class GHBranchProtection extends GitHubInteractiveObject {
* the io exception
*/
@Preview(ZZZAX)
@Deprecated
public void enabledSignedCommits() throws IOException {
requester().method("POST").withUrlPath(url + REQUIRE_SIGNATURES_URI).fetch(RequiredSignatures.class);
}
Expand All @@ -54,7 +53,6 @@ public void enabledSignedCommits() throws IOException {
* the io exception
*/
@Preview(ZZZAX)
@Deprecated
public void disableSignedCommits() throws IOException {
requester().method("DELETE").withUrlPath(url + REQUIRE_SIGNATURES_URI).send();
}
Expand Down Expand Up @@ -85,7 +83,6 @@ public RequiredReviews getRequiredReviews() {
* the io exception
*/
@Preview(ZZZAX)
@Deprecated
public boolean getRequiredSignatures() throws IOException {
return requester().withUrlPath(url + REQUIRE_SIGNATURES_URI).fetch(RequiredSignatures.class).enabled;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/kohsuke/github/GHCheckRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ public static enum AnnotationLevel {
* @return a builder which you should customize, then call {@link GHCheckRunBuilder#create}
*/
@Preview(Previews.ANTIOPE)
@Deprecated
public @NonNull GHCheckRunBuilder update() {
return new GHCheckRunBuilder(owner, getId());
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/kohsuke/github/GHCheckRunBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
*/
@SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "Jackson serializes these even without a getter")
@Preview(Previews.ANTIOPE)
@Deprecated
public final class GHCheckRunBuilder {

protected final GHRepository repo;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/kohsuke/github/GHCommit.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ private GHUser resolveUser(User author) throws IOException {
* @return {@link PagedIterable} with the pull requests which contain this commit
*/
@Preview(GROOT)
@Deprecated
public PagedIterable<GHPullRequest> listPullRequests() {
return owner.root.createRequest()
.withPreview(GROOT)
Expand All @@ -470,7 +469,6 @@ public PagedIterable<GHPullRequest> listPullRequests() {
* the io exception
*/
@Preview(GROOT)
@Deprecated
public PagedIterable<GHBranch> listBranchesWhereHead() throws IOException {
return owner.root.createRequest()
.withPreview(GROOT)
Expand Down Expand Up @@ -566,7 +564,6 @@ public GHCommitStatus getLastStatus() throws IOException {
* on error
*/
@Preview(ANTIOPE)
@Deprecated
public PagedIterable<GHCheckRun> getCheckRuns() throws IOException {
return owner.getCheckRuns(sha);
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/kohsuke/github/GHCommitComment.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public void update(String body) throws IOException {
}

@Preview(SQUIRREL_GIRL)
@Deprecated
public GHReaction createReaction(ReactionContent content) throws IOException {
return owner.root.createRequest()
.method("POST")
Expand All @@ -134,7 +133,6 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
}

@Preview(SQUIRREL_GIRL)
@Deprecated
public PagedIterable<GHReaction> listReactions() {
return owner.root.createRequest()
.withPreview(SQUIRREL_GIRL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @see GitHub#searchCommits() GitHub#searchCommits()
*/
@Preview(Previews.CLOAK)
@Deprecated
public class GHCommitSearchBuilder extends GHSearchBuilder<GHCommit> {
GHCommitSearchBuilder(GitHub root) {
super(root, CommitSearchResult.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public GHCreateRepositoryBuilder owner(String owner) throws IOException {
* @see <a href="https://developer.github.com/v3/previews/">GitHub API Previews</a>
*/
@Preview(BAPTISTE)
@Deprecated
public GHCreateRepositoryBuilder fromTemplateRepository(String templateOwner, String templateRepo) {
requester.withPreview(BAPTISTE).withUrlPath("/repos/" + templateOwner + "/" + templateRepo + "/generate");
return this;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/kohsuke/github/GHDeployment.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public Object getPayloadObject() {
*
* @return the original deployment environment
*/
@Deprecated
@Preview(Previews.FLASH)
public String getOriginalEnvironment() {
return original_environment;
Expand All @@ -123,7 +122,6 @@ public String getEnvironment() {
*
* @return the environment is transient
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public boolean isTransientEnvironment() {
return transient_environment;
Expand All @@ -136,7 +134,6 @@ public boolean isTransientEnvironment() {
*
* @return the environment is used by end-users directly
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public boolean isProductionEnvironment() {
return production_environment;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/kohsuke/github/GHDeploymentBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public GHDeploymentBuilder environment(String environment) {
*
* @return the gh deployment builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) {
builder.with("transient_environment", transientEnvironment);
Expand All @@ -146,7 +145,6 @@ public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) {
*
* @return the gh deployment builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentBuilder productionEnvironment(boolean productionEnvironment) {
builder.with("production_environment", productionEnvironment);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/kohsuke/github/GHDeploymentState.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public enum GHDeploymentState {
*
* @deprecated until preview feature has graduated to stable
*/
@Deprecated
@Preview(Previews.FLASH)
IN_PROGRESS,

Expand All @@ -25,7 +24,6 @@ public enum GHDeploymentState {
*
* @deprecated until preview feature has graduated to stable
*/
@Deprecated
@Preview(Previews.FLASH)
QUEUED,

Expand All @@ -34,7 +32,6 @@ public enum GHDeploymentState {
*
* @deprecated until preview feature has graduated to stable
*/
@Deprecated
@Preview(Previews.ANT_MAN)
INACTIVE
}
2 changes: 0 additions & 2 deletions src/main/java/org/kohsuke/github/GHDeploymentStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public URL getTargetUrl() {
*
* @return the target url
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public URL getLogUrl() {
return GitHubClient.parseURL(log_url);
Expand All @@ -78,7 +77,6 @@ public URL getDeploymentUrl() {
*
* @return the deployment environment url
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public URL getEnvironmentUrl() {
return GitHubClient.parseURL(environment_url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeployme
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview({ Previews.ANT_MAN, Previews.FLASH })
public GHDeploymentStatusBuilder autoInactive(boolean autoInactive) {
this.builder.with("auto_inactive", autoInactive);
Expand Down Expand Up @@ -83,7 +82,6 @@ public GHDeploymentStatusBuilder description(String description) {
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.FLASH)
public GHDeploymentStatusBuilder environment(String environment) {
this.builder.with("environment", environment);
Expand All @@ -100,7 +98,6 @@ public GHDeploymentStatusBuilder environment(String environment) {
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) {
this.builder.with("environment_url", environmentUrl);
Expand All @@ -119,7 +116,6 @@ public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) {
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder logUrl(String logUrl) {
this.builder.with("log_url", logUrl);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/kohsuke/github/GHDiscussion.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ static PagedIterable<GHDiscussion> readAll(GHTeam team) throws IOException {
* @return a {@link GHDiscussion.Updater}
*/
@Preview(Previews.SQUIRREL_GIRL)
@Deprecated
public GHDiscussion.Updater update() {
return new GHDiscussion.Updater(this);
}
Expand All @@ -140,7 +139,6 @@ public GHDiscussion.Updater update() {
* @return a {@link GHDiscussion.Setter}
*/
@Preview(Previews.SQUIRREL_GIRL)
@Deprecated
public GHDiscussion.Setter set() {
return new GHDiscussion.Setter(this);
}
Expand Down
Loading

0 comments on commit 9978678

Please sign in to comment.