This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217591 - Stack traces: hyperlink first, think later
Summary: Stack traces: hyperlink first, think later
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milos Kleint
Depends on:
Blocks: 205359
  Show dependency tree
Reported: 2012-08-29 18:56 UTC by Jesse Glick
Modified: 2012-09-13 02:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2012-08-29 18:56:18 UTC
If you run a program from Maven that produces stack traces, the logger will try to determine for every stack trace line whether source code is currently available in GlobalPathRegistry. This is bad for two reasons:

1. If there are lots of stack traces, output will be quite slow, much slower than running the same command from a shell. Better to pay the price for locating the source FileObject if and when the user actually clicks on it; do the minimum work when printing output.

2. Classes which _could_ have sources but do not have them at the time the stack trace is printed do not get hyperlinked. This is annoying because it is often the libraries you were not previously thinking about which are now implicated in an exception! Rerunning the program or trying to reproduce the exception is not always possible. You would expect that if a class from a closed project is hyperlinked but inaccessible, opening the project would let you try again. For a binary dependency, you would expect SourceJavadocAttacher to be tried.

OutputUtils.matchStackTraceLine seems to be at fault. I think the same problem applies to JavaAntLogger.messageLogged. JavaHudsonLogger is already fixed (1c70530ada72).

See bug #205359 for a suggested consolidated API, but fixing this issue at least for Maven should be easy: just move the body of 'if (match.matches())' into StacktraceOutputListener.outputLineAction, adjusting variables vs. fields accordingly; and add a call to SourceJavadocAttacher.attachSources if necessary (when the *.class can be located but *.java cannot). Can offer patch if you like.
Comment 1 Milos Kleint 2012-08-30 06:16:06 UTC
sounds good.
Comment 2 Milos Kleint 2012-09-10 09:14:16 UTC
Comment 3 Jesse Glick 2012-09-11 19:54:41 UTC
Almost works except for a fencepost error.

	at pkg.SomeTest.whatever(

takes you to line 57.
Comment 4 Quality Engineering 2012-09-12 02:12:58 UTC
Integrated into 'main-golden', will be available in build *201209120001* on (upload may still be in progress)
User: Milos Kleint <>
Log: #217591 mark all stacktrace candidates as links and only fail when user clicks the link
Comment 5 Milos Kleint 2012-09-12 06:42:04 UTC
Comment 6 Quality Engineering 2012-09-13 02:15:31 UTC
Integrated into 'main-golden', will be available in build *201209130001* on (upload may still be in progress)
User: Milos Kleint <>
Log: #217591 one line off