Modify

Opened 3 years ago

Closed 3 years ago

#21420 closed defect (fixed)

[Patch] JosmComboBox refactoring causes Coverity warning: Type mismatch between JList<Object> and JList<E>

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 21.10
Component: Core Version:
Keywords: regression coverity Cc: marcello@…

Description

Since #21319 / r18221, the following code in JosmComboBox causes a warning in coverity:

    @SuppressWarnings("unchecked")
    public JList<E> getList() {
        Object popup = getUI().getAccessibleChild(this, 0);
        if (popup != null && popup instanceof javax.swing.plaf.basic.ComboPopup) {
            return ((javax.swing.plaf.basic.ComboPopup) popup).getList();
        }
        return null;
    }
Using Eclipse FE
[WARNING] Internal compilation issue: src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java 304:20 Type mismatch: cannot convert from JList<Object> to JList<E>
[WARNING] Native compilation failure
[WARNING] Body of method 'org.openstreetmap.josm.gui.widgets.JosmComboBox.getList()' discarded due to error recovery.
Compilation successful!

@marcello: Do you see a way to avoid that?

Attachments (1)

21420.patch (1.1 KB ) - added by marcello@… 3 years ago.
Patch

Download all attachments as: .zip

Change History (4)

comment:1 by Don-vip, 3 years ago

Milestone: 21.0921.10

Milestone renamed

by marcello@…, 3 years ago

Attachment: 21420.patch added

Patch

comment:2 by skyper, 3 years ago

Summary: JosmComboBox refactoring causes Coverity warning: Type mismatch between JList<Object> and JList<E>[Patch] JosmComboBox refactoring causes Coverity warning: Type mismatch between JList<Object> and JList<E>

comment:3 by Don-vip, 3 years ago

Resolution: fixed
Status: newclosed

In 18280/josm:

fix #21420 - fix type mismatch warning (patch by marcello)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.