Skip to content

Commit 445dc56

Browse files
committed
Merge branch 'develop'
2 parents df27920 + 654b9ae commit 445dc56

File tree

28 files changed

+535
-343
lines changed

28 files changed

+535
-343
lines changed

java-io-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.github.nbbrd.java-io-util</groupId>
77
<artifactId>java-io-parent</artifactId>
8-
<version>0.0.14</version>
8+
<version>0.0.15</version>
99
</parent>
1010

1111
<artifactId>java-io-base</artifactId>

java-io-base/src/main/java/internal/io/IOIterators.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public enum Empty implements IOIterator<Object> {
4444
INSTANCE;
4545

4646
@Override
47-
public boolean hasNextWithIO() throws IOException {
47+
public boolean hasNextWithIO() {
4848
return false;
4949
}
5050

5151
@Override
52-
public Object nextWithIO() throws IOException, NoSuchElementException {
52+
public Object nextWithIO() throws NoSuchElementException {
5353
throw new NoSuchElementException();
5454
}
5555

@@ -73,12 +73,12 @@ public static final class Singleton<E> implements IOIterator<E> {
7373
private boolean first = true;
7474

7575
@Override
76-
public boolean hasNextWithIO() throws IOException {
76+
public boolean hasNextWithIO() {
7777
return first;
7878
}
7979

8080
@Override
81-
public E nextWithIO() throws IOException, NoSuchElementException {
81+
public E nextWithIO() throws NoSuchElementException {
8282
if (!hasNextWithIO()) {
8383
throw new NoSuchElementException();
8484
}

java-io-base/src/main/java/internal/io/text/InternalFormatter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public CharSequence formatTemporalAccessor(DateTimeFormatter formatter, Temporal
4242
try {
4343
return formatter.format(value);
4444
} catch (DateTimeException ex) {
45+
doNothing(ex);
4546
}
4647
}
4748
return null;
@@ -68,6 +69,7 @@ public CharSequence formatStringList(Function<Stream<CharSequence>, String> join
6869
try {
6970
return joiner.apply(value.stream().map(CharSequence.class::cast));
7071
} catch (Exception ex) {
72+
doNothing(ex);
7173
}
7274
}
7375
return null;

java-io-base/src/main/java/internal/io/text/InternalParser.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
@lombok.experimental.UtilityClass
4242
public class InternalParser {
4343

44+
@SuppressWarnings("unchecked")
4445
public <T> T parseTemporalAccessor(DateTimeFormatter formatter, TemporalQuery<T>[] queries, CharSequence input) {
4546
if (input != null) {
4647
try {
@@ -53,6 +54,7 @@ public <T> T parseTemporalAccessor(DateTimeFormatter formatter, TemporalQuery<T>
5354
return (T) formatter.parseBest(input, queries);
5455
}
5556
} catch (DateTimeParseException ex) {
57+
doNothing(ex);
5658
}
5759
}
5860
return null;
@@ -94,6 +96,7 @@ public double[] parseDoubleArray(CharSequence input) {
9496
}
9597
return result;
9698
} catch (Exception ex) {
99+
doNothing(ex);
97100
}
98101
}
99102
return null;
@@ -115,6 +118,7 @@ public String[] parseStringArray(CharSequence input) {
115118
}
116119
return result;
117120
} catch (Exception ex) {
121+
doNothing(ex);
118122
}
119123
}
120124
return null;
@@ -125,6 +129,7 @@ public Integer parseInteger(CharSequence input) {
125129
try {
126130
return Integer.valueOf(input.toString());
127131
} catch (NumberFormatException ex) {
132+
doNothing(ex);
128133
}
129134
}
130135
return null;
@@ -135,6 +140,7 @@ public Long parseLong(CharSequence input) {
135140
try {
136141
return Long.valueOf(input.toString());
137142
} catch (NumberFormatException ex) {
143+
doNothing(ex);
138144
}
139145
}
140146
return null;
@@ -145,6 +151,7 @@ public Double parseDouble(CharSequence input) {
145151
try {
146152
return Double.valueOf(input.toString());
147153
} catch (NumberFormatException ex) {
154+
doNothing(ex);
148155
}
149156
}
150157
return null;
@@ -155,6 +162,7 @@ public Charset parseCharset(CharSequence input) {
155162
try {
156163
return Charset.forName(input.toString());
157164
} catch (IllegalArgumentException ex) {
165+
doNothing(ex);
158166
}
159167
}
160168
return null;
@@ -183,6 +191,7 @@ public <T extends Enum<T>> T parseEnum(Class<T> enumClass, CharSequence input) {
183191
try {
184192
return Enum.valueOf(enumClass, input.toString());
185193
} catch (IllegalArgumentException ex) {
194+
doNothing(ex);
186195
}
187196
}
188197
return null;
@@ -291,6 +300,7 @@ public URL parseURL(CharSequence input) {
291300
try {
292301
return new URL(input.toString());
293302
} catch (MalformedURLException ex) {
303+
doNothing(ex);
294304
}
295305
}
296306
return null;

java-io-base/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
exports nbbrd.io.text;
2828
exports nbbrd.io.zip;
2929

30-
exports internal.io.text to nbbrd.io.xml;
30+
exports internal.io.text to nbbrd.io.xml, nbbrd.io.xml.bind;
3131
}

java-io-base/src/main/java/nbbrd/io/AbstractIOIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public abstract class AbstractIOIterator<E> implements IOIterator<E> {
3434

3535
private enum State {
3636
COMPUTED, NOT_COMPUTED, DONE
37-
};
37+
}
3838

3939
private State state = State.NOT_COMPUTED;
4040

java-io-base/src/main/java/nbbrd/io/FileFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ default void formatPath(@NonNull T value, @NonNull Path target) throws IOExcepti
3333
}
3434
}
3535

36-
default void formatStream(@NonNull T value, IOSupplier<? extends OutputStream> target) throws IOException {
36+
default void formatStream(@NonNull T value, @NonNull IOSupplier<? extends OutputStream> target) throws IOException {
3737
Objects.requireNonNull(value, "value");
3838
Objects.requireNonNull(target, "target");
3939
try (OutputStream resource = LegacyFiles.checkResource(target.getWithIO(), "Missing OutputStream")) {

java-io-base/src/main/java/nbbrd/io/IOIterator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ default void forEachRemainingWithIO(@NonNull IOConsumer<? super E> action) throw
6767
return new IOIterators.Unchecked<>(this);
6868
}
6969

70+
@SuppressWarnings("unchecked")
7071
@StaticFactoryMethod
7172
static <E> @NonNull IOIterator<E> empty() {
7273
return (IOIterator<E>) IOIterators.Empty.INSTANCE;

java-io-base/src/main/java/nbbrd/io/WrappedIOException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static IOException wrap(@NonNull Throwable ex) {
3535
@NonNull
3636
public static Throwable unwrap(@NonNull IOException ex) {
3737
Objects.requireNonNull(ex);
38-
return ex instanceof WrappedIOException ? ((WrappedIOException) ex).getCause() : ex;
38+
return ex instanceof WrappedIOException ? ex.getCause() : ex;
3939
}
4040

4141
private WrappedIOException(Throwable ex) {

java-io-base/src/main/java/nbbrd/io/function/IOConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Represents an operation that accepts a single input argument and returns no
3030
* result. Unlike most other functional interfaces, {@code Consumer} is expected
31-
* to operate via side-effects.
31+
* to operate via side effects.
3232
*
3333
* @param <T> the type of the input to the operation
3434
*/

0 commit comments

Comments
 (0)