Fix: tabs without file objects had null title in tab switcher#8213
Fix: tabs without file objects had null title in tab switcher#8213ebarboni merged 1 commit intoapache:deliveryfrom
Conversation
platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
Show resolved
Hide resolved
|
found a second issue unfortunately the file2file diff title is broken, trying to fix it |
d8cfe40 to
2c8323c
Compare
|
fix is to escape the original tab title if:
didn't want to add a dependency to editor utils to get to StringEscapeUtils so I use the XML util which is essentially the same thing plus bonus exception. This reminded me that we should probably put https://github.com/OWASP/owasp-java-encoder/ somewhere. |
| } else { | ||
| res.append( prefix ); | ||
| res.append( baseText ); | ||
| if (prefix.startsWith("<font")) { |
- example: repo history with parent folder decorator enabled - or diff between two files - regression since ad776db
2c8323c to
d9d269c
Compare
|
@neilcsmith-net @eirikbakke pinging for review. IMO: this should not slip through rc2, we should either merge this or merge a revert of #7930. cc @ebarboni |
|
Adjustments look fine. The handling of Swing HTML formatting is a bit ugly in this class, but bugs here are purely cosmetic in nature. (Swing HTML parsers, or the simplified parsers in NetBeans, do not execute Javascript or such.) |
|
yeah, what makes it ugly is that it has to support all combinations of html text and plain text for both tab title and prefix. There are many places within NB which have to detect if a string is html or plain. |
|
In my own NetBeans app I have a dedicated SwingString class for passing, concatenating, and escaping strings that may or may not contain Swing HTML formatting. That way the type checker takes care of tracking and documenting where HTML formatting may be used. Would probably be way too much work to adapt that in NetBeans, though. |
|
LGTM |
targets delivery