Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 4
}
"modification": 5
}
7 changes: 7 additions & 0 deletions runners/google-cloud-dataflow-java/worker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ applyJavaNature(
/******************************************************************************/
// Configure the worker root project

tasks.withType(Test).configureEach {
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED'
}
Comment on lines +157 to +162

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding --add-opens directly to jvmArgs will cause test execution to fail on Java 8 environments because Java 8 does not recognize this JVM option. To maintain compatibility with Java 8, wrap the JVM argument configuration in a check for Java 9 or higher.

tasks.withType(Test).configureEach {
  if (JavaVersion.current().isJava9Compatible()) {
    jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
  }
}


configurations {
sourceFile

Expand Down
4 changes: 4 additions & 0 deletions sdks/java/io/hcatalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ hadoopVersions.each {kv -> configurations.create("hadoopVersion$kv.key")}

def hive_version = "4.0.1"

tasks.withType(Test).configureEach {
jvmArgs '--add-opens=java.base/java.net=ALL-UNNAMED'
}
Comment on lines +43 to +45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding --add-opens directly to jvmArgs will cause test execution to fail on Java 8 environments because Java 8 does not recognize this JVM option. To maintain compatibility with Java 8, wrap the JVM argument configuration in a check for Java 9 or higher. This also corrects the indentation to 2 spaces.

tasks.withType(Test).configureEach {
  if (JavaVersion.current().isJava9Compatible()) {
    jvmArgs '--add-opens=java.base/java.net=ALL-UNNAMED'
  }
}


dependencies {
implementation library.java.vendored_guava_32_1_2_jre
implementation project(path: ":sdks:java:core", configuration: "shadow")
Expand Down
Loading