Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Javadoc the right way to tell a user of a security issue? [closed]

Tags:

java

javadoc

I'm trying to answer this question and I believe the Javadoc would solve the problem:

You have found that a method in one of your (otherwise excellent) classes has a security problem and you want to tell users that it is not a good idea to use the method anymore. How do you do this?

like image 432
John Doe Avatar asked Jan 30 '26 19:01

John Doe


1 Answers

I would suggest to deprecate the method.

How and when to deprecate API

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

This will automatically get included in the Javadocs and will give a clear cut signal that this method should not be used.

like image 163
Narendra Pathai Avatar answered Feb 01 '26 12:02

Narendra Pathai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!