File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ### Java Coding Guidelines
2+
3+ #### General
4+ - Prefer ` Stream ` API over traditional for-loops for collection processing.
5+ - Whenever possible, use try-with-resources for automatic resource management.
6+ - Always ask before adding, removing, or updating a third-party library dependency.
7+ - Always use org.jetbrains.annotations.NotNull and org.jetbrains.annotations.Nullable for nullability annotations.
8+ - Be explicit about nullability in public API method signatures.
9+
10+ #### Logging
11+ - Use Log4J2 for logging.
12+ - Name the static logger ` LOG ` and initialize it using ` org.labkey.api.util.logging.LogHelper.getLogger() ` .
13+
14+ #### Testing
15+ - For unit tests, create a static ` TestCase ` inner class extending ` Assert ` in the same file as production code.
16+ - Add new ` TestCase ` classes to the owning module's list in ` getUnitTests() `
17+ - Use JUnit 4 annotations (e.g., @Test ) for these inner test classes.
You can’t perform that action at this time.
0 commit comments