Skip to content

Commit

Permalink
Quality fixes and README.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil committed Jul 19, 2015
1 parent 72ad870 commit 062d9d3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This classes shouldn't be used in any public API or library. It is designed to b

## Requirements

* JDK >= 1.7
* JDK >= 1.6

## Maven

Expand Down
1 change: 1 addition & 0 deletions src/main/java/pl/wavesoftware/eid/exceptions/Eid.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public Eid(String id) {
* @throws IllegalArgumentException if given format hasn't got two format specifiers <tt>"%s"</tt>, or if given format was
* null
*/
@SuppressWarnings("UnusedReturnValue")
public static String setMessageFormat(String format) {
validateFormat(format, MESSAGE_FORMAT_NUM_SPEC);
String oldFormat = Eid.messageFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
* @since 0.1.0 (idea imported from Guava Library and COI code)
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
*/
@SuppressWarnings("WeakerAccess")
public final class EidPreconditions {

protected EidPreconditions() {
Expand Down
12 changes: 6 additions & 6 deletions src/main/scripts/sonar-incremental.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
unset MAVEN_OPTS
unset JAVA_TOOL_OPTIONS
exec mvn -Pci sonar:sonar \
-DskipTests \
-Dsonar.language=java \
-Dsonar.analysis.mode=incremental \
-Dsonar.host.url=https://sonar.wavesoftware.pl \
-Dsonar.preview.excludePlugins=buildstability,devcockpit,pdfreport,report,views,jira,buildbreaker,issueassign,scmstats
exec mvn -P ci sonar:sonar \
-D skipTests \
-D sonar.language=java \
-D sonar.analysis.mode=incremental \
-D sonar.host.url=https://sonar.wavesoftware.pl \
-D sonar.preview.excludePlugins=buildstability,devcockpit,pdfreport,report,views,jira,buildbreaker,issueassign,scmstats
3 changes: 2 additions & 1 deletion src/test/java/pl/wavesoftware/eid/exceptions/EidTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
*
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
*/
@SuppressWarnings({"ConstantConditions", "unused"})
public class EidTest {

@Rule
public ExpectedException thrown = ExpectedException.none();
public final ExpectedException thrown = ExpectedException.none();

@Test
public void testSetMessageFormat_Null() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
*/
@SuppressWarnings("unused")
@RunWith(Parameterized.class)
public class ExceptionsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.hamcrest.Matchers.*;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
Expand All @@ -39,17 +38,14 @@
*
* @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
*/
@SuppressWarnings({"ConstantConditions", "unused"})
public class EidPreconditionsTest {

@Rule
public ExpectedException thrown = ExpectedException.none();
public final ExpectedException thrown = ExpectedException.none();

private final String eid = "20150718:075046";

@Before
public void setUp() throws Exception {
}

@Test
public void testCheckArgument() {
// given
Expand Down Expand Up @@ -227,8 +223,8 @@ public String execute() throws InterruptedIOException {
public void testCreate() throws NoSuchMethodException {
// given
Class<EidPreconditions> cls = EidPreconditions.class;
Constructor<?> constr = cls.getDeclaredConstructor();
boolean access = constr.isAccessible();
Constructor<?> constructor = cls.getDeclaredConstructor();
boolean access = constructor.isAccessible();

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

@Override
public boolean matches(Object item) {
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
Eid eidObject = EidRuntimeException.class.cast(item).getEid();
return eidObject.getId().equals("20150718:083450")
&& !eidObject.getRef().isEmpty()
Expand Down Expand Up @@ -406,6 +403,7 @@ public String execute() {
assertThat(result).isEqualTo(tester);
}

@SuppressWarnings("SameReturnValue")
private Eid getNullEid() {
return null;
}
Expand Down

0 comments on commit 062d9d3

Please sign in to comment.