Automated rollback of commit 20281bbc4545bb4f33a7616806f5ebb8caa6171b.

*** Reason for rollback ***

Broke builds

*** Original change description ***

Remove obsolete attributes from java_proto_library.

RELNOTES[INC]: java_(mutable_|)proto_library: removed strict_deps attribute.

PiperOrigin-RevId: 231917831
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtils.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtils.java
index 09217ec..841ebfc 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtils.java
@@ -21,7 +21,6 @@
 import com.google.devtools.build.lib.rules.java.JavaCompilationArgsProvider;
 import com.google.devtools.build.lib.rules.java.JavaConfiguration;
 import com.google.devtools.build.lib.rules.java.JavaInfo;
-import com.google.devtools.build.lib.syntax.Type;
 
 public class StrictDepsUtils {
 
@@ -98,8 +97,7 @@
    * <p>Using this method requires requesting the JavaConfiguration fragment.
    */
   public static boolean isStrictDepsJavaProtoLibrary(RuleContext ruleContext) {
-    if (ruleContext.getFragment(JavaConfiguration.class).strictDepsJavaProtos()
-        || !ruleContext.attributes().has("strict_deps", Type.BOOLEAN)) {
+    if (ruleContext.getFragment(JavaConfiguration.class).strictDepsJavaProtos()) {
       return true;
     }
     return (boolean) ruleContext.getRule().getAttributeContainer().getAttr("strict_deps");
diff --git a/src/test/java/com/google/devtools/build/lib/BUILD b/src/test/java/com/google/devtools/build/lib/BUILD
index d2e52ca..a3a3e0d 100644
--- a/src/test/java/com/google/devtools/build/lib/BUILD
+++ b/src/test/java/com/google/devtools/build/lib/BUILD
@@ -1210,6 +1210,17 @@
 )
 
 java_test(
+    name = "StrictDepsUtilsTest",
+    srcs = ["rules/java/proto/StrictDepsUtilsTest.java"],
+    deps = [
+        ":analysis_testutil",
+        ":guava_junit_truth",
+        "//src/main/java/com/google/devtools/build/lib:build-base",
+        "//src/main/java/com/google/devtools/build/lib/rules/java:java-rules",
+    ],
+)
+
+java_test(
     name = "test-rules-tests",
     srcs = ["rules/test/SkylarkTestingModuleTest.java"],
     tags = ["rules"],
diff --git a/src/test/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtilsTest.java b/src/test/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtilsTest.java
new file mode 100644
index 0000000..053c4a1
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/rules/java/proto/StrictDepsUtilsTest.java
@@ -0,0 +1,62 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.devtools.build.lib.rules.java.proto;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.devtools.build.lib.analysis.RuleContext;
+import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** {@link StrictDepsUtils}Test */
+@RunWith(JUnit4.class)
+public class StrictDepsUtilsTest extends BuildViewTestCase {
+
+  @Test
+  public void isStrictDepsJavaProtoLibrary_flagIsFalse_noPackageLevelAttribute() throws Exception {
+    useConfiguration("--strict_deps_java_protos=false");
+
+    scratch.file(
+        "x/BUILD",
+        "java_proto_library(name = 'a')",
+        "java_proto_library(name = 'b', strict_deps = 0)",
+        "java_proto_library(name = 'c', strict_deps = 1)");
+
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:a"))).isTrue();
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:b"))).isFalse();
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:c"))).isTrue();
+  }
+
+  @Test
+  public void isStrictDepsJavaProtoLibrary_flagIsTrue_noPackageLevelAttribute() throws Exception {
+    useConfiguration("--strict_deps_java_protos=true");
+
+    scratch.file(
+        "x/BUILD",
+        "java_proto_library(name = 'a')",
+        "java_proto_library(name = 'b', strict_deps = 0)",
+        "java_proto_library(name = 'c', strict_deps = 1)");
+
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:a"))).isTrue();
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:b"))).isTrue();
+    assertThat(StrictDepsUtils.isStrictDepsJavaProtoLibrary(getRuleContext("//x:c"))).isTrue();
+  }
+
+  private RuleContext getRuleContext(String label) throws Exception {
+    return getRuleContext(getConfiguredTarget(label));
+  }
+}