Skip to content

Commit 79eba17

Browse files
authored
Add back error message for jnew
"No constructor for $T with signature $sig"
1 parent 92f3b2b commit 79eba17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ isarray(juliaclass::String) = endswith(juliaclass, "[]")
324324

325325
function jnew(T::Symbol, argtypes::Tuple = () , args...)
326326
assertroottask_or_goodenv() && assertloaded()
327-
jmethodId = checknull(get_method_id(JNI.GetMethodID, Ptr(metaclass(T)), "<init>", Nothing, argtypes))
327+
jmethodId = checknull(
328+
get_method_id(JNI.GetMethodID, Ptr(metaclass(T)), "<init>", Nothing, argtypes),
329+
"No constructor for $T with signature $sig"
330+
)
328331
return _jcall(metaclass(T), jmethodId, JavaObject{T}, argtypes, args...; callmethod=JNI.NewObjectA)
329332
end
330333

0 commit comments

Comments
 (0)