Skip to content

Commit

Permalink
Avoid leaking ResourceShrinkerAction args between requests
Browse files Browse the repository at this point in the history
Keeping the `ResourceShrinkerAction` options in a static field allows these options to leak between requests in a multiplex world.

Closes #14145.

PiperOrigin-RevId: 405479295
  • Loading branch information
Bencodes authored and Copybara-Service committed Oct 25, 2021
1 parent 64ffc09 commit 9b5fcc6
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ public static final class Options extends OptionsBase {
public VariantType packageType;
}

private static AaptConfigOptions aaptConfigOptions;
private static Options options;

private static String getManifestPackage(Path manifest)
throws SAXException, IOException, StreamException, ParserConfigurationException {
ManifestData manifestData = AndroidManifestParser.parse(Files.newInputStream(manifest));
Expand All @@ -246,8 +243,8 @@ public static void main(String[] args) throws Exception {
.argsPreProcessor(new ShellQuotedParamsFilePreProcessor(FileSystems.getDefault()))
.build();
optionsParser.parseAndExitUponError(args);
aaptConfigOptions = optionsParser.getOptions(AaptConfigOptions.class);
options = optionsParser.getOptions(Options.class);
AaptConfigOptions aaptConfigOptions = optionsParser.getOptions(AaptConfigOptions.class);
Options options = optionsParser.getOptions(Options.class);

AndroidResourceProcessor resourceProcessor = new AndroidResourceProcessor(stdLogger);
// Setup temporary working directories.
Expand Down

0 comments on commit 9b5fcc6

Please sign in to comment.