生成有关不关闭资源的编译器警告

时间:2019-03-20 10:56:42

标签: java annotations javac

是否可能针对下游项目无法使用try-with-resources或在对象上调用AutoClosable.close()生成编译器警告?

例如一个类的正确用法是:

customer_id  order_type  order_time
6872         Coffee      2018-04-06 15:06
6455         Book        2018-04-06 15:08
6872         Coffee      2018-04-06 19:12
6455         Coffee      2018-04-07 15:08
5217         Pen         2018-04-08 09:11
5217         Book        2018-04-08 10:55
6455         Pen         2018-04-09 05:22
6455         Coffee      2018-04-09 07:46

例如,我希望用户被警告,如果他们泄漏资源

customer_id
6455

0 个答案:

没有答案
相关问题