摘要:
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
阅读(15)
评论(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
阅读(15)
评论(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:52
add_oil
阅读(13)
评论(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
阅读(20)
评论(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:51
add_oil
阅读(21)
评论(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:50
add_oil
阅读(7)
评论(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:48
add_oil
阅读(24)
评论(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
阅读(18)
评论(0)
推荐(0)