Skip to content

Commit cfcf81a

Browse files
committed
Followup cleanup based on root streamlining
1 parent 29b01f6 commit cfcf81a

File tree

70 files changed

+290
-631
lines changed

Some content is hidden

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

70 files changed

+290
-631
lines changed

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,6 @@ public void setPermissions(Map<String, String> permissions) {
183183
throw new RuntimeException("Do not use this method.");
184184
}
185185

186-
GHApp wrapUp(GitHub root) {
187-
return this;
188-
}
189-
190186
/**
191187
* Obtains all the installations associated with this app.
192188
* <p>
@@ -200,7 +196,7 @@ public PagedIterable<GHAppInstallation> listInstallations() {
200196
return root().createRequest()
201197
.withPreview(MACHINE_MAN)
202198
.withUrlPath("/app/installations")
203-
.toIterable(GHAppInstallation[].class, item -> item.wrapUp(root()));
199+
.toIterable(GHAppInstallation[].class, null);
204200
}
205201

206202
/**
@@ -220,8 +216,7 @@ public GHAppInstallation getInstallationById(long id) throws IOException {
220216
return root().createRequest()
221217
.withPreview(MACHINE_MAN)
222218
.withUrlPath(String.format("/app/installations/%d", id))
223-
.fetch(GHAppInstallation.class)
224-
.wrapUp(root());
219+
.fetch(GHAppInstallation.class);
225220
}
226221

227222
/**
@@ -242,8 +237,7 @@ public GHAppInstallation getInstallationByOrganization(String name) throws IOExc
242237
return root().createRequest()
243238
.withPreview(MACHINE_MAN)
244239
.withUrlPath(String.format("/orgs/%s/installation", name))
245-
.fetch(GHAppInstallation.class)
246-
.wrapUp(root());
240+
.fetch(GHAppInstallation.class);
247241
}
248242

249243
/**
@@ -266,8 +260,7 @@ public GHAppInstallation getInstallationByRepository(String ownerName, String re
266260
return root().createRequest()
267261
.withPreview(MACHINE_MAN)
268262
.withUrlPath(String.format("/repos/%s/%s/installation", ownerName, repositoryName))
269-
.fetch(GHAppInstallation.class)
270-
.wrapUp(root());
263+
.fetch(GHAppInstallation.class);
271264
}
272265

273266
/**
@@ -287,8 +280,7 @@ public GHAppInstallation getInstallationByUser(String name) throws IOException {
287280
return root().createRequest()
288281
.withPreview(MACHINE_MAN)
289282
.withUrlPath(String.format("/users/%s/installation", name))
290-
.fetch(GHAppInstallation.class)
291-
.wrapUp(root());
283+
.fetch(GHAppInstallation.class);
292284
}
293285

294286
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public GHAppInstallationToken create() throws IOException {
7878
return builder.method("POST")
7979
.withPreview(MACHINE_MAN)
8080
.withUrlPath(apiUrlTail)
81-
.fetch(GHAppInstallationToken.class)
82-
.wrapUp(root());
81+
.fetch(GHAppInstallationToken.class);
8382
}
8483

8584
}

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ private static class GHAppInstallationRepositoryResult extends SearchResult<GHRe
137137

138138
@Override
139139
GHRepository[] getItems(GitHub root) {
140-
for (GHRepository item : repositories)
141-
item.wrap(root);
140+
for (GHRepository item : repositories) {
141+
}
142142
return repositories;
143143
}
144144
}
@@ -304,10 +304,6 @@ public void setRepositorySelection(GHRepositorySelection repositorySelection) {
304304
throw new RuntimeException("Do not use this method.");
305305
}
306306

307-
GHAppInstallation wrapUp(GitHub root) {
308-
return this;
309-
}
310-
311307
/**
312308
* Delete a Github App installation
313309
* <p>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,4 @@ public Date getExpiresAt() throws IOException {
131131
private Object expiresAtStr(Date id, Class type) {
132132
return expires_at;
133133
}
134-
135-
GHAppInstallationToken wrapUp(GitHub root) {
136-
return this;
137-
}
138134
}

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,8 @@ private String getApiRoute() {
130130

131131
GHArtifact wrapUp(GHRepository owner) {
132132
this.owner = owner;
133-
return wrapUp(owner.root());
134-
}
135-
136-
GHArtifact wrapUp(GitHub root) {
137-
if (owner != null)
138-
owner.wrap(root);
133+
this.owner = owner;
139134
return this;
140135
}
136+
141137
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ private String getApiRoute() {
147147

148148
GHAsset wrap(GHRelease release) {
149149
this.owner = release.getOwner();
150-
owner.root();
151150
return this;
152151
}
153152

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ public String getFingerprint() {
146146
return fingerprint;
147147
}
148148

149-
GHAuthorization wrap(GitHub root) {
150-
return this;
151-
}
152-
153149
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" },
154150
justification = "JSON API")
155151
private static class App {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ public GHBranchProtection getProtection() throws IOException {
9797
return root().createRequest()
9898
.withPreview(Previews.LUKE_CAGE)
9999
.setRawUrlPath(protection_url)
100-
.fetch(GHBranchProtection.class)
101-
.wrap(this);
100+
.fetch(GHBranchProtection.class);
102101
}
103102

104103
/**
@@ -222,7 +221,6 @@ public String toString() {
222221

223222
GHBranch wrap(GHRepository repo) {
224223
this.owner = repo;
225-
repo.root();
226224
return this;
227225
}
228226
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ public String getUrl() {
115115
return url;
116116
}
117117

118-
GHBranchProtection wrap(GHBranch branch) {
119-
branch.root();
120-
return this;
121-
}
122-
123118
private Requester requester() {
124119
return root().createRequest().withPreview(ZZZAX);
125120
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public GHBranchProtection enable() throws IOException {
9494
.withNullable("restrictions", restrictions)
9595
.withNullable("enforce_admins", enforceAdmins)
9696
.withUrlPath(branch.getProtectionUrl().toString())
97-
.fetch(GHBranchProtection.class)
98-
.wrap(branch);
97+
.fetch(GHBranchProtection.class);
9998
}
10099

101100
/**

0 commit comments

Comments
 (0)