Repository: bazelbuild/buildtools
Pull request #1313 (2024-12-09 13:43:40)

Enable warnings for the (formerly) native java rules & symbols


Patch:
diff --git a/WARNINGS.md b/WARNINGS.md
index a44a6ab..ceebf15 100644
--- a/WARNINGS.md
+++ b/WARNINGS.md
@@ -41,9 +41,19 @@ Warning categories supported by buildifier's linter:
   * [`native-build`](#native-build)
   * [`native-cc`](#native-cc)
   * [`native-cc-proto`](#native-cc-proto)
-  * [`native-java`](#native-java)
+  * [`native-java-binary`](#native-java-binary)
+  * [`native-java-common`](#native-java-common)
+  * [`native-java-import`](#native-java-import)
+  * [`native-java-info`](#native-java-info)
+  * [`native-java-library`](#native-java-library)
   * [`native-java-lite-proto`](#native-java-lite-proto)
+  * [`native-java-package-config`](#native-java-package-config)
+  * [`native-java-plugin`](#native-java-plugin)
+  * [`native-java-plugin-info`](#native-java-plugin-info)
   * [`native-java-proto`](#native-java-proto)
+  * [`native-java-runtime`](#native-java-runtime)
+  * [`native-java-test`](#native-java-test)
+  * [`native-java-toolchain`](#native-java-toolchain)
   * [`native-package`](#native-package)
   * [`native-proto`](#native-proto)
   * [`native-proto-common`](#native-proto-common)
@@ -713,19 +723,58 @@ The cc_proto_library rule should be loaded from Starlark.
 
 --------------------------------------------------------------------------------
 
-## <a name="native-java"></a>All Java build rules should be loaded from Starlark
+## <a name="native-java-binary"></a>All Java build rules should be loaded from Starlark
 
-  * Category name: `native-java`
-  * Flag in Bazel: [`--incompatible_load_java_rules_from_bzl`](https://github.com/bazelbuild/bazel/issues/8746)
+  * Category name: `native-java-binary`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
   * Automatic fix: yes
-  * [Disabled by default](buildifier/README.md#linter)
-  * [Suppress the warning](#suppress): `# buildifier: disable=native-java`
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-binary`
 
 The Java build rules should be loaded from Starlark.
 
-Update: the plans for disabling native rules
-[have been postponed](https://groups.google.com/g/bazel-discuss/c/XNvpWcge4AE/m/aJ-aQzszAwAJ),
-at the moment it's not required to load Starlark rules.
+--------------------------------------------------------------------------------
+
+## <a name="native-java-common"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-common`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-common`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-import"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-import`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-import`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-info"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-info`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-info`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-library"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-library`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-library`
+
+The Java build rules should be loaded from Starlark.
 
 --------------------------------------------------------------------------------
 
@@ -740,6 +789,39 @@ The java_lite_proto_library rule should be loaded from Starlark.
 
 --------------------------------------------------------------------------------
 
+## <a name="native-java-package-config"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-package-config`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-package-config`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-plugin"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-plugin`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-plugin`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-plugin-info"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-plugin-info`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-plugin-info`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
 ## <a name="native-java-proto"></a>java_proto_library rule should be loaded from Starlark
 
   * Category name: `native-java-proto`
@@ -751,6 +833,39 @@ The java_proto_library rule should be loaded from Starlark.
 
 --------------------------------------------------------------------------------
 
+## <a name="native-java-runtime"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-runtime`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-runtime`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-test"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-test`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-test`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
+## <a name="native-java-toolchain"></a>All Java build rules should be loaded from Starlark
+
+  * Category name: `native-java-toolchain`
+  * Flag in Bazel: [`--incompatible_autoload_externally`](https://github.com/bazelbuild/bazel/issues/23043)
+  * Automatic fix: yes
+  * [Suppress the warning](#suppress): `# buildifier: disable=native-java-toolchain`
+
+The Java build rules should be loaded from Starlark.
+
+--------------------------------------------------------------------------------
+
 ## <a name="native-package"></a>`native.package()` shouldn't be used in .bzl files
 
   * Category name: `native-package`
diff --git a/tables/tables.go b/tables/tables.go
index 12cad17..3272614 100644
--- a/tables/tables.go
+++ b/tables/tables.go
@@ -245,20 +245,8 @@ var CcNativeRules = []string{
 // CcLoadPath is the load path for the Starlark C++ Rules.
 var CcLoadPath = "@rules_cc//cc:defs.bzl"
 
-// JavaNativeRules lists all Java rules that are being migrated from Native to Starlark.
-var JavaNativeRules = []string{
-	"java_binary",
-	"java_import",
-	"java_library",
-	"java_test",
-	"java_package_configuration",
-	"java_plugin",
-	"java_runtime",
-	"java_toolchain",
-}
-
-// JavaLoadPath is the load path for the Starlark Java Rules.
-var JavaLoadPath = "@rules_java//java:defs.bzl"
+// JavaLoadPathPrefix is the load package for the Starlark Java Rules.
+var JavaLoadPathPrefix = "@rules_java//java"
 
 // PyNativeRules lists all Python rules that are being migrated from Native to Starlark.
 var PyNativeRules = []string{
diff --git a/warn/docs/warnings.textproto b/warn/docs/warnings.textproto
index 045256f..aa45c33 100644
--- a/warn/docs/warnings.textproto
+++ b/warn/docs/warnings.textproto
@@ -493,15 +493,101 @@ warnings: {
 }
 
 warnings: {
-  name: "native-java"
+  name: "native-java-binary"
   header: "All Java build rules should be loaded from Starlark"
-  description:
-    "The Java build rules should be loaded from Starlark.\n\n"
-    "Update: the plans for disabling native rules\n"
-    "[have been postponed](https://groups.google.com/g/bazel-discuss/c/XNvpWcge4AE/m/aJ-aQzszAwAJ),\n"
-    "at the moment it's not required to load Starlark rules."
-  bazel_flag: "--incompatible_load_java_rules_from_bzl"
-  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/8746"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-import"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-library"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-plugin"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-test"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-package-config"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-runtime"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-toolchain"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-common"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-info"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
+  autofix: true
+}
+
+warnings: {
+  name: "native-java-plugin-info"
+  header: "All Java build rules should be loaded from Starlark"
+  description: "The Java build rules should be loaded from Starlark."
+  bazel_flag: "--incompatible_autoload_externally"
+  bazel_flag_link: "https://github.com/bazelbuild/bazel/issues/23043"
   autofix: true
 }
 
diff --git a/warn/warn.go b/warn/warn.go
index 95f5d01..48ba370 100644
--- a/warn/warn.go
+++ b/warn/warn.go
@@ -153,7 +153,17 @@ var FileWarningMap = map[string]func(f *build.File) []*LinterFinding{
 	"native-android":                   nativeAndroidRulesWarning,
 	"native-build":                     nativeInBuildFilesWarning,
 	"native-cc":                        nativeCcRulesWarning,
-	"native-java":                      nativeJavaRulesWarning,
+	"native-java-binary":               NativeJavaRulesWarning("java_binary"),
+	"native-java-import":               NativeJavaRulesWarning("java_import"),
+	"native-java-library":              NativeJavaRulesWarning("java_library"),
+	"native-java-plugin":               NativeJavaRulesWarning("java_plugin"),
+	"native-java-test":                 NativeJavaRulesWarning("java_test"),
+	"native-java-package-config":       NativeJavaToolchainRulesWarning("java_package_configuration"),
+	"native-java-runtime":              NativeJavaToolchainRulesWarning("java_runtime"),
+	"native-java-toolchain":            NativeJavaToolchainRulesWarning("java_toolchain"),
+	"native-java-common":               NativeJavaSymbolsWarning("java_common", "java_common"),
+	"native-java-info":                 NativeJavaSymbolsWarning("JavaInfo", "java_info"),
+	"native-java-plugin-info":          NativeJavaSymbolsWarning("JavaPluginInfo", "java_plugin_info"),
 	"native-package":                   nativePackageWarning,
 	"native-proto":                     NativeProtoRulesWarning("proto_library"),
 	"native-java-proto":                NativeProtoRulesWarning("java_proto_library"),
@@ -196,7 +206,6 @@ var nonDefaultWarnings = map[string]bool{
 	"unsorted-dict-items": true, // dict items should be sorted
 	"native-android":      true, // disables native android rules
 	"native-cc":           true, // disables native cc rules
-	"native-java":         true, // disables native java rules
 	"native-py":           true, // disables native python rules
 }
 
diff --git a/warn/warn_bazel_api.go b/warn/warn_bazel_api.go
index 5d73f25..f5dc670 100644
--- a/warn/warn_bazel_api.go
+++ b/warn/warn_bazel_api.go
@@ -701,11 +701,34 @@ func nativeCcRulesWarning(f *build.File) []*LinterFinding {
 	return NotLoadedFunctionUsageCheck(f, tables.CcNativeRules, tables.CcLoadPath)
 }
 
-func nativeJavaRulesWarning(f *build.File) []*LinterFinding {
-	if f.Type != build.TypeBzl && f.Type != build.TypeBuild {
-		return nil
+// NativeJavaRulesWarning produces a warning for missing loads of java rules
+func NativeJavaRulesWarning(rule string) func(f *build.File) []*LinterFinding {
+	return func(f *build.File) []*LinterFinding {
+		if f.Type != build.TypeBzl && f.Type != build.TypeBuild {
+			return nil
+		}
+		return NotLoadedFunctionUsageCheck(f, []string{rule}, tables.JavaLoadPathPrefix+":"+rule+".bzl")
+	}
+}
+
+// NativeJavaToolchainRulesWarning produces a warning for missing loads of java toolchain rules
+func NativeJavaToolchainRulesWarning(rule string) func(f *build.File) []*LinterFinding {
+	return func(f *build.File) []*LinterFinding {
+		if f.Type != build.TypeBzl && f.Type != build.TypeBuild {
+			return nil
+		}
+		return NotLoadedFunctionUsageCheck(f, []string{rule}, tables.JavaLoadPathPrefix+"/toolchains:"+rule+".bzl")
+	}
+}
+
+// NativeJavaSymbolsWarning produces a warning for missing loads of java top-level symbols
+func NativeJavaSymbolsWarning(symbol string, bzlfile string) func(f *build.File) []*LinterFinding {
+	return func(f *build.File) []*LinterFinding {
+		if f.Type != build.TypeBzl && f.Type != build.TypeBuild {
+			return nil
+		}
+		return NotLoadedSymbolUsageCheck(f, []string{symbol}, tables.JavaLoadPathPrefix+"/common:"+bzlfile+".bzl")
 	}
-	return NotLoadedFunctionUsageCheck(f, tables.JavaNativeRules, tables.JavaLoadPath)
 }
 
 func nativePyRulesWarning(f *build.File) []*LinterFinding {


Test patch:
diff --git a/buildifier/config/config_test.go b/buildifier/config/config_test.go
index 1bba68e..82ab3d3 100644
--- a/buildifier/config/config_test.go
+++ b/buildifier/config/config_test.go
@@ -80,9 +80,19 @@ func ExampleExample() {
 	//     "native-build",
 	//     "native-cc",
 	//     "native-cc-proto",
-	//     "native-java",
+	//     "native-java-binary",
+	//     "native-java-common",
+	//     "native-java-import",
+	//     "native-java-info",
+	//     "native-java-library",
 	//     "native-java-lite-proto",
+	//     "native-java-package-config",
+	//     "native-java-plugin",
+	//     "native-java-plugin-info",
 	//     "native-java-proto",
+	//     "native-java-runtime",
+	//     "native-java-test",
+	//     "native-java-toolchain",
 	//     "native-package",
 	//     "native-proto",
 	//     "native-proto-common",
@@ -268,9 +278,19 @@ func TestValidate(t *testing.T) {
 			"native-build",
 			"native-cc",
 			"native-cc-proto",
-			"native-java",
+			"native-java-binary",
+			"native-java-common",
+			"native-java-import",
+			"native-java-info",
+			"native-java-library",
 			"native-java-lite-proto",
+			"native-java-package-config",
+			"native-java-plugin",
+			"native-java-plugin-info",
 			"native-java-proto",
+			"native-java-runtime",
+			"native-java-test",
+			"native-java-toolchain",
 			"native-package",
 			"native-proto",
 			"native-proto-common",
@@ -337,9 +357,19 @@ func TestValidate(t *testing.T) {
 			"native-build",
 			// "native-cc",
 			"native-cc-proto",
-			// "native-java",
+			"native-java-binary",
+			"native-java-common",
+			"native-java-import",
+			"native-java-info",
+			"native-java-library",
 			"native-java-lite-proto",
+			"native-java-package-config",
+			"native-java-plugin",
+			"native-java-plugin-info",
 			"native-java-proto",
+			"native-java-runtime",
+			"native-java-test",
+			"native-java-toolchain",
 			"native-package",
 			"native-proto",
 			"native-proto-common",
@@ -405,9 +435,19 @@ func TestValidate(t *testing.T) {
 			// "native-android",
 			"native-build",
 			"native-cc-proto",
-			// "native-java",
+			"native-java-binary",
+			"native-java-common",
+			"native-java-import",
+			"native-java-info",
+			"native-java-library",
 			"native-java-lite-proto",
+			"native-java-package-config",
+			"native-java-plugin",
+			"native-java-plugin-info",
 			"native-java-proto",
+			"native-java-runtime",
+			"native-java-test",
+			"native-java-toolchain",
 			"native-package",
 			"native-proto",
 			"native-proto-common",
diff --git a/buildifier/integration_test.sh b/buildifier/integration_test.sh
index 4a9d946..f5457ea 100755
--- a/buildifier/integration_test.sh
+++ b/buildifier/integration_test.sh
@@ -285,9 +285,19 @@ cat > golden/.buildifier.example.json <<EOF
     "native-build",
     "native-cc",
     "native-cc-proto",
-    "native-java",
+    "native-java-binary",
+    "native-java-common",
+    "native-java-import",
+    "native-java-info",
+    "native-java-library",
     "native-java-lite-proto",
+    "native-java-package-config",
+    "native-java-plugin",
+    "native-java-plugin-info",
     "native-java-proto",
+    "native-java-runtime",
+    "native-java-test",
+    "native-java-toolchain",
     "native-package",
     "native-proto",
     "native-proto-common",
diff --git a/warn/warn_bazel_api_test.go b/warn/warn_bazel_api_test.go
index d887f3d..8157006 100644
--- a/warn/warn_bazel_api_test.go
+++ b/warn/warn_bazel_api_test.go
@@ -594,7 +594,7 @@ cc_import()
 }
 
 func TestNativeJavaWarning(t *testing.T) {
-	checkFindingsAndFix(t, "native-java", `
+	checkFindingsAndFix(t, "native-java-binary,native-java-import,native-java-library,native-java-plugin,native-java-test,native-java-package-config,native-java-runtime,native-java-toolchain,native-java-common,native-java-info,native-java-plugin-info", `
 """My file"""
 
 def macro():
@@ -602,27 +602,60 @@ def macro():
     java_library()
     native.java_library()
     native.java_binary()
+    native.java_plugin()
+    native.java_package_configuration()
+    native.java_runtime()
+    native.java_toolchain()
+
+    JavaInfo
+    JavaPluginInfo
+    java_common
 
 java_test()
 `, fmt.Sprintf(`
 """My file"""
 
-load(%q, "java_binary", "java_import", "java_library", "java_test")
+load("%[1]s:java_binary.bzl", "java_binary")
+load("%[1]s:java_import.bzl", "java_import")
+load("%[1]s:java_library.bzl", "java_library")
+load("%[1]s:java_plugin.bzl", "java_plugin")
+load("%[1]s:java_test.bzl", "java_test")
+load("%[1]s/common:java_common.bzl", "java_common")
+load("%[1]s/common:java_info.bzl", "JavaInfo")
+load("%[1]s/common:java_plugin_info.bzl", "JavaPluginInfo")
+load("%[1]s/toolchains:java_package_configuration.bzl", "java_package_configuration")
+load("%[1]s/toolchains:java_runtime.bzl", "java_runtime")
+load("%[1]s/toolchains:java_toolchain.bzl", "java_toolchain")
 
 def macro():
     java_import()
     java_library()
     java_library()
     java_binary()
+    java_plugin()
+    java_package_configuration()
+    java_runtime()
+    java_toolchain()
+
+    JavaInfo
+    JavaPluginInfo
+    java_common
 
 java_test()
-`, tables.JavaLoadPath),
+`, tables.JavaLoadPathPrefix),
 		[]string{
-			fmt.Sprintf(`:4: Function "java_import" is not global anymore and needs to be loaded from "%s".`, tables.JavaLoadPath),
-			fmt.Sprintf(`:5: Function "java_library" is not global anymore and needs to be loaded from "%s".`, tables.JavaLoadPath),
-			fmt.Sprintf(`:6: Function "java_library" is not global anymore and needs to be loaded from "%s".`, tables.JavaLoadPath),
-			fmt.Sprintf(`:7: Function "java_binary" is not global anymore and needs to be loaded from "%s".`, tables.JavaLoadPath),
-			fmt.Sprintf(`:9: Function "java_test" is not global anymore and needs to be loaded from "%s".`, tables.JavaLoadPath),
+			fmt.Sprintf(`:4: Function "java_import" is not global anymore and needs to be loaded from "%s:java_import.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:5: Function "java_library" is not global anymore and needs to be loaded from "%s:java_library.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:6: Function "java_library" is not global anymore and needs to be loaded from "%s:java_library.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:7: Function "java_binary" is not global anymore and needs to be loaded from "%s:java_binary.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:8: Function "java_plugin" is not global anymore and needs to be loaded from "%s:java_plugin.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:9: Function "java_package_configuration" is not global anymore and needs to be loaded from "%s/toolchains:java_package_configuration.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:10: Function "java_runtime" is not global anymore and needs to be loaded from "%s/toolchains:java_runtime.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:11: Function "java_toolchain" is not global anymore and needs to be loaded from "%s/toolchains:java_toolchain.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:13: Symbol "JavaInfo" is not global anymore and needs to be loaded from "%s/common:java_info.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:14: Symbol "JavaPluginInfo" is not global anymore and needs to be loaded from "%s/common:java_plugin_info.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:15: Symbol "java_common" is not global anymore and needs to be loaded from "%s/common:java_common.bzl".`, tables.JavaLoadPathPrefix),
+			fmt.Sprintf(`:17: Function "java_test" is not global anymore and needs to be loaded from "%s:java_test.bzl".`, tables.JavaLoadPathPrefix),
 		},
 		scopeBzl|scopeBuild)
 }