Skip to content

Commit 6b2c4ff

Browse files
committed
#1807: Fix typo in README.md and improve code formatting in Bulk.java.
1 parent f527c63 commit 6b2c4ff

17 files changed

Lines changed: 53 additions & 38 deletions

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# GitHub API Object-Oriented Java Client
2+
13
[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
24
[![DevOps By Rultor.com](https://www.rultor.com/b/jcabi/jcabi-github)](https://www.rultor.com/p/jcabi/jcabi-github)
35
[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)
@@ -14,7 +16,7 @@ This is a Java adapter to the [GitHub RESTful API].
1416
There are a few other similar implementations on the market,
1517
but jcabi-github has a very strong focus on
1618
object-oriented principles of programming. On top of that,
17-
we have a unique implemenation of GitHub server-side functionality,
19+
we have a unique implementation of GitHub server-side functionality,
1820
which you can use in your unit tests, eliminating the necessity to connect
1921
to GitHub during unit/integration testing.
2022
Please, read the blog post
@@ -126,7 +128,8 @@ a new GitHub OAuth access tokens
126128
and provide them in command line, like this:
127129

128130
```bash
129-
mvn clean install -Dit.test=RtGistITCase -Dfailsafe.github.key=<token> -Dfailsafe.github.key.second=<second-token> -Dfailsafe.github.repo=<repo>
131+
mvn clean install -Dit.test=RtGistITCase -Dfailsafe.github.key=<token> \
132+
-Dfailsafe.github.key.second=<second-token> -Dfailsafe.github.repo=<repo>
130133
```
131134

132135
Replace `<token>` and `<second-token>` with the OAuth access tokens

src/main/java/com/jcabi/github/Bulk.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ public Bulk(final Iterable<T> items) {
7777
} else {
7878
try {
7979
result = method.invoke(item, args);
80-
} catch (final IllegalAccessException | InvocationTargetException ex) {
80+
} catch (
81+
final IllegalAccessException
82+
| InvocationTargetException ex
83+
) {
8184
throw new IllegalStateException(ex);
8285
}
8386
}

src/main/java/com/jcabi/github/Repos.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ Iterable<Repo> iterate(
9393
@SuppressWarnings("PMD.TooManyMethods")
9494
@ToString
9595
@Loggable(Loggable.DEBUG)
96-
@EqualsAndHashCode(of = {"nam", "priv", "descr", "home", "init"})
96+
@EqualsAndHashCode(of = {"repo", "priv", "descr", "home", "init"})
9797
final class RepoCreate implements JsonReadable {
9898
/**
9999
* Name of the new repo.
100100
*/
101-
private final transient String nam;
101+
private final transient String repo;
102102

103103
/**
104104
* Privateness of the new repo.
@@ -164,7 +164,7 @@ private RepoCreate(
164164
if (nme.isEmpty()) {
165165
throw new IllegalArgumentException("Name cannot be empty!");
166166
}
167-
this.nam = nme;
167+
this.repo = nme;
168168
this.priv = prvt;
169169
this.descr = desc;
170170
this.home = page;
@@ -178,7 +178,7 @@ private RepoCreate(
178178
* @return Name
179179
*/
180180
public String name() {
181-
return this.nam;
181+
return this.repo;
182182
}
183183

184184
/**
@@ -250,7 +250,7 @@ public Repos.RepoCreate withName(
250250
*/
251251
public Repos.RepoCreate withPrivacy(final boolean privacy) {
252252
return new Repos.RepoCreate(
253-
this.nam,
253+
this.repo,
254254
privacy,
255255
this.descr,
256256
this.home,
@@ -268,7 +268,7 @@ public Repos.RepoCreate withDescription(
268268
final String desc
269269
) {
270270
return new Repos.RepoCreate(
271-
this.nam,
271+
this.repo,
272272
this.priv,
273273
desc,
274274
this.home,
@@ -286,7 +286,7 @@ public Repos.RepoCreate withHomepage(
286286
final String page
287287
) {
288288
return new Repos.RepoCreate(
289-
this.nam,
289+
this.repo,
290290
this.priv,
291291
this.descr,
292292
page,
@@ -302,7 +302,7 @@ public Repos.RepoCreate withHomepage(
302302
*/
303303
public Repos.RepoCreate withAutoInit(final Optional<Boolean> auto) {
304304
return new Repos.RepoCreate(
305-
this.nam,
305+
this.repo,
306306
this.priv,
307307
this.descr,
308308
this.home,
@@ -318,7 +318,7 @@ public Repos.RepoCreate withAutoInit(final Optional<Boolean> auto) {
318318
*/
319319
public Repos.RepoCreate withAutoInit(final boolean auto) {
320320
return new Repos.RepoCreate(
321-
this.nam,
321+
this.repo,
322322
this.priv,
323323
this.descr,
324324
this.home,
@@ -334,7 +334,7 @@ public Repos.RepoCreate withAutoInit(final boolean auto) {
334334
*/
335335
public Repos.RepoCreate withOrganization(final String org) {
336336
return new Repos.RepoCreate(
337-
this.nam,
337+
this.repo,
338338
this.priv,
339339
this.descr,
340340
this.home,
@@ -362,7 +362,7 @@ public Repos.RepoCreate with(final String key, final JsonValue value) {
362362
@Override
363363
public JsonObject json() {
364364
JsonObjectBuilder builder = Json.createObjectBuilder()
365-
.add("name", this.nam)
365+
.add("name", this.repo)
366366
.add("description", this.descr)
367367
.add("homepage", this.home)
368368
.add("private", this.priv);

src/main/java/com/jcabi/github/RtBranch.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
@Immutable
1717
@Loggable(Loggable.DEBUG)
18-
@EqualsAndHashCode(of = { "entry", "owner", "nam", "hash" })
18+
@EqualsAndHashCode(of = { "entry", "owner", "branch", "hash" })
1919
public final class RtBranch implements Branch {
2020
/**
2121
* API entry point.
@@ -30,7 +30,7 @@ public final class RtBranch implements Branch {
3030
/**
3131
* Name of this branch.
3232
*/
33-
private final transient String nam;
33+
private final transient String branch;
3434

3535
/**
3636
* Commit SHA hash.
@@ -52,7 +52,7 @@ public final class RtBranch implements Branch {
5252
final String sha) {
5353
this.entry = req;
5454
this.owner = repo;
55-
this.nam = nom;
55+
this.branch = nom;
5656
this.hash = sha;
5757
}
5858

@@ -63,7 +63,7 @@ public Repo repo() {
6363

6464
@Override
6565
public String name() {
66-
return this.nam;
66+
return this.branch;
6767
}
6868

6969
@Override

src/main/java/com/jcabi/github/RtHooks.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ public Hook create(
101101
for (final Map.Entry<String, String> entr : config.entrySet()) {
102102
configs.add(entr.getKey(), entr.getValue());
103103
}
104-
final JsonArrayBuilder evnts = Json.createArrayBuilder();
104+
final JsonArrayBuilder builder = Json.createArrayBuilder();
105105
for (final Event event : events) {
106-
evnts.add(event.toString());
106+
builder.add(event.toString());
107107
}
108108
final JsonStructure json = Json.createObjectBuilder()
109109
.add("name", name)
110110
.add("config", configs)
111111
.add("active", active)
112-
.add("events", evnts)
112+
.add("events", builder)
113113
.build();
114114
return this.get(
115115
this.request.method(Request.POST)

src/main/java/com/jcabi/github/RtSearchPagination.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,12 @@ public <T extends Response> T as(final Class<T> type) {
211211
try {
212212
return type.getDeclaredConstructor(Response.class)
213213
.newInstance(this);
214-
} catch (final InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
214+
} catch (
215+
final InstantiationException
216+
| IllegalAccessException
217+
| InvocationTargetException
218+
| NoSuchMethodException ex
219+
) {
215220
throw new IllegalStateException(ex);
216221
}
217222
}

src/main/java/com/jcabi/github/Smarts.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ public void remove() {
8282
private static <X> X wrap(final Object object) {
8383
try {
8484
return (X) Smarts.type(object).newInstance(object);
85-
} catch (final InvocationTargetException | InstantiationException | IllegalAccessException ex) {
85+
} catch (
86+
final InvocationTargetException
87+
| InstantiationException
88+
| IllegalAccessException ex
89+
) {
8690
throw new IllegalStateException(ex);
8791
}
8892
}

src/main/java/com/jcabi/github/mock/MkBranch.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public final class MkBranch implements Branch {
3333
/**
3434
* Branch name.
3535
*/
36-
private final transient String nam;
36+
private final transient String branch;
3737

3838
/**
3939
* Commit sha.
@@ -61,7 +61,7 @@ public final class MkBranch implements Branch {
6161
this.storage = stg;
6262
this.self = login;
6363
this.coords = rep;
64-
this.nam = nom;
64+
this.branch = nom;
6565
this.hash = sha;
6666
}
6767

@@ -72,7 +72,7 @@ public Repo repo() {
7272

7373
@Override
7474
public String name() {
75-
return this.nam;
75+
return this.branch;
7676
}
7777

7878
@Override

src/main/java/com/jcabi/github/mock/MkStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private static File temp() throws IOException {
160160
}
161161

162162
/**
163-
* Syncronized.
163+
* Synchronized.
164164
* @since 0.5
165165
*/
166166
@Immutable

src/main/java/com/jcabi/github/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
*/
55

66
/**
7-
* Object Oriented GitHub API.
7+
* Object-Oriented GitHub API.
88
*
99
* <p>The only dependency you need is (check our latest version available
1010
* at <a href="http://github.jcabi.com">github.jcabi.com</a>):
1111
*
12-
* <pre>&lt;depedency&gt;
12+
* <pre>&lt;dependency&gt;
1313
* &lt;groupId&gt;com.jcabi&lt;/groupId&gt;
1414
* &lt;artifactId&gt;jcabi-github&lt;/artifactId&gt;
1515
* &lt;/dependency&gt;</pre>

0 commit comments

Comments
 (0)