File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ methods.
5959
6060## Java Language Conventions
6161
62+ ### Visibility modifiers
63+
64+ Follow the principle of minimal necessary visibility. Use the most restrictive access modifier that
65+ still allows the code to function correctly.
66+
6267### Package conventions
6368
6469Classes in ` .internal ` packages are not considered public API and may change without notice. These
@@ -117,6 +122,12 @@ Following the reasoning from
117122Prefer AssertJ assertions over JUnit assertions (assertEquals, assertTrue, etc.) for better error
118123messages.
119124
125+ ### JUnit
126+
127+ Test classes and test methods should generally be package-protected (no explicit visibility
128+ modifier) rather than ` public ` . This follows the principle of minimal necessary visibility and is
129+ sufficient for JUnit to discover and execute tests.
130+
120131### AutoService
121132
122133Use the ` @AutoService ` annotation when implementing SPI interfaces. This automatically generates the
@@ -140,7 +151,7 @@ public class MyCustomizerProvider implements AutoConfigurationCustomizerProvider
140151## Configuration
141152
142153- Use ` otel. ` prefix for all configuration property keys
143- - Read config via the ` ConfigProperties ` interface
154+ - Read configuration via the ` ConfigProperties ` interface
144155- Provide sensible defaults and document all options
145156- Validate configuration early with clear error messages
146157
You can’t perform that action at this time.
0 commit comments