Skip to content

Commit

Permalink
fix checkstyle: imports and deprecated URL class
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav committed Jul 21, 2023
1 parent 582a0c8 commit e188155
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
11 changes: 7 additions & 4 deletions src/main/java/org/cactoos/iterable/IterableOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@
package org.cactoos.iterable;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Iterator;
import org.cactoos.Fallback;
import org.cactoos.Scalar;
import org.cactoos.iterator.IteratorOf;
import org.cactoos.scalar.*;
import org.cactoos.scalar.And;
import org.cactoos.scalar.HashCode;
import org.cactoos.scalar.Or;
import org.cactoos.scalar.ScalarWithFallback;
import org.cactoos.scalar.Unchecked;
import org.cactoos.text.Joined;
import org.cactoos.text.UncheckedText;

import java.util.Iterator;

/**
* Array as iterable.
*
Expand Down Expand Up @@ -116,7 +119,7 @@ public boolean equals(final Object other) {
@Override
public int hashCode() {
return new Unchecked<>(
new HashCode(42, 37, this)
new HashCode(42, 37, this)
).value();
}

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/cactoos/map/MapEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
*/
package org.cactoos.map;

import java.util.Map;
import org.cactoos.iterable.IterableOf;
import org.cactoos.scalar.HashCode;
import org.cactoos.text.FormattedText;
import org.cactoos.text.UncheckedText;

import java.util.Map;

/**
* MapEntry as {@link java.util.AbstractMap.Entry}.
*
Expand Down Expand Up @@ -98,7 +97,7 @@ public boolean equals(final Object obj) {
@Override
public int hashCode() {
return new HashCode(
new IterableOf<>(this.key, this.value)
new IterableOf<>(this.key, this.value)
).value();
}
}
9 changes: 5 additions & 4 deletions src/test/java/org/cactoos/io/InputOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -145,15 +146,15 @@ void readsRealUrl() throws Exception {
}

@Test
void readsStringUrl() throws IOException {
void readsStringUrl() throws IOException, URISyntaxException {
new Assertion<>(
"must fetch bytes from the HTTPS URL",
new TextOf(
new BytesOf(
new InputOf(
new URL(
new URI(
"file:src/test/resources/org/cactoos/large-text.txt"
)
).toURL()
)
)
),
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/org/cactoos/io/StickyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
package org.cactoos.io;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import org.cactoos.bytes.BytesOf;
import org.cactoos.func.Repeated;
import org.cactoos.scalar.LengthOf;
Expand Down Expand Up @@ -62,15 +63,15 @@ void readsFileContent() {
}

@Test
void readsRealUrl() throws MalformedURLException {
void readsRealUrl() throws MalformedURLException, URISyntaxException {
new Assertion<>(
"Must fetch text page from the URL",
new TextOf(
new Sticky(
new InputOf(
new URL(
new URI(
"file:src/test/resources/org/cactoos/large-text.txt"
)
).toURL()
)
)
),
Expand Down

0 comments on commit e188155

Please sign in to comment.