fix(commons): use Opt.over in Result.of and do not mention exception as @throws in TokenIterator
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2024-05-04 23:04:52 +02:00
parent ea4dbd616a
commit 4b0d67b702
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 4 additions and 3 deletions

View File

@ -145,7 +145,7 @@ public abstract class SerializeReader<TEx extends Exception, T extends Serialize
int depth = 0;
/**
* {@inheritDoc}
* @throws TEx if an error occurs
* throws {@link TEx} if an error occurs
*/
@Override
public boolean hasNext() {
@ -158,11 +158,12 @@ public abstract class SerializeReader<TEx extends Exception, T extends Serialize
/**
* {@inheritDoc}
* @throws TEx if an error occurs
* throws {@link TEx} if an error occurs
*/
@Override
public RToken next() {
if (!hasNext()) throw new NoSuchElementException("No more tokens");
Unchecked.reintroduce();
try {
RToken token = SerializeReader.this.next();
if (token == RToken.Simple.BEGIN_ARRAY || token == RToken.Simple.BEGIN_OBJECT) {

View File

@ -18,7 +18,7 @@ public sealed interface Result<T, X> {
}
static <T, X> Result<T, X> of(Optional<T> value, Supplier<X> errorSupplier) {
return of(Opt.of(value), errorSupplier);
return of(Opt.over(value), errorSupplier);
}
static <T, X> Result<T, X> of(Opt<T> value, Supplier<X> errorSupplier) {