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 249366 - MAX_TOOLTIP_LENGTH of 1000 characters doesn't work with html tooltips
Summary: MAX_TOOLTIP_LENGTH of 1000 characters doesn't work with html tooltips
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-15 16:51 UTC by sn1
Modified: 2015-07-06 21:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sn1 2014-12-15 16:51:27 UTC
I use html tooltips with some images given by URLs to images deep inside netbeans modules. These make the tooltip text very long although the rendered tooltip itself has only 7 short lines. The newly (NB 8.0.1) introduced MAX_TOOLTIP_LENGTH=1000 in org.netbeans.swing.outline.Outline cuts my tooltip in the middle of an image which leaves a broken image and breaks the tooltip.

The comment for MAX_TOOLTIP_LENGTH is "Tooltips larger than this are screwed up.". I couldn't find the original ticket which was the reason for this change. Nevertheless my (html) tooltips worked flawlessly, being much larger than 1000 characters.

Probably displaying regular (non html) tooltips with more than 1000 characters is an issue, but for html tooltips it doesn't seem to be a good idea to just cut it somewhere in the middle.
Comment 1 sn1 2014-12-15 16:56:48 UTC
For the BeanTreeView the same tooltip does still work.
Comment 2 sn1 2014-12-18 23:56:18 UTC
Found the original issue:
https://netbeans.org/bugzilla/show_bug.cgi?id=243700#c10

I would think there is a better way to fix the original issue than make the NB Platform worse by limiting it to an arbitrary number of 1000, which is much too short in my opinion. It is also inconsistent with the BeanTreeView.
Comment 3 _ gtzabari 2015-06-20 01:36:23 UTC
I don't know what version this was originally opened against, but I'm guessing it was 8.0.2. For what it's worth, I can reproduce the problem in:

Product Version: NetBeans IDE Dev (Build 201506110001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Please consider fixing this issue soon. It makes the debugger view less useful than it should be (cannot debug strings with over 1000 characters, which is very short indeed).
Comment 4 Martin Entlicher 2015-06-30 15:38:22 UTC
Thus we probably need to check if the tooltip is HTML, or plain text...
Comment 5 Martin Entlicher 2015-07-02 09:33:07 UTC
Fixed by changeset:   289347:3fbb0199153e
http://hg.netbeans.org/core-main/rev/3fbb0199153e
Comment 6 _ gtzabari 2015-07-02 14:11:38 UTC
Martin,

I wasn't asking for the limit to be increased exclusively for HTML. I was asking for it to be increased for plain text as well.

The original issue that added a limit set it at 100,000 characters. Why is the current limit down to 1,000 characters?

Please consider increasing the limit to 100,000, across both HTML and plain text (why should they be treated differently?).
Comment 7 Martin Entlicher 2015-07-02 16:17:10 UTC
I'm sorry, but the limit of 1000 characters was added to fix a rendering problem of tooltips. If you set a tooltip text containg e.g. 1500 characters, it's not rendered correctly. The text is sometimes written several times over itself, or it's empty, although the tooltip boundary is wide accross the whole screen.
I'd be happy if I would not be forced to add any such artificial constants into the code, but Swing has rendering problems. :-(

They can be reproduced with the project at https://netbeans.org/bugzilla/attachment.cgi?id=148284 when the tooltip limit is off.

The original limit was only to limit the memory consumption in debugger. And it stays at 100000. The other limit is for the tooltip rendering and this is 1000, longer strings can not be seen anyway due to width of most screens.

Tooltip in the editor that shows values of variables under the mouse during debugging, is a multi-line tooltip and this tooltip uses the 100000 text length limit. Thus longer values can be seen in the editor.

Resolving back as fixed, since for HTML tooltips, where a long text might have sense, it's fixed. And it's solely up to the HTML rendering to do it's best.
Comment 8 Quality Engineering 2015-07-04 02:08:53 UTC
Integrated into 'main-silver', will be available in build *201507040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3fbb0199153e
User: mentlicher@netbeans.org
Log: #249366: Do not cut HTML tooltips.
Comment 9 _ gtzabari 2015-07-06 20:02:32 UTC
Martin,

I just tried build 201507040001 and the Debugger editor for String is still limited to roughly 1,000 characters, not 100,000 characters as you had written. The specific message I am getting "The String value is too large. Displaying 1,003 characters out of 91,168 characters".

I am therefore reopening this issue.

If you believe this is a separate issue, I will happily open a new bug report but please try to fix this with high priority because it makes debugging JSON-structured strings very difficult.
Comment 10 Martin Entlicher 2015-07-06 20:15:37 UTC
And which JDK version are you using? You probably hit issue #250307 (yes, there are so many problems with showing values in debugger) :-(
The JDK bug is fixed in 1.8.0 update 60, therefore you'll see 100 000 characters again when you use update 60 or newer, or JDK 7.
Comment 11 _ gtzabari 2015-07-06 21:21:49 UTC
That did it (updating to JDK8 update 60). Thank you for the clarification and the fix!