On 02/11/2015 19:13, Paul Benedict wrote:
Alan, please correct me if wrong, but there is no enforced correlation
between the module name and the jar name it's packaged in, right? The
name is officially taken from the module-info.class?
For explicit modules (meaning those with a module-info.class) then that
is correct.
If so, I'd like to make a suggestion. One thing that's been extremely
useful to me with JBoss is the ability to link back to the JAR path in
the stack trace. Is there any chance you would consider expanding the
stack trace to something like this:
bar1
Exception in thread "main" java.lang.reflect.InvocationTargetException
at
sun.reflect.NativeMethodAccessorImpl.invoke0([email protected][c:\jdk\1.9\jre\modules\java.base.jar]/NativeMethod)
On the surface then this might look appealing but I've no doubt it would
be highly problematic too. For starters, disclosing file paths in
exceptions will lead to security concerns. The other thing is that file
paths or code sources can be quite long so it will make stack traces
harder to read. We are also not quite over the consequences of adding
the module name and version to the stack trace as there are always
consequences to changing something that is serialization. In this case,
there is still work to do in JMX.
BTW: With -verbose:class and -listmods then we already have a few ways
to tell where a module is loaded from.
-Alan