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 225763 - messed up stacktrace in description
Summary: messed up stacktrace in description
Status: NEW
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: ODCS Tasks (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-05 18:42 UTC by Tomas Stupka
Modified: 2013-10-09 09:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
<no description> (29.24 KB, image/png)
2013-02-05 18:42 UTC, Tomas Stupka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Stupka 2013-02-05 18:42:27 UTC
Product Version = NetBeans IDE Dev (Build 20130205-b4044059002f)
Operating System = Mac OS X version 10.8.2 running on x86_64
Java; VM; Vendor = 1.6.0_37
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.12-b01-434

see attachment
Comment 1 Tomas Stupka 2013-02-05 18:42:51 UTC
Created attachment 131045 [details]
<no description>
Comment 2 Tomas Pavek 2013-10-08 14:07:54 UTC
This is happening when the WikiEditPanel is used for the description text, rendered as HTML in JTextPane. (If setting "bugtracking.noWikiStyle" system property, it looks fine.) For examples see e.g. task #6264 from NetBeans_Test project or task #4 in CDevTestProject1.

1) The main problem is in StackTraceSupport.underlineStacktraces which re-fills the text pane's text from the document content, which ruins the formatting. The Document content does not match JTextPane.getText() in case HTML is used. The code here should not do textPane.setText("") at the beginning and then re-add pieces of text with styles, it should rather only set style on selected areas in the document via StyledDocument.setCharacterAttributes and otherwise leave the content untouched.

2) Another problem is that it is expected here that the stacktrace lines are separated via \n char. But in case of JTextPane with HTML the document content actually has no new line chars here. This causes that all the stacktrace lines are set to hyperlink style together in one area. If the #3 issue below is fixed, it will not look nice if the leading spaces on lines are underlined. Also due to the missing new line chars the stacktrace finding algorithm identifies the start of the stacktrace after the first "at". So even if the #1 issue above is fixed and the stacktrace is rendered in lines correctly, the first line will not include the word "at" while the other lines will. So it would be nice if the finding and style-marking algorithms don't rely on new line chars, but identify the lines in a different way (it seems there's always the word "at" at the beginning and closing parenthesis at the end).

3) WikiUtils.getHtmlFormatText destroys initial spaces at beginning of the stacktrace lines (in front of 'at'). It should probably use &nbsp; for them.