Skip to content

Commit

Permalink
Merge branch 'better-locking' of https://github.com/polypheny/Polyphe…
Browse files Browse the repository at this point in the history
…ny-DB into better-locking
  • Loading branch information
datomo committed Oct 8, 2024
2 parents b536072 + 3b397d6 commit ab41ef5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.Map;
import lombok.SneakyThrows;
import org.polypheny.db.algebra.type.AlgDataType;
import org.polypheny.db.algebra.type.AlgDataTypeField;
import org.polypheny.db.catalog.exceptions.GenericRuntimeException;
Expand Down Expand Up @@ -51,6 +52,9 @@ public class StatementProcessor {
.build();


// @SneakyThrows is needed for rethrowing implementation.get( 0 ).getException() without
// having to annotate everything with "throws Throwable" or wrapping it in another Exception
@SneakyThrows
public static void implement( PIStatement piStatement ) {
Statement statement = piStatement.getStatement();
if ( statement == null ) {
Expand All @@ -77,7 +81,7 @@ public static void implement( PIStatement piStatement ) {
}

if ( implementations.get( 0 ).getImplementation() == null ) {
throw new GenericRuntimeException( implementations.get( 0 ).getException().orElseThrow() );
throw implementations.get( 0 ).getException().orElseThrow();
}
piStatement.setImplementation( implementations.get( 0 ).getImplementation() );
}
Expand Down

0 comments on commit ab41ef5

Please sign in to comment.