Skip to content

Commit

Permalink
refactor: remove classes from jrt-fs jar (#171)
Browse files Browse the repository at this point in the history
* refactor: remove indexing of jrt-fs jar because it is not used by JVM

* Fix tests
  • Loading branch information
algomaster99 authored Mar 7, 2024
1 parent 5db584f commit 0b13ef3
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ Map<String, Set<ClassFileAttributes>> createOrMergeProvenances(
referenceProvenance.computeIfAbsent(
resource.name(),
k -> new HashSet<>(Set.of(new ClassFileAttributes(classfileVersion, hash, algorithm))));
referenceProvenance.computeIfPresent(resource.name(), (k, v) -> {
v.add(new ClassFileAttributes(classfileVersion, hash, algorithm));
return v;
});
} catch (NoSuchAlgorithmException e) {
LOGGER.error("Failed to compute hash with algorithm: " + algorithm, e);
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ void jdk21_0_2_indexShouldBeReproducible_temurin(@TempDir Path tempDir) throws I
List<String> actual = Files.readAllLines(actualIndex);
List<String> expected = Files.readAllLines(expectedIndex);
assertThat(actual).isEqualTo(expected);

Map<String, Set<ClassFileAttributes>> referenceProvenance = ParsingHelper.deserializeFingerprints(actualIndex);
referenceProvenance.values().forEach(classFileAttributes -> assertThat(classFileAttributes.size())
.isEqualTo(1));
}

@EnabledOnJre(JRE.JAVA_17)
Expand All @@ -66,6 +70,10 @@ void jdk17_0_10_indexShouldBeReproducibleAcrossMultiple_implementations(@TempDir
List<String> actual = Files.readAllLines(actualIndex);
List<String> expected = Files.readAllLines(expectedIndex);
assertThat(actual).isEqualTo(expected);

Map<String, Set<ClassFileAttributes>> referenceProvenance = ParsingHelper.deserializeFingerprints(actualIndex);
referenceProvenance.values().forEach(classFileAttributes -> assertThat(classFileAttributes.size())
.isEqualTo(1));
}

@Test
Expand Down
Loading

0 comments on commit 0b13ef3

Please sign in to comment.