Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mark as deprecated third party class

I have some third party library Foo with class FooBar. I think that class FooBar is badly designed. I want to write my own MyBar as adapter pattern. Can I mark the original FooBar as @Deprecated without modifying its code?

like image 484
Stan Kurilin Avatar asked Mar 07 '11 06:03

Stan Kurilin


Video Answer


1 Answers

@deprecated should be added to the source to flag the class/method as deprecated. So you cannot deprecate someone else's code.

However if you have a better alternative that you prefer to use in your project as a standard, then you can impose this standard in other ways, as a rule in checkstyle for instance.

like image 170
Nivas Avatar answered Sep 24 '22 02:09

Nivas