摘要: 1 public void func1() throws Exception1 { 2 // ... 3 } 4 5 6 public void func2() throws Exception2 { 7 //... 8 try { 9 func1(); 10 } catch(Exception1 阅读全文
posted @ 2022-10-31 07:54 add_oil 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1 public void func1() throws Exception1 { 2 // ... 3 } 4 5 6 public void func2() throws Exception1 {//原封不动的re-throw Exception1 7 //... 8 func1(); 9 // 阅读全文
posted @ 2022-10-31 07:53 add_oil 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 1 public void func1() throws Exception1 { 2 // ... 3 } 4 5 public void func2() { 6 //... 7 try { 8 func1(); 9 } catch(Exception1 e) { 10 log.warn("... 阅读全文
posted @ 2022-10-31 07:53 add_oil 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1 // address格式:"192.131.2.33:7896" 2 public void parseRedisAddress(String address) { 3 this.host = RedisConfig.DEFAULT_HOST; 4 this.port = RedisConfig 阅读全文
posted @ 2022-10-31 07:52 add_oil 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1 // 使用空集合替代NULL 2 public class UserService { 3 private UserRepo userRepo; // 依赖注入 4 5 public List<User> getUsers(String telephonePrefix) { 6 // 没有查找到 阅读全文
posted @ 2022-10-31 07:52 add_oil 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1 public class UserService { 2 private UserRepo userRepo; // 依赖注入 3 4 public User getUser(String telephone) { 5 // 如果用户不存在,则返回null 6 return null; 7 } 阅读全文
posted @ 2022-10-31 07:51 add_oil 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1 // 错误码的返回方式一:pathname/flags/mode为入参;fd为出参,存储打开的文件句柄。 2 int open(const char *pathname, int flags, mode_t mode, int* fd) { 3 if (/*文件不存在*/) { 4 return 阅读全文
posted @ 2022-10-31 07:49 add_oil 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 1 public class RandomIdGenerator implements IdGenerator { 2 private static final Logger logger = LoggerFactory.getLogger(RandomIdGenerator.class); 3 4 阅读全文
posted @ 2022-10-31 07:43 add_oil 阅读(12) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/lovesqcc/p/6105186.html 阅读全文
posted @ 2022-05-14 01:39 add_oil 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 对于开放定址法,荷载因子是特别重要因素,应严格限制在0.7-0.8以下。超过0.8,查表时的CPU缓存不命中(cache missing)按照指数曲线上升。因此,一些采用开放定址法的hash库,如Java的系统库限制了荷载因子为0.75,超过此值将resize散列表。 参考资料: https://b 阅读全文
posted @ 2022-03-18 00:37 add_oil 阅读(122) 评论(0) 推荐(0) 编辑