On Mon, 19 Sep 2022 18:51:30 GMT, Alexey Semenyuk <asemen...@openjdk.org> wrote:
>> Alexander Matveev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8293462: [macos] app image signature invalid when creating DMG or PKG from >> post processed signed image [v2] > > src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java line > 67: > >> 65: private final String mainClass; >> 66: private final List<LauncherInfo> addLauncherInfos; >> 67: private final boolean signed; > > This change defeats the idea of keeping `AppImageFile` immutable. I'd rather > add `AppImageFile.copyAsSigned()` method that will return the same > `AppImageFile` instance if `signed` is `true`, or a copy with `signed` set to > `true` otherwise. > > I'd add `public AppImageFile.save(Path appImageDir)` member function to > serialize `AppImageFile` instance and keep the signature of existing static > `AppImageFile.save` unchanged. I'd make them call static `private > AppImageFile.save(Path appImageDir, Map<String, Object> params, AppImageFile > appImage)` that you have right now in the review. `AppImageFile.save(Path > appImageDir, Map<String, Object> params, AppImageFile appImage)` is > implementation details and should not be a part of class public interface. 8293462: [macos] app image signature invalid when creating DMG or PKG from post processed signed image [v2] - Fixed as suggested. - Moved getAttribute() under LauncherInfo class, since it is used only by this class. - Added unit test for AppImageFile.copyAsSigned(). ------------- PR: https://git.openjdk.org/jdk/pull/10316