Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6e48cc

Browse filesBrowse files
committed
Use GHObject as much as we can
1 parent 50f43cc commit b6e48cc
Copy full SHA for b6e48cc

File tree

Expand file treeCollapse file tree

8 files changed

+24
-125
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+24
-125
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<plugin>
3636
<groupId>com.infradna.tool</groupId>
3737
<artifactId>bridge-method-injector</artifactId>
38-
<version>1.12</version>
38+
<version>1.14</version>
3939
<executions>
4040
<execution>
4141
<goals>
@@ -77,7 +77,7 @@
7777
<dependency>
7878
<groupId>com.infradna.tool</groupId>
7979
<artifactId>bridge-method-annotation</artifactId>
80-
<version>1.12</version>
80+
<version>1.14</version>
8181
</dependency>
8282
<dependency>
8383
<groupId>org.kohsuke.stapler</groupId>

‎src/main/java/org/kohsuke/github/GHCommitComment.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCommitComment.java
+2-16Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
* @see GHCommit#listComments()
1313
* @see GHCommit#createComment(String, String, Integer, Integer)
1414
*/
15-
public class GHCommitComment {
15+
public class GHCommitComment extends GHObject {
1616
private GHRepository owner;
1717

18-
String updated_at, created_at;
19-
String body, url, html_url, commit_id;
18+
String body, html_url, commit_id;
2019
Integer line;
21-
int id;
2220
String path;
2321
User user;
2422

@@ -32,14 +30,6 @@ public GHRepository getOwner() {
3230
return owner;
3331
}
3432

35-
public Date getCreatedAt() {
36-
return GitHub.parseDate(created_at);
37-
}
38-
39-
public Date getUpdatedAt() {
40-
return GitHub.parseDate(updated_at);
41-
}
42-
4333
/**
4434
* URL like 'https://github.com/kohsuke/sandbox-ant/commit/8ae38db0ea5837313ab5f39d43a6f73de3bd9000#commitcomment-1252827' to
4535
* show this commit comment in a browser.
@@ -75,10 +65,6 @@ public int getLine() {
7565
return line!=null ? line : -1;
7666
}
7767

78-
public int getId() {
79-
return id;
80-
}
81-
8268
/**
8369
* Gets the user who put this comment.
8470
*/

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCommitStatus.java
+1-23Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
* @see GHRepository#getCommitStatus(String)
1111
* @see GHCommit#getStatus()
1212
*/
13-
public class GHCommitStatus {
14-
String created_at, updated_at;
13+
public class GHCommitStatus extends GHObject {
1514
String state;
1615
String target_url,description;
17-
int id;
18-
String url;
1916
String context;
2017
GHUser creator;
2118

@@ -27,14 +24,6 @@ public class GHCommitStatus {
2724
return this;
2825
}
2926

30-
public Date getCreatedAt() {
31-
return GitHub.parseDate(created_at);
32-
}
33-
34-
public Date getUpdatedAt() {
35-
return GitHub.parseDate(updated_at);
36-
}
37-
3827
public GHCommitState getState() {
3928
for (GHCommitState s : GHCommitState.values()) {
4029
if (s.name().equalsIgnoreCase(state))
@@ -56,17 +45,6 @@ public String getDescription() {
5645
return description;
5746
}
5847

59-
public int getId() {
60-
return id;
61-
}
62-
63-
/**
64-
* API URL of this commit status.
65-
*/
66-
public String getUrl() {
67-
return url;
68-
}
69-
7048
public GHUser getCreator() {
7149
return creator;
7250
}

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHIssue.java
+3-13Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @author Eric Maupin
3939
* @author Kohsuke Kawaguchi
4040
*/
41-
public class GHIssue {
41+
public class GHIssue extends GHObject {
4242
GitHub root;
4343
GHRepository owner;
4444

@@ -51,11 +51,9 @@ public class GHIssue {
5151
protected String body;
5252
protected List<Label> labels;
5353
protected GHUser user;
54-
protected String title, created_at, html_url;
54+
protected String title, html_url;
5555
protected GHIssue.PullRequest pull_request;
5656
protected GHMilestone milestone;
57-
protected String url, updated_at;
58-
protected int id;
5957
protected GHUser closed_by;
6058

6159
public static class Label {
@@ -117,7 +115,7 @@ public int getNumber() {
117115
* The HTML page of this issue,
118116
* like https://github.com/jenkinsci/jenkins/issues/100
119117
*/
120-
public URL getUrl() {
118+
public URL getHtmlUrl() {
121119
return GitHub.parseURL(html_url);
122120
}
123121

@@ -136,14 +134,6 @@ public Collection<Label> getLabels() throws IOException {
136134
return Collections.unmodifiableList(labels);
137135
}
138136

139-
public Date getCreatedAt() {
140-
return GitHub.parseDate(created_at);
141-
}
142-
143-
public Date getUpdatedAt() {
144-
return GitHub.parseDate(updated_at);
145-
}
146-
147137
public Date getClosedAt() {
148138
return GitHub.parseDate(closed_at);
149139
}

‎src/main/java/org/kohsuke/github/GHIssueComment.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHIssueComment.java
+2-20Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@
3232
*
3333
* @author Kohsuke Kawaguchi
3434
*/
35-
public class GHIssueComment {
35+
public class GHIssueComment extends GHObject {
3636
GHIssue owner;
3737

38-
private String body, gravatar_id, created_at, updated_at;
39-
private URL url;
40-
private int id;
38+
private String body, gravatar_id;
4139
private GHUser user;
4240

4341
/*package*/ GHIssueComment wrapUp(GHIssue owner) {
@@ -59,22 +57,6 @@ public String getBody() {
5957
return body;
6058
}
6159

62-
public Date getCreatedAt() {
63-
return GitHub.parseDate(created_at);
64-
}
65-
66-
public Date getUpdatedAt() {
67-
return GitHub.parseDate(updated_at);
68-
}
69-
70-
public int getId() {
71-
return id;
72-
}
73-
74-
public URL getUrl() {
75-
return url;
76-
}
77-
7860
/**
7961
* Gets the ID of the user who posted this comment.
8062
*/

‎src/main/java/org/kohsuke/github/GHMilestone.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHMilestone.java
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* @author Yusuke Kokubo
1010
*
1111
*/
12-
public class GHMilestone {
12+
public class GHMilestone extends GHObject {
1313
GitHub root;
1414
GHRepository owner;
1515

1616
GHUser creator;
17-
private String state, due_on, title, url, created_at, description;
17+
private String state, due_on, title, description;
1818
private int closed_issues, open_issues, number;
1919

2020
public GitHub getRoot() {
@@ -38,14 +38,6 @@ public String getTitle() {
3838
return title;
3939
}
4040

41-
public String getUrl() {
42-
return url;
43-
}
44-
45-
public Date getCreatedAt() {
46-
return GitHub.parseDate(created_at);
47-
}
48-
4941
public String getDescription() {
5042
return description;
5143
}

‎src/main/java/org/kohsuke/github/GHPerson.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPerson.java
+11-13Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.IOException;
55
import java.util.Arrays;
66
import java.util.Collections;
7+
import java.util.Date;
78
import java.util.Iterator;
89
import java.util.List;
910
import java.util.Map;
@@ -14,15 +15,14 @@
1415
*
1516
* @author Kohsuke Kawaguchi
1617
*/
17-
public abstract class GHPerson {
18+
public abstract class GHPerson extends GHObject {
1819
/*package almost final*/ GitHub root;
1920

2021
// core data fields that exist even for "small" user data (such as the user info in pull request)
21-
protected String login, avatar_url, url, gravatar_id;
22-
protected int id;
22+
protected String login, avatar_url, gravatar_id;
2323

2424
// other fields (that only show up in full data)
25-
protected String location,blog,email,name,created_at,company;
25+
protected String location,blog,email,name,company;
2626
protected String html_url;
2727
protected int followers,following,public_repos,public_gists;
2828

@@ -196,9 +196,14 @@ public String getLocation() throws IOException {
196196
return location;
197197
}
198198

199-
public String getCreatedAt() throws IOException {
199+
public Date getCreatedAt() throws IOException {
200200
populate();
201-
return created_at;
201+
return super.getCreatedAt();
202+
}
203+
204+
public Date getUpdatedAt() throws IOException {
205+
populate();
206+
return super.getCreatedAt();
202207
}
203208

204209
/**
@@ -236,13 +241,6 @@ public int getFollowingCount() throws IOException {
236241
return following;
237242
}
238243

239-
/**
240-
* What appears to be a GitHub internal unique number that identifies this user.
241-
*/
242-
public int getId() {
243-
return id;
244-
}
245-
246244
public int getFollowersCount() throws IOException {
247245
populate();
248246
return followers;

‎src/main/java/org/kohsuke/github/GHRelease.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRelease.java
+1-28Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@
1515
* @see GHRepository#getReleases()
1616
* @see GHRepository#createRelease(String)
1717
*/
18-
public class GHRelease {
18+
public class GHRelease extends GHObject {
1919
GitHub root;
2020
GHRepository owner;
2121

22-
private String url;
2322
private String html_url;
2423
private String assets_url;
2524
private String upload_url;
26-
private long id;
2725
private String tag_name;
2826
private String target_commitish;
2927
private String name;
3028
private String body;
3129
private boolean draft;
3230
private boolean prerelease;
33-
private Date created_at;
3431
private Date published_at;
3532
private String tarball_url;
3633
private String zipball_url;
@@ -51,14 +48,6 @@ public void setBody(String body) {
5148
this.body = body;
5249
}
5350

54-
public Date getCreatedAt() {
55-
return created_at;
56-
}
57-
58-
public void setCreatedAt(Date created_at) {
59-
this.created_at = created_at;
60-
}
61-
6251
public boolean isDraft() {
6352
return draft;
6453
}
@@ -75,14 +64,6 @@ public void setHtmlUrl(String html_url) {
7564
this.html_url = html_url;
7665
}
7766

78-
public long getId() {
79-
return id;
80-
}
81-
82-
public void setId(long id) {
83-
this.id = id;
84-
}
85-
8667
public String getName() {
8768
return name;
8869
}
@@ -147,14 +128,6 @@ public void setUploadUrl(String upload_url) {
147128
this.upload_url = upload_url;
148129
}
149130

150-
public String getUrl() {
151-
return url;
152-
}
153-
154-
public void setUrl(String url) {
155-
this.url = url;
156-
}
157-
158131
public String getZipballUrl() {
159132
return zipball_url;
160133
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.