- 浏览: 5448 次
- 性别:
- 来自: 肇庆
-
最新评论
文章列表
关于参数验证的一点想法
- 博客分类:
- 编程规范
在开发过程中很多时候都会遇到要验证参数的时候,然后就是一大堆的if-else,代码看起来不够简洁,所以我尝试另一种方式,其实很多开源代码都是这样子写的,就是直接用类似断言的方式,如Spring工具类中的 Assert.isNull(obj,"obj must not be null"); 还有Apache工具中的Validate.isTrue(i>0)等等,当验证不等过的时候会抛出IllegalArgumentException,然后如果需要友好提示,根据情况在某个地方捕获异常并打印出来即可。
java.lang.IllegalArgumentException: hostname can't be null
由于/etc/hosts文件设置不正确导致
ip地不要写127.0.0.1,写真正IP
还有一种可能就是
你的IP有多个域名,你配置的域名一定要放在最前面
如 IP地址 node1,node2
node1是你配置的hostname,如果是node2放在node1前面
Copying to tmp table
January 26th, 2009
MySQL may use temporary tables during query execution. Ideally you would want to avoid this, since its an expensive and slow operation. It can be avoided by optimizing queries. Sometimes it can’t be completely avoided – in that case you want to make ...