8340116: test/jdk/sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java can fail due to regex

Reviewed-by: mullan
This commit is contained in:
Fernando Guallini 2024-11-01 13:11:56 +00:00 committed by Sean Mullan
parent da0e9e38e3
commit 7e87c071b0

View File

@ -243,9 +243,8 @@ public class PreserveRawManifestEntryAndDigest {
* @see "concise_jarsigner.sh"
*/
String[] getExpectedJarSignerOutputUpdatedContentNotValidatedBySignerA(
String jarFilename, String digestalg,
String firstAddedFilename, String secondAddedFilename) {
final String TS = ".{28,29}"; // matches a timestamp
final String TS = ".{28,34}"; // matches a timestamp
List<String> expLines = new ArrayList<>();
expLines.add("s k *\\d+ " + TS + " META-INF/MANIFEST[.]MF");
expLines.add(" *\\d+ " + TS + " META-INF/B[.]SF");
@ -347,7 +346,6 @@ public class PreserveRawManifestEntryAndDigest {
assertMatchByLines(
fromFirstToSecondEmptyLine(o.getStdout().split("\\R")),
getExpectedJarSignerOutputUpdatedContentNotValidatedBySignerA(
jarFilename4, digestalg,
firstAddedFilename, secondAddedFilename));
// double-check reading the files with a verifying JarFile