Skip to content

Commit

Permalink
Resolve Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Sep 3, 2024
1 parent f9bbebb commit 2f75222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import info.freelibrary.util.Logger;
import info.freelibrary.util.LoggerFactory;
import info.freelibrary.util.warnings.JDK;
import info.freelibrary.util.warnings.PMD;
import info.freelibrary.util.warnings.Sonar;

Expand Down Expand Up @@ -122,10 +123,9 @@ public boolean addAll(final Collection<? extends URI> aUriCollection) {
* @return If all the supplied URIs were successfully added
*/
@Override
@SuppressWarnings(JDK.UNCHECKED)
public boolean addAll(final int aIndex, final Collection<? extends URI> aCollection) {
final List<? extends URI> uris =
aCollection.stream().filter(uri -> !PRESENTATION_CONTEXT_URI.equals(uri)).toList();
return super.addAll(aIndex, uris);
return super.addAll(aIndex, aCollection.stream().filter(uri -> !PRESENTATION_CONTEXT_URI.equals(uri)).toList());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static org.junit.Assert.assertTrue;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -168,7 +167,7 @@ public final void testAddIntUriZeroIndex() {
* Test method for {@link ContextList#addLast(URI)}.
*/
@Test
public final void testAddLastDefaultURI() throws IOException {
public final void testAddLastDefaultURI() {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final PrintStream current = new PrintStream(out, true, StandardCharsets.UTF_8);
final PrintStream previous = System.out;
Expand Down Expand Up @@ -322,7 +321,7 @@ public final void testRemoveAllCollectionOfQ() {
*/
@Test
public final void testRemoveDefContextObject() {
new ContextList().remove(ContextList.PRESENTATION_CONTEXT_URI);
assertFalse(new ContextList().remove(ContextList.PRESENTATION_CONTEXT_URI));
}

/**
Expand Down

0 comments on commit 2f75222

Please sign in to comment.