Skip to content

Commit 3f839dc

Browse files
wiedenmctrueden
authored andcommitted
Fix ClassCastException
Simply casting Object[] to Type[] does not work.
1 parent 9884723 commit 3f839dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ public static double getPriority(final OpCandidate candidate) {
191191
}
192192

193193
public static Type[] padTypes(final OpCandidate candidate, Type[] types) {
194-
return (Type[]) padArgs(candidate, false, (Object[])types);
194+
final Object[] padded = padArgs(candidate, false, (Object[]) types);
195+
return Arrays.copyOf(padded, padded.length, Type[].class);
195196
}
196197

197198
public static Object[] padArgs(final OpCandidate candidate, final boolean secondary, Object... args) {

0 commit comments

Comments
 (0)