Type mismatch: cannot convert from integer to boolean

后端 未结 7 1338
忘了有多久
忘了有多久 2020-12-06 01:48
public boolean clearSelection() {
    int i = 0;
    if (!this.m_SelectedComps.isEmpty()) {
        i = 1;
        Iterator localIterator = this.m_SelectedComps.iter         


        
7条回答
  •  醉话见心
    2020-12-06 02:12

    Declare i as a boolean:

    public boolean clearSelection()
    {
        boolean i = false;
        if (!this.m_SelectedComps.isEmpty())
        {
            i = true;
            Iterator localIterator = this.m_SelectedComps.iterator();
            while (localIterator.hasNext())
              ((AnnotComponent)localIterator.next()).remove();
            this.m_SelectedComps.clear();
        }
        return i;
    }
    

提交回复
热议问题