You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenSearch recommends building with the [Temurin/Adoptium](https://adoptium.net/temurin/releases/) distribution. JDK 11 is the minimum supported, and JDK-24 is the newest supported. You must have a supported JDK installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-21`.
79
+
OpenSearch recommends building with the [Temurin/Adoptium](https://adoptium.net/temurin/releases/) distribution. JDK 11 is the minimum supported, and JDK-24 is the newest supported. You must have a supported JDK installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-21`.
80
80
81
-
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
81
+
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
82
82
83
83
84
84
In addition, certain backward compatibility tests check out and compile the previous major version of OpenSearch, and therefore require installing [JDK 11](https://adoptium.net/temurin/releases/?version=11) and [JDK 17](https://adoptium.net/temurin/releases/?version=17) and setting the `JAVA11_HOME` and `JAVA17_HOME` environment variables. More to that, since 8.10 release, Gradle has deprecated the usage of the any JDKs below JDK-16. For smooth development experience, the recommendation is to install at least [JDK 17](https://adoptium.net/temurin/releases/?version=17) or [JDK 21](https://adoptium.net/temurin/releases/?version=21). If you still want to build with JDK-11 only, please add `-Dorg.gradle.warning.mode=none` when invoking any Gradle build task from command line, for example:
@@ -319,17 +319,14 @@ For example, we have an hdfs test that uses mini-hdfs to test our repository-hdf
319
319
320
320
## Java Language Formatting Guidelines
321
321
322
-
Java files in the OpenSearch codebase are formatted with the Eclipse JDT formatter, using the [Spotless Gradle](https://github.com/diffplug/spotless/tree/master/plugin-gradle) plugin. This plugin is configured on a project-by-project basis, via `build.gradle` in the root of the repository. So long as at least one project is configured, the formatting check can be run explicitly with:
322
+
Java files in the OpenSearch codebase are formatted with the Eclipse JDT formatter, using the [Spotless Gradle](https://github.com/diffplug/spotless/tree/master/plugin-gradle) plugin. This plugin is configured on a project-by-project basis, via `build.gradle` in the root of the repository.
323
323
324
-
./gradlew spotlessJavaCheck
325
-
326
-
The code can be formatted with:
327
-
328
-
./gradlew spotlessApply
329
-
330
-
These tasks can also be run for specific subprojects, e.g.
331
-
332
-
./gradlew server:spotlessJavaCheck
324
+
- As long at least one project is configured, the formatting check can be run explicitly with:
325
+
-`./gradlew spotlessJavaCheck`
326
+
- The code can be formatted with:
327
+
-`./gradlew spotlessApply`
328
+
- These tasks can also be run for specific subprojects, e.g.
329
+
-`./gradlew server:spotlessJavaCheck`
333
330
334
331
Please follow these formatting guidelines:
335
332
@@ -341,6 +338,43 @@ Please follow these formatting guidelines:
341
338
* Note that JavaDoc and block comments i.e. `/* ... */` are not formatted, but line comments i.e `// ...` are.
342
339
* There is an implicit rule that negative boolean expressions should use the form `foo == false` instead of `!foo` for better readability of the code. While this isn't strictly enforced, it might get called out in PR reviews as something to change.
343
340
341
+
## 🚀 Code Transformation & Automated Rewriting
342
+
*(Advanced Refactoring, Modernization, and Bulk Code Changes)*
343
+
344
+
### 🔧 Automated Rewriting of Source Code
345
+
The OpenSearch build system supports **automated, large-scale code transformations** using [Moderne](https://moderne.io/) and OpenRewrite. These tools enable:
|`@Test public void testFoo()`|`@Test void foo()`| JUnit 5 Convention |
372
+
373
+
### ⚠️ Notes
374
+
-**Custom Rules**: Add project-specific rewrites in `code-convention.yml`.
375
+
-**Exclusions**: Use `// rewrite:off` and `// rewrite:on` to opt out of transformations for specific code blocks.
376
+
-**PR Reviews**: Automated rewrites are flagged in CI. Verify changes match intent before merging.
377
+
344
378
## Adding Dependencies
345
379
346
380
When adding a new dependency or removing an existing dependency via any `build.gradle` (that are not in the test scope), update the dependency LICENSE and library SHAs.
Copy file name to clipboardExpand all lines: server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java
-6Lines changed: 0 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -503,12 +503,6 @@ public void testDiskMonitorResetLastRuntimeMilliSecOnlyInFirstCall() throws Exce
0 commit comments