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.
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.
I'll fix this. It needs escape tooltip in GotoSupport.java:405. I create Editor Utility StringEscapeUtils.
Created attachment 128992 [details] Escape API I add StringEscapeUtils.escapeHtml and StringEscapeUtil.unescapeHtml to escape text to html.
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.
@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
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