On Tue, 19 May 2026 15:32:58 GMT, Kevin Walls <[email protected]> wrote:
>> src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
>> line 56:
>>
>>> 54: for (int i = 0; i < params.length; i++) {
>>> 55: if(params[i].getName() != null) {
>>> 56: JLabel name = new JLabel(params[i].getName(),
>>> JLabel.CENTER) {
>>
>> I think this pattern should be carefully checked, in this particular patch
>> and all previous related patches.
>> Check what the code is actually render in these two similar but different
>> cases:
>>
>> private static final String INPUT = "<html><b>BOOM</b></html>";
>>
>> public static void main(String[] args) throws Exception {
>> JLabel actual = new JLabel(INPUT, JLabel.CENTER);
>> actual.putClientProperty("html.disable", Boolean.TRUE);
>> System.out.println("Actual: " + getText(actual));
>>
>> JLabel expected = new JLabel();
>> expected.putClientProperty("html.disable", Boolean.TRUE);
>> expected.setText(INPUT);
>> System.out.println("Expected: " + getText(expected));
>> }
>>
>> private static String getText(JLabel label) throws Exception {
>> View v = (View) label.getClientProperty("html");
>> if (v != null) {
>> return v.getDocument().getText(0, v.getDocument().getLength());
>> }
>> return label.getText();
>> }
>> }
>>
>> getText above is implemented in a same way as
>> https://github.com/openjdk/jdk/blob/22b46872d0d647c9ef9f4414b4685afa8313926d/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java#L193
>
> OK, I see settting the html.disable interacts with setting and getting the
> text. Can reorder this and one more like it below...
I already noticed this behaviour and submitted a bug to fix this, but the fix
isn't ready yet.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30998#discussion_r3305082270