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 223389 - '<' character missing in constant preview tooltip
Summary: '<' character missing in constant preview tooltip
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.2.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 12:40 UTC by denbo
Modified: 2012-12-11 03:03 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Escape API (11.45 KB, patch)
2012-12-06 16:40 UTC, Milutin Kristofic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description denbo 2012-12-06 12:40:30 UTC
Problem:
You define a constant which contains the '<' character one or multiple times, e.g.:
    private final static String FOO = "a < b < c > d > e";
When you hover over the constant symbol ("FOO" in this case) in the editor, a tooltip is displayed which shows a preview of the constant's value. However, the '<' characters are missing in this preview. The string from the example is displayed as "a b c > d > e"

The impact can be quite high; I ran into the bug when verifying boundary conditions in SQL statements. "startDate <= :startDate" looked like "startDate = :startDate" which caused quite some confusion.
Comment 1 Milutin Kristofic 2012-12-06 14:38:31 UTC
I'll fix this. It needs escape tooltip in GotoSupport.java:405. I create Editor Utility StringEscapeUtils.
Comment 2 Milutin Kristofic 2012-12-06 16:40:08 UTC
Created attachment 128992 [details]
Escape API

I add StringEscapeUtils.escapeHtml and StringEscapeUtil.unescapeHtml                 to escape text to html.
Comment 3 Ondrej Brejla 2012-12-06 16:56:00 UTC
OB01: I'm just not sure, if the method does exactly what it says. It just replaces 4 chars by their escape sequences, not all "html possibilities". Please, consider the usage of org.apache.commons.lang.StringEscapeUtils. Or you can just inspire yourself :)

OB02: And provide some JavaDoc plz. Especially if that escapeHtml() method handles just 4 characters.

Thanks in advance.
Comment 4 Milutin Kristofic 2012-12-10 11:33:12 UTC
@OB01: I didn't want to make dependency on org.apache.commons.lang.StringEscapeUtils for one method. I saw whole list of encoding changes, but I took just basic one for my purpose. The rest can be added by other client of API.

@OB02 Added some javadoc

http://hg.netbeans.org/jet-main/rev/c9e6d65cc909
Comment 5 Quality Engineering 2012-12-11 03:03:47 UTC
Integrated into 'main-golden', will be available in build *201212110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c9e6d65cc909
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #223389 - '<' character missing in constant preview tooltip