Roll forward of https://github.com/bazelbuild/bazel/commit/4a303e2cd840810b95cbc793e38bdca48e6d9556

Only unescape @@-quoted args once

PiperOrigin-RevId: 153189611
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
index feebbe2..e50b5ce 100644
--- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
+++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
@@ -252,7 +252,9 @@
    * @throws java.io.IOException if one of the files containing options cannot be read.
    */
   private static void expandArgument(Deque<String> expanded, String arg) throws IOException {
-    if (arg.startsWith("@") && !arg.startsWith("@@")) {
+    if (arg.startsWith("@@")) {
+      expanded.add(arg.substring(1));
+    } else if (arg.startsWith("@")) {
       for (String line : Files.readAllLines(Paths.get(arg.substring(1)), UTF_8)) {
         if (line.length() > 0) {
           expandArgument(expanded, line);
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java
index 5f56935..9d4f5e0 100644
--- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java
+++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java
@@ -395,12 +395,6 @@
 
   /** Returns the canonical version of the target name. Package private for testing. */
   static String canonicalizeTarget(String target) {
-    int atIndex = target.indexOf('@');
-    if (atIndex != -1) {
-      // target starts with @@repo ('@' is escaped for the params file parsing) so one @ needs to
-      // be stripped.
-      target = target.substring(1);
-    }
     int colonIndex = target.indexOf(':');
     if (colonIndex == -1) {
       // No ':' in target, nothing to do.