Do not append deps to exports when java_library has only proto srcs

This is to address the comment in aosp/2748099

Test: CI

Bug: 285952385
Change-Id: I0bc8c76e2bc9ee113ced8642e0ab93a95799211c
diff --git a/bp2build/java_proto_conversion_test.go b/bp2build/java_proto_conversion_test.go
index dfef697..b254710 100644
--- a/bp2build/java_proto_conversion_test.go
+++ b/bp2build/java_proto_conversion_test.go
@@ -167,10 +167,7 @@
 					"sdk_version":  `"current"`,
 				}),
 			MakeBazelTarget("java_library", "java-protos", AttrNameToString{
-				"exports": `[
-        ":java-protos_java_proto_lite",
-        ":java-lib-neverlink",
-    ]`,
+				"exports":      `[":java-protos_java_proto_lite"]`,
 				"java_version": `"7"`,
 				"sdk_version":  `"current"`,
 			}),
diff --git a/java/java.go b/java/java.go
index 270f456..3567dbe 100644
--- a/java/java.go
+++ b/java/java.go
@@ -3143,9 +3143,7 @@
 			// bp2build converts this module to 2 java_libraries + java_xx_proto_library + proto_library
 			// the non-empty deps here are not necessary for compiling the protos, in which case
 			// they're unnecessary as deps on the java_library as well since they aren't
-			// being propagated to any dependencies.
-			// so we can put the deps to exports and drop deps here.
-			exports.Append(deps)
+			// being propagated to any dependencies. So we can drop deps here.
 			deps = bazel.LabelListAttribute{}
 		} else {
 			ctx.ModuleErrorf("Module has direct dependencies but no sources. Bazel will not allow this.")