You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2022/03/14 22:54:24 UTC

[netbeans] branch master updated: workaround due to old JDK bug (see JDK-4530952).

This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 2427a3b  workaround due to old JDK bug (see JDK-4530952).
     new 45a658d  Merge pull request #3777 from mbien/combobox-click-fix
2427a3b is described below

commit 2427a3b9dd5634cfc9c82694ce5b1873a3948f6e
Author: Michael Bien <mb...@gmail.com>
AuthorDate: Mon Mar 14 02:15:16 2022 +0100

    workaround due to old JDK bug (see JDK-4530952).
    
    JComboBox appears to consume the first click on focus lost under
    certain conditions.
---
 .../api.search/src/org/netbeans/modules/search/BasicSearchForm.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/platform/api.search/src/org/netbeans/modules/search/BasicSearchForm.java b/platform/api.search/src/org/netbeans/modules/search/BasicSearchForm.java
index ed0879e..be5dd5d 100644
--- a/platform/api.search/src/org/netbeans/modules/search/BasicSearchForm.java
+++ b/platform/api.search/src/org/netbeans/modules/search/BasicSearchForm.java
@@ -1112,7 +1112,10 @@ final class BasicSearchForm extends JPanel implements ChangeListener,
 
         @Override
         public void setItem(Object item) {
-            area.setText(Objects.toString(item, ""));
+            String text = Objects.toString(item, "");
+            if (!text.equals(area.getText())) { // see BasicComboBoxEditor.setItem(item) or JDK-4530952
+                area.setText(text);
+            }
         }
 
         @Override

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists