Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349900

Summary: Infinite 'loop' involving remove and addModifyListener
Product: [Eclipse Project] Platform Reporter: Marc-André Laperle <malaperle>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, gheorghe, marc.khouzam, remy.suen, xixiyan
Version: 3.7Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=459657
Whiteboard:
Attachments:
Description Flags
Test project
none
Test project none

Description Marc-André Laperle CLA 2011-06-21 00:54:50 EDT
Created attachment 198303 [details]
Test project

From bug 335402

comboModifyListener = new ModifyListener() {
    public void modifyText(ModifyEvent e) {
        String filePath = combo.getText();
        combo.removeModifyListener(comboModifyListener);
        combo.removeAll(); // defers a Modify event??
        combo.add(filePath);
        combo.setText(filePath);
        combo.addModifyListener(comboModifyListener); // Modify event actually
processed after this
    }
};

Resetting the content of the combobox defers a Modify event to after the
listener is added which means the ModifyListener triggers and receives a Modify
event constantly.

This only seems to happen with GTK. I tested this with Win32 x86_64 and Cocoa 32 and it worked fine. I tested with 3.7-RC3 and RC4 but bug 335402 suggests that it happened in 3.6.x too.
Comment 1 Xi Yan CLA 2018-08-16 16:27:40 EDT
I can reproduce the issue on SWT master of today.
Comment 2 Eclipse Genie CLA 2020-08-14 15:04:10 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Marc-André Laperle CLA 2020-08-15 11:58:45 EDT
It still happens as of 4.17-I20200729-1800
Comment 4 Marc-André Laperle CLA 2020-08-15 12:00:20 EDT
Created attachment 283880 [details]
Test project