Skip to content

Commit 062d9d3

Browse files
committed
Quality fixes and README.md update
1 parent 72ad870 commit 062d9d3

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This classes shouldn't be used in any public API or library. It is designed to b
1010

1111
## Requirements
1212

13-
* JDK >= 1.7
13+
* JDK >= 1.6
1414

1515
## Maven
1616

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Eid(String id) {
9393
* @throws IllegalArgumentException if given format hasn't got two format specifiers <tt>"%s"</tt>, or if given format was
9494
* null
9595
*/
96+
@SuppressWarnings("UnusedReturnValue")
9697
public static String setMessageFormat(String format) {
9798
validateFormat(format, MESSAGE_FORMAT_NUM_SPEC);
9899
String oldFormat = Eid.messageFormat;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
* @since 0.1.0 (idea imported from Guava Library and COI code)
105105
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
106106
*/
107+
@SuppressWarnings("WeakerAccess")
107108
public final class EidPreconditions {
108109

109110
protected EidPreconditions() {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22
unset MAVEN_OPTS
33
unset JAVA_TOOL_OPTIONS
4-
exec mvn -Pci sonar:sonar \
5-
-DskipTests \
6-
-Dsonar.language=java \
7-
-Dsonar.analysis.mode=incremental \
8-
-Dsonar.host.url=https://sonar.wavesoftware.pl \
9-
-Dsonar.preview.excludePlugins=buildstability,devcockpit,pdfreport,report,views,jira,buildbreaker,issueassign,scmstats
4+
exec mvn -P ci sonar:sonar \
5+
-D skipTests \
6+
-D sonar.language=java \
7+
-D sonar.analysis.mode=incremental \
8+
-D sonar.host.url=https://sonar.wavesoftware.pl \
9+
-D sonar.preview.excludePlugins=buildstability,devcockpit,pdfreport,report,views,jira,buildbreaker,issueassign,scmstats

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
*
2727
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
2828
*/
29+
@SuppressWarnings({"ConstantConditions", "unused"})
2930
public class EidTest {
3031

3132
@Rule
32-
public ExpectedException thrown = ExpectedException.none();
33+
public final ExpectedException thrown = ExpectedException.none();
3334

3435
@Test
3536
public void testSetMessageFormat_Null() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*
3232
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
3333
*/
34+
@SuppressWarnings("unused")
3435
@RunWith(Parameterized.class)
3536
public class ExceptionsTest {
3637

src/test/java/pl/wavesoftware/eid/utils/EidPreconditionsTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.hamcrest.Matcher;
2424
import org.hamcrest.Matchers;
2525
import static org.hamcrest.Matchers.*;
26-
import org.junit.Before;
2726
import org.junit.Rule;
2827
import org.junit.Test;
2928
import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
@@ -39,17 +38,14 @@
3938
*
4039
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
4140
*/
41+
@SuppressWarnings({"ConstantConditions", "unused"})
4242
public class EidPreconditionsTest {
4343

4444
@Rule
45-
public ExpectedException thrown = ExpectedException.none();
45+
public final ExpectedException thrown = ExpectedException.none();
4646

4747
private final String eid = "20150718:075046";
4848

49-
@Before
50-
public void setUp() throws Exception {
51-
}
52-
5349
@Test
5450
public void testCheckArgument() {
5551
// given
@@ -227,8 +223,8 @@ public String execute() throws InterruptedIOException {
227223
public void testCreate() throws NoSuchMethodException {
228224
// given
229225
Class<EidPreconditions> cls = EidPreconditions.class;
230-
Constructor<?> constr = cls.getDeclaredConstructor();
231-
boolean access = constr.isAccessible();
226+
Constructor<?> constructor = cls.getDeclaredConstructor();
227+
boolean access = constructor.isAccessible();
232228

233229
// then
234230
assertThat(access).isFalse();
@@ -237,6 +233,7 @@ public void testCreate() throws NoSuchMethodException {
237233

238234
@Override
239235
public boolean matches(Object item) {
236+
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
240237
Eid eidObject = EidRuntimeException.class.cast(item).getEid();
241238
return eidObject.getId().equals("20150718:083450")
242239
&& !eidObject.getRef().isEmpty()
@@ -406,6 +403,7 @@ public String execute() {
406403
assertThat(result).isEqualTo(tester);
407404
}
408405

406+
@SuppressWarnings("SameReturnValue")
409407
private Eid getNullEid() {
410408
return null;
411409
}

0 commit comments

Comments
 (0)