Remove internal `experimental_disable_annotation_processing` API
Now that `java_common.compile(enable_annotation_processing)` is available
PiperOrigin-RevId: 386998998
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java
index 50d6708..f4ef2a0 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java
@@ -591,17 +591,6 @@
return this;
}
- // TODO(b/111090089): delete once java_common.compile(enable_annotation_processing) is
- // available
- public Builder experimentalDisableAnnotationProcessing() {
- JavaPluginInfo provider =
- (JavaPluginInfo) providerMap.getProvider(JavaPluginInfo.PROVIDER.getKey());
- if (provider != null) {
- providerMap.put(provider.disableAnnotationProcessing());
- }
- return this;
- }
-
public Builder setLocation(Location location) {
this.creationLocation = location;
return this;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java
index b8695cd..3d8db81 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java
@@ -261,13 +261,6 @@
}
@Override
- public JavaInfo removeAnnotationProcessors(JavaInfo javaInfo) {
- // No implementation in Bazel. This method not callable in Starlark except through
- // (discouraged) use of --experimental_google_legacy_api.
- return null;
- }
-
- @Override
public JavaInfo setAnnotationProcessing(
JavaInfo javaInfo,
boolean enabled,
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java
index 3c6f5e2..470d7df 100644
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java
@@ -500,24 +500,6 @@
enableOnlyWithFlag = BuildLanguageOptions.EXPERIMENTAL_GOOGLE_LEGACY_API)
Sequence<String> getConstraints(JavaInfoT javaInfo);
- // TODO(b/111090089): delete once java_common.compile(enable_annotation_processing) is available
- @StarlarkMethod(
- name = "experimental_disable_annotation_processing",
- doc =
- "Returns a copy of the given JavaInfo with any provided annotation processors disabled."
- + " Annotation processor classpaths are preserved in case they contain Error Prone"
- + " plugins, but processor names and data are excluded. For example, it can be"
- + " used to process the inputs to java_common.compile's deps and plugins parameters.",
- parameters = {
- @Param(
- name = "java_info",
- positional = true,
- named = false,
- doc = "The JavaInfo to process.")
- },
- enableOnlyWithFlag = BuildLanguageOptions.EXPERIMENTAL_GOOGLE_LEGACY_API)
- JavaInfoT removeAnnotationProcessors(JavaInfoT javaInfo);
-
@StarlarkMethod(
name = "set_annotation_processing",
doc = "Returns a copy of the given JavaInfo with the given annotation_processing info.",