Skip to content

Commit 93cb181

Browse files
Start giving Junie some code-generation guidelines
1 parent 1fe9950 commit 93cb181

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.junie/guidelines/java.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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.

0 commit comments

Comments
 (0)