Skip to content

Commit 3dd2d16

Browse files
committed
Spelling mistakes
1 parent 0af531b commit 3dd2d16

File tree

5 files changed

+56
-32
lines changed

5 files changed

+56
-32
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@
77
*.jar
88
*.war
99
*.ear
10+
11+
# Eclipse IDE
1012
/.classpath
1113
/.project
1214
/.settings/org.eclipse.core.resources.prefs
1315
/.settings/org.eclipse.jdt.core.prefs
1416
/.settings/org.eclipse.m2e.core.prefs
1517
/.settings/org.eclipse.jdt.ui.prefs
18+
19+
# Netbeans IDE
1620
/nbactions.xml
1721
/nbactions-ci.xml
22+
23+
# IntiliJ IDE
24+
25+
/*.iml
26+
/.idea
27+

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This small library holds a set of Exceptions that implements idea of fast, reusa
66

77
## Caution
88

9-
This classes shouldn't be used in any public API or library. It is designed to be used for in-house development of end user applications which will report Bugs in standarized error pages or post them to issue tracker.
9+
This classes shouldn't be used in any public API or library. It is designed to be used for in-house development of end user applications which will report Bugs in standardized error pages or post them to issue tracker.
1010

1111
## Requirements
1212

@@ -69,7 +69,7 @@ try {
6969

7070
#### Functional try to execute blocks
7171

72-
Using functional blocks to handle operations, that are intended to operate properly, simplify the code and makes it more readable. It's also good way to deal with untested, uncovered `catch` blocks. It's easy and gives developers nice way of dealing with countless operations that supose to work as intended.
72+
Using functional blocks to handle operations, that are intended to operate properly, simplify the code and makes it more readable. It's also good way to deal with untested, uncovered `catch` blocks. It's easy and gives developers nice way of dealing with countless operations that suppose to work as intended.
7373

7474
Example:
7575

@@ -82,7 +82,21 @@ InputStream is = EidPreconditions.tryToExecute(new RiskyCode<InputStream>() {
8282
}
8383
}, "20150718:121521");
8484
```
85-
85+
86+
###Contributing
87+
88+
Contributions are welcome!
89+
90+
To contribute, follow the standard [git flow](http://danielkummer.github.io/git-flow-cheatsheet/) of:
91+
92+
1. Fork it
93+
1. Create your feature branch (`git checkout -b feature/my-new-feature`)
94+
1. Commit your changes (`git commit -am 'Add some feature'`)
95+
1. Push to the branch (`git push origin feature/my-new-feature`)
96+
1. Create new Pull Request
97+
98+
Even if you can't contribute code, if you have an idea for an improvement please open an [issue](https://github.com/wavesoftware/java-eid-exceptions/issues).
99+
86100
### Releases
87101

88-
- 0.1.0 (idea imported from Guava Library and COI code)
102+
- 0.1.0 (idea imported from Guava Library and COI code)

src/main/java/pl/wavesoftware/eid/exceptions/Eid.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
/**
2626
* <strong>This class shouldn't be used in any public API or library.</strong> It is designed to be used for in-house development
27-
* of end user applications which will report Bugs in standarized error pages or post them to issue tracker.
27+
* of end user applications which will report Bugs in standardized error pages or post them to issue tracker.
2828
* <p>
2929
* Exception identifier for all Eid Runtime Exceptions.
3030
*
@@ -65,7 +65,7 @@ public class Eid implements Serializable {
6565
/**
6666
* Constructor
6767
*
68-
* @param id the exception id, must be unique developer insereted string, from date
68+
* @param id the exception id, must be unique developer inserted string, from date
6969
* @param ref an optional reference
7070
*/
7171
public Eid(String id, @Nullable String ref) {
@@ -77,7 +77,7 @@ public Eid(String id, @Nullable String ref) {
7777
/**
7878
* Constructor
7979
*
80-
* @param id the exception id, must be unique developer insereted string, from date
80+
* @param id the exception id, must be unique developer inserted string, from date
8181
*/
8282
public Eid(String id) {
8383
this(id, null);
@@ -127,7 +127,7 @@ public static UniqIdGenerator setUniqIdGenerator(UniqIdGenerator uniqIdGenerator
127127
}
128128

129129
/**
130-
* Sets the actual format that will be used in {@link toString()} method. It will return previously used format.
130+
* Sets the actual format that will be used in {@link #toString()} method. It will return previously used format.
131131
*
132132
* @param format a format compliant with {@link String#format(String, Object...)} with 2 object arguments
133133
* @return a previously used format
@@ -142,7 +142,7 @@ public static String setFormat(String format) {
142142
}
143143

144144
/**
145-
* Sets the actual format that will be used in {@link toString()} method
145+
* Sets the actual format that will be used in {@link #toString()} method
146146
*
147147
* @param refFormat a format compliant with {@link String#format(String, Object...)} with 3 object arguments
148148
* @return a previously used format
@@ -151,9 +151,9 @@ public static String setFormat(String format) {
151151
*/
152152
public static String setRefFormat(String refFormat) {
153153
validateFormat(refFormat, REF_FORMAT_NUM_SPEC);
154-
String prevoiusly = Eid.refFormat;
154+
String previously = Eid.refFormat;
155155
Eid.refFormat = refFormat;
156-
return prevoiusly;
156+
return previously;
157157
}
158158

159159
@Override
@@ -183,39 +183,39 @@ public String getRef() {
183183
}
184184

185185
/**
186-
* Gets uniq generated string for this instance of Eid
186+
* Gets unique generated string for this instance of Eid
187187
*
188-
* @return a uniq string
188+
* @return a unique string
189189
*/
190190
public String getUniq() {
191191
return uniq;
192192
}
193193

194194
static void validateFormat(String format, int numSpecifiers) {
195195
if (format == null) {
196-
throw new IllegalArgumentException("Format can't be null, but just recieved one");
196+
throw new IllegalArgumentException("Format can't be null, but just received one");
197197
}
198198
List<String> specifiers = new ArrayList<>();
199199
for (int i = 0; i < numSpecifiers; i++) {
200200
specifiers.add(i + "-test-id");
201201
}
202-
String formated = String.format(format, specifiers.toArray());
202+
String formatted = String.format(format, specifiers.toArray());
203203
for (String specifier : specifiers) {
204-
if (!formated.contains(specifier)) {
204+
if (!formatted.contains(specifier)) {
205205
throw new IllegalArgumentException("Given format contains to little format specifiers, "
206206
+ "expected " + numSpecifiers + " but given \"" + format + "\"");
207207
}
208208
}
209209
}
210210

211211
/**
212-
* It is used to generate unique ID for each EID object. It's mustn't be secure becouse it just indicate EID object while
212+
* It is used to generate unique ID for each EID object. It's mustn't be secure because it just indicate EID object while
213213
* logging.
214214
*/
215215
public interface UniqIdGenerator {
216216

217217
/**
218-
* Generates a uniq string ID
218+
* Generates a unique string ID
219219
*
220220
* @return a generated unique ID
221221
*/

src/main/java/pl/wavesoftware/eid/utils/EidPreconditions.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* <strong>This class shouldn't be used in any public API or library.</strong> It is designed to be used for in-house development
29-
* of end user applications which will report Bugs in standarized error pages or post them to issue tracker.
29+
* of end user applications which will report Bugs in standardized error pages or post them to issue tracker.
3030
* <p>
3131
* Static convenience methods that help a method or constructor check whether it was invoked correctly (whether its
3232
* <i>preconditions</i>
@@ -175,7 +175,7 @@ public static void checkState(@Nonnull boolean expression, @Nonnull Eid eid) {
175175
/**
176176
* Ensures that an object reference passed as a parameter to the calling method is not null.
177177
*
178-
* @param <T>
178+
* @param <T> type of object reference being checked
179179
* @param reference an object reference
180180
* @param eid the exception message to use if the check fails; will be converted to a string using
181181
* {@link String#valueOf(Object)}
@@ -194,7 +194,7 @@ public static <T> T checkNotNull(@Nullable T reference, @Nonnull String eid) {
194194
/**
195195
* Ensures that an object reference passed as a parameter to the calling method is not null.
196196
*
197-
* @param <T>
197+
* @param <T> type of object reference being checked
198198
* @param reference an object reference
199199
* @param eid the exception message to use if the check fails; will be converted to a string using
200200
* {@link String#valueOf(Object)}
@@ -259,7 +259,7 @@ public static int checkElementIndex(int index, int size, @Nonnull Eid eid) {
259259
}
260260

261261
/**
262-
* Tries to execute code in given block, and if exception is thrown, it will gets retrown as a {@link EidRuntimeException}
262+
* Tries to execute code in given block, and if exception is thrown, it will gets rethrown as a {@link EidRuntimeException}
263263
* with eid given as a argument
264264
* <p>
265265
* Example:
@@ -276,7 +276,7 @@ public static int checkElementIndex(int index, int size, @Nonnull Eid eid) {
276276
*
277277
* @param <R> return type
278278
* @param code code to be executed within a try-catch block
279-
* @param eid uniq developer identifier from date for ex.: "20150716:123200"
279+
* @param eid unique developer identifier from date for ex.: "20150716:123200"
280280
* @return A block of code return type, if exception is not thrown
281281
* @throws EidRuntimeException if code block thrown any exception, which in that case is wrapped in EidRuntimeException
282282
*/
@@ -295,7 +295,7 @@ public static <R> R tryToExecute(@Nonnull RiskyCode<R> code, @Nonnull String eid
295295
}
296296

297297
/**
298-
* Tries to execute code in given block, and if exception is thrown, it will gets retrown as a {@link EidRuntimeException}
298+
* Tries to execute code in given block, and if exception is thrown, it will gets rethrown as a {@link EidRuntimeException}
299299
* with eid given as a argument
300300
* <p>
301301
* Example:
@@ -312,7 +312,7 @@ public static <R> R tryToExecute(@Nonnull RiskyCode<R> code, @Nonnull String eid
312312
*
313313
* @param <R> return type
314314
* @param code code to be executed within a try-catch block
315-
* @param eid uniq developer identifier from date for ex.: "20150716:123200"
315+
* @param eid unique developer identifier from date for ex.: "20150716:123200"
316316
* @return A block of code return type, if exception is not thrown
317317
* @throws EidRuntimeException if code block thrown any exception, which in that case is wrapped in EidRuntimeException
318318
*/
@@ -341,7 +341,7 @@ public interface RiskyCode<R> {
341341
* Executes a client code
342342
*
343343
* @return a object of client code
344-
* @throws Exception this exception sould be set to concrete one
344+
* @throws Exception this exception should be set to concrete one
345345
*/
346346
@SuppressWarnings({
347347
"pmd:SignatureDeclareThrowsException",

src/test/java/pl/wavesoftware/eid/exceptions/EidTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testSetMessageFormat_Null() {
3838
String format = null;
3939
// then
4040
thrown.expect(IllegalArgumentException.class);
41-
thrown.expectMessage("Format can't be null, but just recieved one");
41+
thrown.expectMessage("Format can't be null, but just received one");
4242
// when
4343
Eid.setMessageFormat(format);
4444
} finally {
@@ -74,11 +74,11 @@ public String generateUniqId() {
7474
}
7575
};
7676
// when
77-
UniqIdGenerator prevoius = Eid.setUniqIdGenerator(generator);
78-
UniqIdGenerator set = Eid.setUniqIdGenerator(prevoius);
77+
UniqIdGenerator previous = Eid.setUniqIdGenerator(generator);
78+
UniqIdGenerator set = Eid.setUniqIdGenerator(previous);
7979
// then
8080
assertThat(set).isSameAs(generator);
81-
assertThat(prevoius).isSameAs(Eid.DEFAULT_UNIQ_ID_GENERATOR);
81+
assertThat(previous).isSameAs(Eid.DEFAULT_UNIQ_ID_GENERATOR);
8282
} finally {
8383
Eid.setUniqIdGenerator(Eid.DEFAULT_UNIQ_ID_GENERATOR);
8484
}
@@ -106,7 +106,7 @@ public void testSetFormat_Null() {
106106
String format = null;
107107
// then
108108
thrown.expect(IllegalArgumentException.class);
109-
thrown.expectMessage("Format can't be null, but just recieved one");
109+
thrown.expectMessage("Format can't be null, but just received one");
110110
// when
111111
Eid.setFormat(format);
112112
} finally {
@@ -168,7 +168,7 @@ public void testSetRefFormat_Null() {
168168
String refFormat = null;
169169
// then
170170
thrown.expect(IllegalArgumentException.class);
171-
thrown.expectMessage("Format can't be null, but just recieved one");
171+
thrown.expectMessage("Format can't be null, but just received one");
172172
// when
173173
Eid.setRefFormat(refFormat);
174174
} finally {

0 commit comments

Comments
 (0)