Permalink
Browse files

Make better use of ExceptionHandling.dieInternal() in NativeCallOps.

  • Loading branch information...
1 parent 84497ec commit 8c67bb10a45035f9d61088b54c2bdb75732d86e5 @arnsholt arnsholt committed Jan 28, 2014
Showing with 3 additions and 9 deletions.
  1. +3 −9 src/vm/jvm/runtime/org/perl6/nqp/runtime/NativeCallOps.java
@@ -131,11 +131,8 @@ private static Class javaType(ThreadContext tc, ArgType target, SixModelObject s
case CSTRUCT:
return ((CStructREPRData) smoType.st.REPRData).structureClass;
default:
- ExceptionHandling.dieInternal(tc, String.format("Don't know correct Java class for %s arguments yet", target));
+ throw ExceptionHandling.dieInternal(tc, String.format("Don't know correct Java class for %s arguments yet", target));
}
-
- /* And a dummy return to placate the Java flow analysis. */
- return null;
}
public static Object toJNAType(ThreadContext tc, SixModelObject o, ArgType target) {
@@ -174,11 +171,8 @@ public static Object toJNAType(ThreadContext tc, SixModelObject o, ArgType targe
case CSTRUCT:
return ((CStructInstance) o).storage;
default:
- ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to JNA yet", target));
+ throw ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to JNA yet", target));
}
-
- /* And a dummy return to placate the Java flow analysis. */
- return null;
}
public static SixModelObject toNQPType(ThreadContext tc, ArgType target, SixModelObject type, Object o) {
@@ -247,7 +241,7 @@ public static SixModelObject toNQPType(ThreadContext tc, ArgType target, SixMode
break;
}
default:
- ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to NQP yet", target));
+ throw ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to NQP yet", target));
}
return nqpobj;

0 comments on commit 8c67bb1

Please sign in to comment.