#fixed code
                              public void actionPerformed(final ActionEvent e) {
    if(e == null) {
      if(GUIProp.execrt) query(false);
      return;
    }

    final Object source = e.getSource();

    int cp = 0;
    final int cs = panel.getComponentCount();
    for(int c = 0; c < cs; c++) if(panel.getComponent(c) == source) cp = c;

    if((cp & 1) == 0) {
      // ComboBox with tags/attributes
      final BaseXCombo combo = (BaseXCombo) source;

      panel.remove(cp + 1);
      if(combo.getSelectedIndex() != 0) {
        final String item = combo.getSelectedItem().toString();
        final StatsKey key = GUI.context.data().stats.get(Token.token(item));
        switch(key.kind) {
          case INT:
            addSlider(key.min, key.max, cp + 1, item.equals("@size"),
                item.equals("@mtime"), true);
            break;
          case DBL:
            addSlider(key.min, key.max, cp + 1, false, false, false);
            break;
          case CAT:
            addCombo(keys(key.cats), cp + 1);
            break;
          case TEXT:
            addInput(cp + 1);
            break;
          case NONE:
            final BaseXLabel label = new BaseXLabel("");
            label.setBorder(new EmptyBorder(3, 0, 0, 0));
            panel.add(label, cp + 1);
            break;
        }
        if(cp + 2 == cs) addKeys(cp + 2);
        panel.validate();
        panel.repaint();
      } else {
        panel.add(new BaseXLabel(""), cp + 1);
        if(cp + 4 == cs && ((BaseXCombo) panel.getComponent(cp + 2)).
            getSelectedIndex() == 0) {
          panel.remove(cp + 2);
          panel.remove(cp + 2);
          panel.validate();
          panel.repaint();
        }
      }
    }
    if(GUIProp.execrt) query(false);
  }
#vulnerable code 
                              public void actionPerformed(final ActionEvent e) {
    if(e == null) {
      if(GUIProp.execrt) query(false);
      return;
    }

    final Object source = e.getSource();

    int cp = 0;
    final int cs = panel.getComponentCount();
    for(int c = 0; c < cs; c++) if(panel.getComponent(c) == source) cp = c;

    if((cp & 1) == 0) {
      // ComboBox with tags/attributes
      final BaseXCombo combo = (BaseXCombo) source;

      panel.remove(cp + 1);
      if(combo.getSelectedIndex() != 0) {
        final String item = combo.getSelectedItem().toString();
        final StatsKey key = GUI.context.data().stats.get(Token.token(item));
        switch(key.kind) {
          case INT:
            addSlider(key.min, key.max, cp + 1, item.equals("@size"),
                item.equals("@mtime"), true);
            break;
          case DBL:
            addSlider(key.min, key.max, cp + 1, false, false, false);
            break;
          case CAT:
            addCombo(keys(key.cats), cp + 1);
            break;
          case TEXT:
            addInput(cp + 1);
            break;
          case NONE:
            //final BaseXLabel label = new BaseXLabel("(no texts available)");
            final BaseXLabel label = new BaseXLabel("");
            label.setBorder(new EmptyBorder(3, 0, 0, 0));
            panel.add(label, cp + 1);
            break;
        }
        if(cp + 2 == cs) addKeys(cp + 2);
        panel.validate();
        panel.repaint();
      } else {
        panel.add(new BaseXLabel(""), cp + 1);
        if(cp + 4 == cs && ((BaseXCombo) panel.getComponent(cp + 2)).
            getSelectedIndex() == 0) {
          panel.remove(cp + 2);
          panel.remove(cp + 2);
          panel.validate();
          panel.repaint();
        }
      }
    }
    if(GUIProp.execrt) query(false);
  } 
                            #location 21 
                            #vulnerability type NULL_DEREFERENCE