Skip to content

Commit 31aedfa

Browse files
committed
Purge OpRetrivalException
I thought I did it before...
1 parent 9183a7b commit 31aedfa

19 files changed

Lines changed: 706 additions & 706 deletions

File tree

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/geom/geom3d/MeshFeatureTests.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
import org.junit.jupiter.api.BeforeAll;
4545
import org.junit.jupiter.api.Test;
46-
import org.scijava.ops.api.OpRetrievalException;
46+
import org.scijava.ops.api.OpMatchingException;
4747
import org.scijava.ops.engine.DependencyMatchingException;
4848
import org.scijava.types.Nil;
4949

@@ -62,7 +62,7 @@ public static void setupBefore() {
6262
public void boxivityMesh() {
6363
try {
6464
ops.op("geom.boxivity").arity1().input(mesh).outType(DoubleType.class).apply();
65-
} catch (OpRetrievalException e) {
65+
} catch (OpMatchingException e) {
6666
// DefaultSmallestOrientedBoundingBox is not implemented.
6767
}
6868
}

‎scijava/scijava-ops-api/src/main/java/org/scijava/ops/api/OpBuilder.java‎

Lines changed: 592 additions & 592 deletions
Large diffs are not rendered by default.

‎scijava/scijava-ops-api/src/main/java/org/scijava/ops/api/OpEnvironment.java‎

Lines changed: 36 additions & 36 deletions
Large diffs are not rendered by default.

scijava/scijava-ops-api/src/main/java/org/scijava/ops/api/OpRetrievalException.java renamed to scijava/scijava-ops-api/src/main/java/org/scijava/ops/api/OpMatchingException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
*
66
* @author David Kolb
77
*/
8-
public class OpRetrievalException extends RuntimeException {
8+
public class OpMatchingException extends RuntimeException {
99

1010
private static final long serialVersionUID = 2334342967056340218L;
1111

12-
public OpRetrievalException(String message) {
12+
public OpMatchingException(String message) {
1313
super(message);
1414
}
1515

16-
public OpRetrievalException(Throwable cause) {
16+
public OpMatchingException(Throwable cause) {
1717
super(cause);
1818
}
1919

20-
public OpRetrievalException(String message, Throwable cause) {
20+
public OpMatchingException(String message, Throwable cause) {
2121
super(message, cause);
2222
}
2323

‎scijava/scijava-ops-api/templates/main/java/org/scijava/ops/api/OpBuilder.vm‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public class OpBuilder {
205205
*
206206
* @return An instance of the matched op, e.g. for reuse.
207207
*
208-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
208+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
209209
*
210210
* @see <a href="#[[#create()]]#" title="To match then immediately run a Producer Op without specifying its type, creating an Object.">create</a>
211211
* @see <a href="#[[#output(O)]]#" title="To specify a concrete output instance. (e.g. pre-allocated for org.scijava.function.Computers)">output</a>
@@ -230,7 +230,7 @@ public class OpBuilder {
230230
*
231231
* @return The {@code Object} created by this op
232232
*
233-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
233+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
234234
*
235235
* @see <a href="#[[#output(O)]]#" title="To specify a concrete output instance. (e.g. pre-allocated for org.scijava.function.Computers)">output</a>
236236
* @see <a href="#outType-java.lang.Class-" title="To specify the output type without providing a concrete instance.">outType(Class)</a>
@@ -261,7 +261,7 @@ public class OpBuilder {
261261
*
262262
* @return An instance of the matched op, e.g. for reuse.
263263
*
264-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
264+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
265265
*
266266
* @see <a href="#[[#computer()]]#" title="For a reusable Op to process pre-allocated outputs without re-matching.">computer</a>
267267
* @see <a href="#[[#create()]]#" title="To match then immediately run a Producer Op, creating an instance of this builder's output type.">create</a>
@@ -283,7 +283,7 @@ public class OpBuilder {
283283
*
284284
* @return An instance of the matched op, e.g. for reuse.
285285
*
286-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
286+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
287287
*
288288
* @see <a href="#[[#create()]]#" title="To match then immediately run a Producer Op, creating an instance of this builder's output type.">create</a>
289289
* @see <a href="#[[#producer()]]#" title="For a reusable Op to create objects of this builder's output type without re-matching.">producer</a>
@@ -297,7 +297,7 @@ public class OpBuilder {
297297
*
298298
* @return The {@code O} created by this op
299299
*
300-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
300+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
301301
*
302302
* @see <a href="#[[#computer()]]#" title="For a reusable Op to process pre-allocated outputs without re-matching.">computer</a>
303303
* @see <a href="#[[#producer()]]#" title="For a reusable Op to create objects of this builder's output type without re-matching.">producer</a>
@@ -326,7 +326,7 @@ public class OpBuilder {
326326
*
327327
* @return An instance of the matched op, e.g. for reuse.
328328
*
329-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
329+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
330330
*
331331
* @see <a href="#[[#compute()]]#" title="To match then immediately run a Computer Op using this builder's pre-allocated output.">compute</a>
332332
*/
@@ -419,7 +419,7 @@ public class OpBuilder {
419419
*
420420
* @return An instance of the matched op, e.g. for reuse.
421421
*
422-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
422+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
423423
*
424424
* @see <a href="#[[#computer()]]#" title="For a reusable Op to process pre-allocated outputs without re-matching.">computer</a>
425425
*/
@@ -432,7 +432,7 @@ public class OpBuilder {
432432
*
433433
* @return An instance of the matched op, e.g. for reuse.
434434
*
435-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
435+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
436436
*
437437
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
438438
*/
@@ -489,7 +489,7 @@ public class OpBuilder {
489489
*
490490
* @return An instance of the matched op, e.g. for reuse.
491491
*
492-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
492+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
493493
*
494494
* @see <a href="#outType-java.lang.Class-" title="To specify the output type without providing a concrete instance.">outType(Class)</a>
495495
* @see <a href="#outType-org.scijava.types.Nil-" title="To specify the output type, preserving its generic parameters.">outType(Nil)</a>
@@ -505,7 +505,7 @@ public class OpBuilder {
505505
*
506506
* @return An instance of the matched op, e.g. for reuse.
507507
*
508-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
508+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
509509
*
510510
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
511511
* @see <a href="#outType-java.lang.Class-" title="To specify the output type without providing a concrete instance.">outType(Class)</a>
@@ -547,7 +547,7 @@ public class OpBuilder {
547547
*
548548
* @return An instance of the matched op, e.g. for reuse.
549549
*
550-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
550+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
551551
*
552552
* @see <a href="#[[#apply()]]#" title="To match then immediately run a Function Op using the input values provided to this builder.">apply</a>
553553
* @see <a href="#[[#computer()]]#" title="For a reusable Op to process pre-allocated outputs without re-matching.">computer</a>
@@ -561,7 +561,7 @@ public class OpBuilder {
561561
*
562562
* @return An instance of the matched op, e.g. for reuse.
563563
*
564-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
564+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
565565
*
566566
* @see <a href="#[[#apply()]]#" title="To match then immediately run a Function Op using the input values provided to this builder.">apply</a>
567567
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
@@ -575,7 +575,7 @@ public class OpBuilder {
575575
*
576576
* @return The output of this function
577577
*
578-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
578+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
579579
*
580580
* @see <a href="#[[#computer()]]#" title="For a reusable Op to process pre-allocated outputs without re-matching.">computer</a>
581581
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
@@ -654,7 +654,7 @@ public class OpBuilder {
654654
*
655655
* @return An instance of the matched op, e.g. for reuse.
656656
*
657-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
657+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
658658
*
659659
* @see <a href="#[[#apply()]]#" title="To match then immediately run a Function Op using the input values provided to this builder.">apply</a>
660660
* @see <a href="#inplace#if ( $arity > 1 )1#end()" title="For a reusable Op that modifies a provided input parameter in-place.">inplace</a>
@@ -673,7 +673,7 @@ public class OpBuilder {
673673
*
674674
* @return An instance of the matched op, e.g. for reuse.
675675
*
676-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
676+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
677677
*
678678
* @see <a href="#[[#apply()]]#" title="To match then immediately run a Function Op using the input values provided to this builder.">apply</a>
679679
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
@@ -693,7 +693,7 @@ public class OpBuilder {
693693
*
694694
* @return The output of this function
695695
*
696-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
696+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
697697
*
698698
* @see <a href="#[[#function()]]#" title="For a reusable Op that generates output instances based on its inputs.">function</a>
699699
* @see <a href="#inplace#if ( $arity > 1 )1#end()" title="For a reusable Op that modifies a provided input parameter in-place.">inplace</a>
@@ -752,7 +752,7 @@ public class OpBuilder {
752752
*
753753
* @return An instance of the matched op, e.g. for reuse.
754754
*
755-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
755+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
756756
*
757757
* @see <a href="#[[#compute()]]#" title="To match then immediately run a Computer Op using this builder's pre-allocated output.">compute</a>
758758
*/
@@ -777,7 +777,7 @@ public class OpBuilder {
777777
*
778778
* @return An instance of the matched op, e.g. for reuse.
779779
*
780-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
780+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
781781
*
782782
* @see <a href="#[[#matchComputer]]#(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end, org.scijava.types.Nil)" title="For a reusable Op to process pre-allocated outputs without re-matching.">OpBuilder.matchComputer(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end, Nil)</a>
783783
#if ( $arity > 0 ) * @see <a href="#[[#]]#$matchName.call($arity, 1)(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end)" title="For a reusable Op that modifies a provided input parameter in-place.">OpBuilder.$matchName.call($arity, 1)(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end)</a>
@@ -831,7 +831,7 @@ public class OpBuilder {
831831
*
832832
* @return An instance of the matched op, e.g. for reuse.
833833
*
834-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
834+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
835835
*
836836
* @see <a href="#[[#matchFunction]]#(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end, org.scijava.types.Nil)" title="For a reusable Op that generates output instances based on its inputs.">OpBuilder.matchFunction(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end, Nil)</a>
837837
#if ( $arity > 0 ) * @see <a href="#[[#]]#$matchName.call($arity, 1)(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end)" title="For a reusable Op that modifies a provided input parameter in-place.">OpBuilder.$matchName.call($arity, 1)(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end)</a>
@@ -890,7 +890,7 @@ public class OpBuilder {
890890
*
891891
* @return An instance of the matched op, e.g. for reuse.
892892
*
893-
* @throws org.scijava.ops.api.OpRetrievalException if the Op request cannot be satisfied.
893+
* @throws org.scijava.ops.api.OpMatchingException if the Op request cannot be satisfied.
894894
*
895895
* @see <a href="#[[#matchComputer]]#(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end, org.scijava.types.Nil)" title="For a reusable Op to process pre-allocated outputs without re-matching.">OpBuilder.matchComputer(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end, Nil)</a>
896896
* @see <a href="#[[#matchFunction]]#(org.scijava.ops.api.OpEnvironment, java.lang.String#foreach( $i in [1..$arity] ), org.scijava.types.Nil#end, org.scijava.types.Nil)" title="For a reusable Op that generates output instances based on its inputs.">OpBuilder.matchFunction(OpEnvironment, String#foreach( $i in [1..$arity] ), Nil#end, Nil)</a>

‎scijava/scijava-ops-engine/src/it/test-ops-api/src/main/java/OpsAPITest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.junit.jupiter.api.Test;
55
import org.scijava.ops.api.Hints;
66
import org.scijava.ops.api.OpEnvironment;
7-
import org.scijava.ops.api.OpRetrievalException;
7+
import org.scijava.ops.api.OpMatchingException;
88

99
/**
1010
* Tests the ability to interact with an {@link OpEnvironment} to perform
@@ -53,7 +53,7 @@ public static void testOpHints() {
5353
// Ensure an Op matches without simplification
5454
// NB this call must come first, or the cache will be hit based on the previous call.
5555
Hints h = new Hints("simplification.FORBIDDEN");
56-
Assertions.assertThrows(OpRetrievalException.class, () -> ops.op("math.pow", h).arity2().input(in, exponent).outType(Long.class).apply());
56+
Assertions.assertThrows(OpMatchingException.class, () -> ops.op("math.pow", h).arity2().input(in, exponent).outType(Long.class).apply());
5757

5858
// Ensure an Op matches with simplification
5959
var power = ops.op("math.pow").arity2().input(in, exponent).outType(Long.class).apply();

‎scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/DependencyMatchingException.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
package org.scijava.ops.engine;
33

44
import org.scijava.ops.api.OpRequest;
5-
import org.scijava.ops.api.OpRetrievalException;
5+
import org.scijava.ops.api.OpMatchingException;
66

77
/**
8-
* An {@link OpRetrievalException} caused by another {@code OpMatchingException}
8+
* An {@link OpMatchingException} caused by another {@code OpMatchingException}
99
* thrown when resolving dependencies. We illustrate the need for
1010
* {@code DependencyMatchingException} with an example: Suppose Op {@code A} has
1111
* an dependency on Op {@code B}, which in turn has a dependency on Op
1212
* {@code C}. Suppose further that {@code A} and {@code B} are found, but no
1313
* {@code C} is found to satisfy {@code B}. This will result in an
14-
* {@link OpRetrievalException} thrown for Op {@code A}. We would want to know:
14+
* {@link OpMatchingException} thrown for Op {@code A}. We would want to know:
1515
* <ol>
1616
* <li>that the request for {@code A} was not fulfilled</li>
1717
* <li>that no match could be found for {@code C}, which was the cause for (1)</li>
@@ -22,7 +22,7 @@
2222
*
2323
* @author Gabriel Selzer
2424
*/
25-
public class DependencyMatchingException extends OpRetrievalException {
25+
public class DependencyMatchingException extends OpMatchingException {
2626

2727
public DependencyMatchingException(final String message) {
2828
super(message);

‎scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/impl/DefaultOpEnvironment.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import org.scijava.ops.api.OpInfo;
6060
import org.scijava.ops.api.OpInstance;
6161
import org.scijava.ops.api.OpRequest;
62-
import org.scijava.ops.api.OpRetrievalException;
62+
import org.scijava.ops.api.OpMatchingException;
6363
import org.scijava.ops.api.RichOp;
6464
import org.scijava.ops.engine.BaseOpHints.Adaptation;
6565
import org.scijava.ops.engine.BaseOpHints.DependencyMatching;
@@ -375,7 +375,7 @@ private <T> RichOp<T> findOp(final String opName, final Nil<T> specialType,
375375

376376
@SuppressWarnings("unchecked")
377377
private <T> OpInstance<T> findOp(final OpInfo info, final Nil<T> specialType,
378-
Hints hints) throws OpRetrievalException
378+
Hints hints) throws OpMatchingException
379379
{
380380
OpRequest request = new InfoMatchingOpRequest(info, specialType);
381381
MatchingConditions conditions = insertCacheHit(request, hints, info);
@@ -594,7 +594,7 @@ private List<RichOp<?>> resolveOpDependencies(OpInfo info,
594594
hintsCopy);
595595
dependencyChains.add(wrapViaCache(conditions));
596596
}
597-
catch (final OpRetrievalException e) {
597+
catch (final OpMatchingException e) {
598598
String message = DependencyMatchingException.message(info
599599
.implementationName(), dependency.getKey(), dep);
600600
if (e instanceof DependencyMatchingException) {
@@ -678,7 +678,7 @@ private OpRequest inferOpRequest(Type type, String name, Map<TypeVariable<?>, Ty
678678
? "no outputs" //
679679
: "multiple outputs: " + Arrays.toString(outputs);
680680
error += ". This is not supported.";
681-
throw new OpRetrievalException(error);
681+
throw new OpMatchingException(error);
682682
}
683683
return new DefaultOpRequest(name, type, mappedOutputs[0], mappedInputs);
684684
}

‎scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/matcher/MatchingResult.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.List;
66
import java.util.Objects;
77

8-
import org.scijava.ops.api.OpRetrievalException;
8+
import org.scijava.ops.api.OpMatchingException;
99
import org.scijava.ops.engine.OpCandidate;
1010
import org.scijava.ops.engine.OpCandidate.StatusCode;
1111
import org.scijava.ops.engine.OpDescription;
@@ -65,7 +65,7 @@ public OpCandidate singleMatch() {
6565

6666
// There is no clear matching Op
6767
final String analysis = MatchingResult.matchInfo(this);
68-
throw new OpRetrievalException(analysis);
68+
throw new OpMatchingException(analysis);
6969
}
7070

7171
/**

‎scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/matcher/MatchingRoutine.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package org.scijava.ops.engine.matcher;
33

44
import org.scijava.ops.api.OpEnvironment;
5-
import org.scijava.ops.api.OpRetrievalException;
5+
import org.scijava.ops.api.OpMatchingException;
66
import org.scijava.ops.engine.MatchingConditions;
77
import org.scijava.ops.engine.OpCandidate;
88

@@ -17,15 +17,15 @@ public interface MatchingRoutine extends
1717
{
1818

1919
void checkSuitability(MatchingConditions conditions)
20-
throws OpRetrievalException;
20+
throws OpMatchingException;
2121

2222
@Override
2323
default int compareTo(MatchingRoutine o) {
2424
return (int) (priority() - o.priority());
2525
}
2626

2727
OpCandidate findMatch(MatchingConditions conditions, OpMatcher matcher,
28-
OpEnvironment env) throws OpRetrievalException;
28+
OpEnvironment env) throws OpMatchingException;
2929

3030
/**
3131
* Generates an {@link OpCandidate} from the Ops in the provided

0 commit comments

Comments
 (0)