Code Best Practices
Goal: Technical
Sponsor: Trek Global
Description:
Findbugs
Cases applied to Idempiere:
-
BigDecimal constructed from double that isn't represented precisely.
-
Possible null pointer dereference in method on exception path.
-
Nonconstant string passed to execute method on an SQL statement.
-
Non-transient non-serializable instance field in serializable class.
-
No relationship between generic parameter and method argument.
fb-contrib
fb-contrib™ is an extra detector plugin to be used with the static bug finder FindBugs™.
Solve eclipse warnings
-
Deprecation
-
Type Generic
-
Unused Code
-
Type Safety
The finally Block
The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs. more.
it is good practice to free the resources using the finally block.
Make iDempiere safer using saveEx instead of save
To make iDempiere safer is better to replace all unattended save calls with saveEx.
Performance improvements
Technical Info: IDEMPIERE-37 IDEMPIERE-455 IDEMPIERE-568
Performance: IDEMPIERE-144 IDEMPIERE-145 IDEMPIERE-146 IDEMPIERE-174 IDEMPIERE-175 IDEMPIERE-308 IDEMPIERE-312 IDEMPIERE-314
Source: Wiki