Skip to content

Commit d5c9dce

Browse files
Artem LabazinArtem Labazin
authored andcommitted
Small refactoring
1 parent 27856a9 commit d5c9dce

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ limitations under the License.
259259
<dependency>
260260
<groupId>com.puppycrawl.tools</groupId>
261261
<artifactId>checkstyle</artifactId>
262-
<version>8.7</version>
262+
<version>8.8</version>
263263
</dependency>
264264
</dependencies>
265265
<executions>

src/main/java/io/appulse/utils/ResourceUtils.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ public static Optional<String> getResource (@NonNull String name, @NonNull Chars
4545
inputStream = ResourceUtils.class.getResourceAsStream(name);
4646
if (inputStream == null) {
4747
return empty();
48-
} else {
49-
byte[] bytes = BytesUtils.read(inputStream);
50-
String string = new String(bytes, charset);
51-
return of(string);
5248
}
53-
} else {
54-
return of("");
5549
}
50+
51+
val bytes = BytesUtils.read(inputStream);
52+
val string = new String(bytes, charset);
53+
return of(string);
5654
}
5755

5856
private ResourceUtils () {

src/test/java/io/appulse/utils/ResourceUtilsTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020

21-
import static java.util.Optional.empty;
22-
23-
import java.util.Optional;
24-
2521
import org.junit.Test;
2622

2723
/**

0 commit comments

Comments
 (0)