Mercurial Hosting > luan
diff core/src/luan/modules/Utils.java @ 646:cdc70de628b5
simplify LuanException
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 29 Mar 2016 19:58:39 -0600 |
parents | 6ea90dc10375 |
children | a21e9594307d |
line wrap: on
line diff
--- a/core/src/luan/modules/Utils.java Tue Mar 29 18:09:51 2016 -0600 +++ b/core/src/luan/modules/Utils.java Tue Mar 29 19:58:39 2016 -0600 @@ -8,7 +8,6 @@ import java.io.File; import java.net.URL; import java.net.MalformedURLException; -import luan.LuanState; import luan.LuanException; import luan.LuanTable; import luan.LuanFunction; @@ -19,49 +18,49 @@ static final int bufSize = 8192; - private static void checkNotNull(LuanState luan,Object v,String expected,int pos) throws LuanException { + private static void checkNotNull(Object v,String expected,int pos) throws LuanException { if( v == null ) - throw new LuanException(luan,"bad argument #"+pos+" ("+expected+" expected, got nil)"); + throw new LuanException("bad argument #"+pos+" ("+expected+" expected, got nil)"); } - public static void checkNotNull(LuanState luan,String s,int pos) throws LuanException { - checkNotNull(luan,s,"string",pos); + public static void checkNotNull(String s,int pos) throws LuanException { + checkNotNull(s,"string",pos); } - public static void checkNotNull(LuanState luan,String s) throws LuanException { - checkNotNull(luan,s,1); + public static void checkNotNull(String s) throws LuanException { + checkNotNull(s,1); } - public static void checkNotNull(LuanState luan,byte[] b,int pos) throws LuanException { - checkNotNull(luan,b,"binary",pos); + public static void checkNotNull(byte[] b,int pos) throws LuanException { + checkNotNull(b,"binary",pos); } - public static void checkNotNull(LuanState luan,byte[] b) throws LuanException { - checkNotNull(luan,b,1); + public static void checkNotNull(byte[] b) throws LuanException { + checkNotNull(b,1); } - public static void checkNotNull(LuanState luan,LuanTable t,int pos) throws LuanException { - checkNotNull(luan,t,"table",pos); + public static void checkNotNull(LuanTable t,int pos) throws LuanException { + checkNotNull(t,"table",pos); } - public static void checkNotNull(LuanState luan,LuanTable t) throws LuanException { - checkNotNull(luan,t,1); + public static void checkNotNull(LuanTable t) throws LuanException { + checkNotNull(t,1); } - public static void checkNotNull(LuanState luan,Number n,int pos) throws LuanException { - checkNotNull(luan,n,"number",pos); + public static void checkNotNull(Number n,int pos) throws LuanException { + checkNotNull(n,"number",pos); } - public static void checkNotNull(LuanState luan,Number n) throws LuanException { - checkNotNull(luan,n,1); + public static void checkNotNull(Number n) throws LuanException { + checkNotNull(n,1); } - public static void checkNotNull(LuanState luan,LuanFunction fn,int pos) throws LuanException { - checkNotNull(luan,fn,"function",pos); + public static void checkNotNull(LuanFunction fn,int pos) throws LuanException { + checkNotNull(fn,"function",pos); } - public static void checkNotNull(LuanState luan,LuanFunction fn) throws LuanException { - checkNotNull(luan,fn,1); + public static void checkNotNull(LuanFunction fn) throws LuanException { + checkNotNull(fn,1); } public static String readAll(Reader in)