< prev index next >

src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java

Print this page
rev 58306 : 8240734: ModuleHashes attribute not reproducible between builds
Reviewed-by: duke
Contributed-by: hedongbo@huawei.com

*** 1,7 **** /* ! * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 32,41 **** --- 32,42 ---- import java.nio.file.Path; import java.util.ArrayDeque; import java.util.Collections; import java.util.Deque; import java.util.HashMap; + import java.util.TreeMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.function.Consumer; import java.util.function.Function;
*** 96,106 **** // traverse the modules in topological order that will identify // the modules to record the hashes - it is the first matching // module and has not been hashed during the traversal. Set<String> mods = new HashSet<>(); ! Map<String, ModuleHashes> hashes = new HashMap<>(); builder.build() .orderedNodes() .filter(mn -> roots.contains(mn) && !mods.contains(mn)) .forEach(mn -> { // Compute hashes of the modules that depend on mn directly and --- 97,107 ---- // traverse the modules in topological order that will identify // the modules to record the hashes - it is the first matching // module and has not been hashed during the traversal. Set<String> mods = new HashSet<>(); ! Map<String, ModuleHashes> hashes = new TreeMap<>(); builder.build() .orderedNodes() .filter(mn -> roots.contains(mn) && !mods.contains(mn)) .forEach(mn -> { // Compute hashes of the modules that depend on mn directly and
< prev index next >