Mercurial Hosting > luan
comparison src/luan/LuanJavaFunction.java @ 130:0594c132888b
cleanup
git-svn-id: https://luan-java.googlecode.com/svn/trunk@131 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 10 Jun 2014 02:43:40 +0000 |
parents | 486a0641bca4 |
children | 1de3e4a6e82d |
comparison
equal
deleted
inserted
replaced
129:486a0641bca4 | 130:0594c132888b |
---|---|
74 Throwable cause = e.getCause(); | 74 Throwable cause = e.getCause(); |
75 if( cause instanceof Error ) | 75 if( cause instanceof Error ) |
76 throw (Error)cause; | 76 throw (Error)cause; |
77 if( cause instanceof LuanException ) | 77 if( cause instanceof LuanException ) |
78 throw (LuanException)cause; | 78 throw (LuanException)cause; |
79 throw luan.JAVA.exception(cause); | 79 throw luan.exception(cause); |
80 } catch(InstantiationException e) { | 80 } catch(InstantiationException e) { |
81 throw new RuntimeException(e); | 81 throw new RuntimeException(e); |
82 } | 82 } |
83 return rtnConverter.convert(rtn); | 83 return rtnConverter.convert(rtn); |
84 } | 84 } |
107 Object arg = args[i]; | 107 Object arg = args[i]; |
108 if( !type.isInstance(arg) ) { | 108 if( !type.isInstance(arg) ) { |
109 String expected = paramType.getSimpleName(); | 109 String expected = paramType.getSimpleName(); |
110 if( arg==null ) { | 110 if( arg==null ) { |
111 if( paramType.isPrimitive() ) | 111 if( paramType.isPrimitive() ) |
112 throw luan.JAVA.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)"); | 112 throw luan.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)"); |
113 } else { | 113 } else { |
114 String got = arg.getClass().getSimpleName(); | 114 String got = arg.getClass().getSimpleName(); |
115 throw luan.JAVA.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")"); | 115 throw luan.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")"); |
116 } | 116 } |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
120 | 120 |