Skip to content

Commit e564fe9

Browse files
ted-xiecopybara-github
authored andcommitted
Delete deprecated hash mismatch flag in ZipFilterAction
PiperOrigin-RevId: 761615259 Change-Id: I354d3bb5e8b60ba63ec72107a1a00fa93f066960
1 parent 75a50ae commit e564fe9

2 files changed

Lines changed: 9 additions & 33 deletions

File tree

src/tools/java/com/google/devtools/build/android/ZipFilterAction.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,6 @@ static class Options {
133133
+ "same name are different."
134134
)
135135
HashMismatchCheckMode hashMismatchCheckMode = HashMismatchCheckMode.WARN;
136-
137-
/**
138-
* @deprecated please use --checkHashMismatch ERROR instead. Other options are IGNORE and WARN.
139-
*/
140-
@Deprecated
141-
@Parameter(
142-
names = "--errorOnHashMismatch",
143-
description = "Error on entry filter with hash mismatch."
144-
)
145-
boolean errorOnHashMismatch = false;
146-
147-
/**
148-
* @deprecated please use --checkHashMismatch WARN instead. Other options are IGNORE and WARN.
149-
* <p>This is a hack to support existing users of --noerrorOnHashMismatch. JCommander does
150-
* not support setting boolean flags with "--no", so instead we set the default to false and
151-
* just ignore anyone who passes --noerrorOnHashMismatch.
152-
*/
153-
@Deprecated
154-
@Parameter(names = "--noerrorOnHashMismatch")
155-
boolean ignored = false;
156136
}
157137

158138
/** Converts string flags to paths. Public because JCommander invokes this by reflection. */
@@ -247,11 +227,6 @@ static int run(String[] args) throws IOException {
247227
}
248228
}
249229

250-
// TODO(jingwen): Remove --errorOnHashMismatch when Blaze release with --checkHashMismatch
251-
// is checked in.
252-
if (options.errorOnHashMismatch) {
253-
options.hashMismatchCheckMode = HashMismatchCheckMode.ERROR;
254-
}
255230
ZipFilterEntryFilter entryFilter =
256231
new ZipFilterEntryFilter(
257232
explicitFilter,

src/tools/javatests/com/google/devtools/build/android/ZipFilterActionTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,15 @@ public void testSkipHashMismatchCheck() throws IOException {
319319
File output = tmp.newFile();
320320
output.delete();
321321
Path filter = createZip("foo.java", "bar.class");
322-
ImmutableList<String> args = ImmutableList.of(
323-
"--inputZip", input.toFile().getPath(),
324-
"--outputZip", output.getPath(),
325-
"--filterZips", filter.toFile().getPath(),
326-
"--filterTypes", ".class",
327-
"--explicitFilters", "bar\\.class",
328-
"--outputMode", "DONT_CARE",
329-
"--errorOnHashMismatch");
322+
ImmutableList<String> args =
323+
ImmutableList.of(
324+
"--inputZip", input.toFile().getPath(),
325+
"--outputZip", output.getPath(),
326+
"--filterZips", filter.toFile().getPath(),
327+
"--filterTypes", ".class",
328+
"--explicitFilters", "bar\\.class",
329+
"--outputMode", "DONT_CARE",
330+
"--checkHashMismatch", "ERROR");
330331
assertThat(outputEntriesWithArgs(args, output)).containsExactly("foo.java", "baz.class");
331332
}
332333

0 commit comments

Comments
 (0)