Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Java] Truncate exception stacktraces #400

Open
lucaswerkmeister opened this Issue · 1 comment

2 participants

@lucaswerkmeister

A simple program like

void run() {
    throw Exception();
}

already produces a huge stacktrace:

ceylon.language.Exception ""
    at tmp.run_.run(run.ceylon:2)
    at tmp.run_.main(run.ceylon)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at ceylon.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:58)
    at ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48)
    at ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:85)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:145)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:129)
    at ceylon.modules.Main.execute(Main.java:69)
    at ceylon.modules.Main.main(Main.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jboss.modules.Module.run(Module.java:270)
    at org.jboss.modules.Main.main(Main.java:294)
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:208)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:343)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:283)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:89)
    at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:21)

That’s a lot of internals that no one really needs to see. I think Exception.printStacktrace() should be changed to truncate the Java stacktrace after run_.main.

@lucaswerkmeister

Of course, you could also go further and fix things like:

  • toplevel functions (run_.runrun)
  • default parameter functions (func$parfunc?)
  • comprehensions? (next$0 → ???)
  • and other compiler-internal constructs

Or maybe not, that’s a lot of special cases, and I’m not sure how the syntax should look. Besides, the source line mappings work, so it’s not that bad IMO.

@FroMage FroMage added this to the 1.2 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.