Mikhail Fursov skrev den 25-05-2006 15:22:
Would it be possible to write these as CheckStyle rules? That would make them easy to spot and easy to check against.Guys, What do you think about the following recomendations? These are only 'recomendations' and not must have rules, but if theserecomendations will become 'official' it will improve the quality of API inthe long perspective.1) Try avoid "magic number" nor "magic strings" in code ( the constant nameby itself can be a good comment )2) Try to make all objects used for synchronization 'final' (we have a lotof non-final monitors in API, so we give a chance to bugs) 3) Never call to Boolean of Integer contructors (performance issue, there are a lot of such calls in our API) 4) Never do manual array copying (our crypto API does ) 5) Check if it's possible to make method static or private (performance issue, will help to devirtualizer a lot)
(or any other automated code style checker) -- Thorbjørn
smime.p7s
Description: S/MIME Cryptographic Signature
