<分区>
我正在尝试回答这个问题,我相信 Javadoc 会解决这个问题:
您发现您的一个(其他方面非常出色的)类中的方法存在安全问题,并且您想告诉用户不再使用该方法是个好主意。你是怎么做到的?
<分区>
我正在尝试回答这个问题,我相信 Javadoc 会解决这个问题:
您发现您的一个(其他方面非常出色的)类中的方法存在安全问题,并且您想告诉用户不再使用该方法是个好主意。你是怎么做到的?
最佳答案
我建议弃用该方法。
When you design an API, carefully consider whether it supersedes an old API. If it does, and you wish to encourage developers (users of the API) to migrate to the new API, then deprecate the old API. Valid reasons to deprecate an API include:
It is insecure, buggy, or highly inefficient
这将自动包含在 Javadoc 中,并给出一个明确的信号,表明不应使用此方法。
关于java - Javadoc 是告诉用户安全问题的正确方法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15150361/