Add checks to ban usage of platform default encoding
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Please see equal feature request #1952645 over at Checkstyle:
https://sourceforge.net/tracker/index.php?func=detail&aid=1952645&group_id=29721&atid=397081
Ideally, users should be able to ban each method individually to have precise control on what is acceptable and what not. However, I cannot estimate how much overhead this would cause for the rule implementations.
Logged In: YES
user_id=342470
Originator: NO
This could be implemented generically via the idea I posited on the developer forum a while back:
http://sourceforge.net/forum/forum.php?thread_id=1812158&forum_id=188194
Consider a list of non-authorized classes:
com.utter.crap.TotallyObsoleteClass
And constructor/method signatures:
com.caveat.programmer.HardToUseProperlyClass(String)
com.caveat.programmer.HardToUseProperlyClass.methodFoo(int,boolean,Object)
Shouldn't be too hard to manage this list of things in an XML file, and make a rule which checks against the list.
Ultimately, the Type Resolution code and Symbol Table usage will be integrated making it trivial to look for calls to methods/constructors in external code (no set delivery for this, it's just on my list of TODO items, might be a long while before I get to it). Currently that is not the case, so one might have to a bit of temporary fancy footwork to recognize such calls, and it'll won't be 100% perfect, etc.
You're welcome to work on this, and submit a patch. It's a powerful Rule with many potential applications.
Logged In: YES
user_id=2071735
Originator: YES