看别人写的代码是件比较痛苦的事情,更加痛苦的是别人的代码出错还要负责调试好. 关于如何迅速定位问题和调试代码,我的一点感受是:逐行认真查看错误信息,在这些信息中找自己熟悉的内容(包括文件名.方法名等),不熟悉的内容先跳过.针对这些熟悉的内容,回溯相应的代码所在行,定位错误原因. 切忌囫囵吞枣的看了一通,其实什么有效信息也没有获得,也几乎不可能就这样定位到问题. 举例: 1.定位问题 在使用jedis监听和订阅消息时报以下错误.经逐行查看错误信息,定位到斜体的三行:分析错误原因是mget调用出错,…
早上发现微服务连不上redis cluster了,看来下日志如下 [root@win-jrh378d7scu 7005]# bin/redis-cli -c -h 15.31.213.183 -p 700515.31.213.183:7005> cluster infoERR max number of clients reached15.31.213.183:7005> 2019-03-26 22:00:30.011 http-nio-9090-exec-4 ERROR org.apache…
java方法中只有一个参数是数组,反射的时候我们不能想当然的传歌数组进去,传数组进去的时候表示多个参数. 两个数组不是一个意思啊. 我们应该把数组转为objet,这样才表示一个参数. import java.lang.reflect.Method; public class MethodTest { public void a(String[] args) { System.out.println("a"); } public static void main(String[] arg…
1.错误叙述性说明 20:27:34 call new_procedure(20150112) Error Code: 1318. Incorrect number of arguments for PROCEDURE company.new_procedure; expected 2, got 1 0.000 sec 1 queries executed, 0 success, 1 errors, 0 warnings 查询:call query_student() 错误代码: 1318 In…
1.错误描述 13:58:20 call new_procedure('2000','zhangsan') Error Code: 1318. Incorrect number of arguments for PROCEDURE student.new_procedure; expected 0, got 2 0.000 sec 2.错误原因 CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`() BEGIN set @a=1…
A parameter of a function (normally the last one) may be marked with vararg modifier: fun <T> asList(vararg ts: T): List<T> { val result = ArrayList<T>() for (t in ts) // ts is an Array result.add(t) return result } allowing a variable n…
hbase(main):036:0> get 'ddl', 'example', 'info:age'COLUMN                                               CELL info:age                                            timestamp=1436787562408, value=\x00\x00\x00\x00\x00\x00\x00\x031 row(s) in 0.0160 seconds…
class Person{ private String name ; private String sex ; public Person(){ System.out.println("c"); } public Person(String c1){ this.name =c1; System.out.println("c1"+c1); } public Person(String c1,String c2){ this.name =c1; this.sex =c…
invalid number of arguments nginx出现以下的错误,基本上错误的原因就是少了后面的分号导致. invalid number of arguments…
lua变长参数 function add ( ... ) for i, v in ipairs{...} do print(i, ' ', v) end end add(1, 2, 'sdf') lua 通过{...}来表示接收到的变长参数 上例输出结果: 1 1 2 2 3 sdf…