Bug 349900 - Infinite 'loop' involving remove and addModifyListener
Summary: Infinite 'loop' involving remove and addModifyListener
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2011-06-21 00:54 EDT by Marc-André Laperle CLA
Modified: 2020-08-15 12:00 EDT (History)
5 users (show)

See Also:


Attachments
Test project (1.81 KB, application/zip)
2011-06-21 00:54 EDT, Marc-André Laperle CLA
no flags Details
Test project (3.56 KB, application/zip)
2020-08-15 12:00 EDT, Marc-André Laperle CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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