【发布时间】:2016-10-25 11:32:56
【问题描述】:
在我们的项目中,我们将编写 API javadocs。在 doc cmets 中,除了方法细节之外,我们还想写历史细节。例如,如果为了修复特定问题而修改了方法,我们希望记录问题的详细信息以及该方法的 javadoc 注释。
/**
* Displays the details for a valid registered customer against the specified <code>Integer customerId</code>.<br>
* Responsible to check the existance of the customer before sending back the information for the "Customer Reference" screen.
*
* @param customerId the customer id to fetch the details for
* @return <code>jsp</code> file name for "Customer Reference" screen along with Customer details
*
* BTS-1947 | custom fields not displayed correctly | 25-10-2016 | Vaibhav
*/
public String displayCustomerInfo(Integer customerId) {
问题是,我们不想在使用 javadocs 工具生成的 javadocs 中显示 BTS-1947 | custom fields not displayed correctly | 25-10-2016 | Vaibhav 部分。是否可以这样做,或者有没有更好的方法来使用 javadocs 维护更新历史记录?
【问题讨论】:
-
该评论对您的源代码管理历史有什么价值?
-
我也有同样的感觉,但我被要求为此提供解决方案,因为我的经理希望其他开发人员通过查看代码本身而不是源代码控制历史来了解历史(在我们的例子中是 SVN) .我们为历史部分写了普通的多行注释 /*...*/ 但这看起来不太好写两种不同类型的 cmets 一个在另一个之上。
-
为什么不将该信息放在 javadoc 正上方的另一个非 javadoc 注释上?
-
这就是我目前正在做的,因为到目前为止我还没有找到任何其他解决方案。