On 1/10/17, 9:14 PM, Mandy Chung wrote:
I agree that you can depend on the validation done by
ModuleDescriptor::read as long as the jar tool reports the error
message gracefully (probably catch InvalidModuleDescriptorException
and output the error). It’d be good to add a comment to describe that
exports/opens package will be validated.
webrev has been updated to catch IMDE and fails the jar as other fatal
error handing.
http://cr.openjdk.java.net/~sherman/8172432/webrev
compared to last webrev, the changes are
(1) Main.java line#1839 checkModuleInfo(), renamed from checkServices(),
in which the impl
catches the InvalidModuleDescriptorException for the open/exported pkg
check.
(2) Validator.java line#343 checkModuleDescriptor(), same as (1) above,
the IMDE is
caught and handled, when the ModuleDescriptor object being checked is
the first
versioned md (lowest) and there is NO root module-info.class, in which
case, this
md is the base module-info.class
(3) couple test cases has been added in
test/tools/jar/modularJar/Basic.java to test
above scenarios.
-----------------------------------
If I’m not mistaken, this change also resolves
https://bugs.openjdk.java.net/browse/JDK-8165640, right ?
------------------------------------
To Chris, yes, 8165640 is being addressed as well here.
Thank,
Sherman