Skip to content

Commit 80bbcc4

Browse files
wiedenmctrueden
authored andcommitted
Remove logger from OpEnvironment
Trims down the interface to a collection of Ops that can be listed and queried by name.
1 parent a55530c commit 80bbcc4

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/main/java/org/scijava/ops/OpEnvironment.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
package org.scijava.ops;
3131

32-
import org.scijava.log.LogService;
3332
import org.scijava.ops.matcher.OpInfo;
3433
import org.scijava.ops.matcher.OpRef;
3534

@@ -67,6 +66,4 @@ public interface OpEnvironment {
6766
Iterable<OpInfo> infos();
6867

6968
Iterable<OpInfo> infos(String name);
70-
71-
LogService logger();
7269
}

src/main/java/org/scijava/ops/OpService.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,6 @@ public Iterable<OpInfo> infos(String name) {
254254
return infos;
255255
}
256256

257-
@Override
258-
public LogService logger() {
259-
return log;
260-
}
261-
262257
/**
263258
* Attempts to inject {@link OpDependency} annotated fields of the specified
264259
* object by looking for Ops matching the field type and the name specified in

src/main/java/org/scijava/ops/matcher/DefaultOpTypeMatchingService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public List<OpCandidate> findCandidates(final OpEnvironment ops, final List<OpRe
102102
for (final OpInfo info : ops.infos(ref.getName())) {
103103
Map<TypeVariable<?>, Type> typeVarAssigns = new HashMap<>();
104104
if (ref.typesMatch(info.opType(), typeVarAssigns)) {
105-
candidates.add(new OpCandidate(ops, ref, info, typeVarAssigns));
105+
candidates.add(new OpCandidate(ops, log, ref, info, typeVarAssigns));
106106
}
107107
}
108108
}

src/main/java/org/scijava/ops/matcher/OpCandidate.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.List;
3535
import java.util.Map;
3636

37+
import org.scijava.log.Logger;
3738
import org.scijava.ops.OpEnvironment;
3839
import org.scijava.ops.OpUtils;
3940
import org.scijava.param.ValidityProblem;
@@ -63,6 +64,7 @@ public static enum StatusCode {
6364
}
6465

6566
private final OpEnvironment ops;
67+
private final Logger log;
6668
private final OpRef ref;
6769
private final OpInfo info;
6870

@@ -76,8 +78,11 @@ public static enum StatusCode {
7678
* If the op does not, this will be the same as {@link #ref}.getArgs(). */
7779
private final Type[] paddedArgs;
7880

79-
public OpCandidate(final OpEnvironment ops, final OpRef ref, final OpInfo info, final Map<TypeVariable<?>, Type> typeVarAssigns) {
81+
public OpCandidate(final OpEnvironment ops, final Logger log, final OpRef ref, final OpInfo info,
82+
final Map<TypeVariable<?>, Type> typeVarAssigns)
83+
{
8084
this.ops = ops;
85+
this.log = log;
8186
this.ref = ref;
8287
this.info = info;
8388
this.typeVarAssigns = typeVarAssigns;

0 commit comments

Comments
 (0)