Skip to content

Commit

Permalink
Remove -XDnoparameters handling
Browse files Browse the repository at this point in the history
There are no remaining uses of the opt-out.

PiperOrigin-RevId: 657328352
Change-Id: I36d600571836f88f18e3b22fc9c98d8e37163430
  • Loading branch information
cushon authored and copybara-github committed Jul 29, 2024
1 parent 9fbf427 commit c751241
Showing 1 changed file with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,37 +361,6 @@ public void normalize(List<String> normalized) {
}
}

/**
* Normalizer for {@code -parameters}, which allows the (non-standard) flag {@code
* -XDnoparameters} to disable it based on which option appears last in the params list.
*/
static final class ParameterOptionNormalizer implements JavacOptionNormalizer {

private static final String PARAMETERS = "-parameters";
private boolean parameters = false;

@Override
public boolean processOption(String option, Iterator<String> remaining) {
switch (option) {
case "-XDnoparameters":
parameters = false;
return true;
case PARAMETERS:
parameters = true;
return true;
default:
return false;
}
}

@Override
public void normalize(List<String> normalized) {
if (parameters) {
normalized.add(PARAMETERS);
}
}
}

private final ImmutableList<JavacOptionNormalizer> normalizers;

JavacOptions(ImmutableList<JavacOptionNormalizer> normalizers) {
Expand Down Expand Up @@ -450,7 +419,6 @@ public static JavacOptions createWithWarningsAsErrorsDefault(
ImmutableList.of(
new XlintOptionNormalizer(warningsAsErrorsDefault),
new WErrorOptionNormalizer(warningsAsErrorsDefault),
new ReleaseOptionNormalizer(),
new ParameterOptionNormalizer()));
new ReleaseOptionNormalizer()));
}
}

0 comments on commit c751241

Please sign in to comment.